Class: LanguageServer::Protocol::Interface::PublishDiagnosticsClientCapabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(related_information: nil, tag_support: nil, version_support: nil, code_description_support: nil, data_support: nil) ⇒ PublishDiagnosticsClientCapabilities

Returns a new instance of PublishDiagnosticsClientCapabilities.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 5

def initialize(related_information: nil, tag_support: nil, version_support: nil, code_description_support: nil, data_support: nil)
  @attributes = {}

  @attributes[:relatedInformation] = related_information if related_information
  @attributes[:tagSupport] = tag_support if tag_support
  @attributes[:versionSupport] = version_support if version_support
  @attributes[:codeDescriptionSupport] = code_description_support if code_description_support
  @attributes[:dataSupport] = data_support if data_support

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



61
62
63
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 61

def attributes
  @attributes
end

Instance Method Details

#code_description_supportboolean

Client supports a codeDescription property

Returns:

  • (boolean)


47
48
49
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 47

def code_description_support
  attributes.fetch(:codeDescriptionSupport)
end

#data_supportboolean

Whether code action supports the ‘data` property which is preserved between a `textDocument/publishDiagnostics` and `textDocument/codeAction` request.

Returns:

  • (boolean)


57
58
59
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 57

def data_support
  attributes.fetch(:dataSupport)
end

Whether the clients accepts diagnostics with related information.

Returns:

  • (boolean)


21
22
23
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 21

def related_information
  attributes.fetch(:relatedInformation)
end

#tag_support{ valueSet: DiagnosticTag[]; }

Client supports the tag property to provide meta data about a diagnostic. Clients supporting tags have to handle unknown tags gracefully.

Returns:

  • ({ valueSet: DiagnosticTag[]; })


30
31
32
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 30

def tag_support
  attributes.fetch(:tagSupport)
end

#to_hashObject



63
64
65
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 63

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



67
68
69
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 67

def to_json(*args)
  to_hash.to_json(*args)
end

#version_supportboolean

Whether the client interprets the version property of the ‘textDocument/publishDiagnostics` notification’s parameter.

Returns:

  • (boolean)


39
40
41
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 39

def version_support
  attributes.fetch(:versionSupport)
end