Class: LanguageServer::Protocol::Interface::PublishDiagnosticsParams

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri:, version: nil, diagnostics:) ⇒ PublishDiagnosticsParams

Returns a new instance of PublishDiagnosticsParams.



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

def initialize(uri:, version: nil, diagnostics:)
  @attributes = {}

  @attributes[:uri] = uri
  @attributes[:version] = version if version
  @attributes[:diagnostics] = diagnostics

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



40
41
42
# File 'lib/language_server/protocol/interface/publish_diagnostics_params.rb', line 40

def attributes
  @attributes
end

Instance Method Details

#diagnosticsDiagnostic[]

An array of diagnostic information items.

Returns:



36
37
38
# File 'lib/language_server/protocol/interface/publish_diagnostics_params.rb', line 36

def diagnostics
  attributes.fetch(:diagnostics)
end

#to_hashObject



42
43
44
# File 'lib/language_server/protocol/interface/publish_diagnostics_params.rb', line 42

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#uristring

The URI for which diagnostic information is reported.

Returns:

  • (string)


19
20
21
# File 'lib/language_server/protocol/interface/publish_diagnostics_params.rb', line 19

def uri
  attributes.fetch(:uri)
end

#versionnumber

Optional the version number of the document the diagnostics are published for.

Returns:

  • (number)


28
29
30
# File 'lib/language_server/protocol/interface/publish_diagnostics_params.rb', line 28

def version
  attributes.fetch(:version)
end