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

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

Overview

The publish diagnostic client capabilities.

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.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 8

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.



72
73
74
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 72

def attributes
  @attributes
end

Instance Method Details

#code_description_supportboolean | nil

Client supports a codeDescription property

Returns:

  • (boolean | nil)

Since:

  • 3.16.0



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

def code_description_support
  attributes.fetch(:codeDescriptionSupport)
end

#data_supportboolean | nil

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

Returns:

  • (boolean | nil)

Since:

  • 3.16.0



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

def data_support
  attributes.fetch(:dataSupport)
end

Whether the clients accepts diagnostics with related information.

Returns:

  • (boolean | nil)


24
25
26
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 24

def related_information
  attributes.fetch(:relatedInformation)
end

#tag_support{ valueSet:DiagnosticTag[] } | nil

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

Returns:

  • ({ valueSet:DiagnosticTag[] } | nil)

Since:

  • 3.15.0



35
36
37
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 35

def tag_support
  attributes.fetch(:tagSupport)
end

#to_hashObject



74
75
76
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 74

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



78
79
80
# File 'lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb', line 78

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

#version_supportboolean | nil

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

Returns:

  • (boolean | nil)

Since:

  • 3.15.0



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

def version_support
  attributes.fetch(:versionSupport)
end