Class: LanguageServer::Protocol::Interface::PublishDiagnosticsParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::PublishDiagnosticsParams
- Defined in:
- lib/language_server/protocol/interface/publish_diagnostics_params.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#diagnostics ⇒ Diagnostic[]
An array of diagnostic information items.
-
#initialize(uri:, version: nil, diagnostics:) ⇒ PublishDiagnosticsParams
constructor
A new instance of PublishDiagnosticsParams.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ string
The URI for which diagnostic information is reported.
-
#version ⇒ number
Optional the version number of the document the diagnostics are published for.
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
#attributes ⇒ Object (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
#diagnostics ⇒ Diagnostic[]
An array of diagnostic information items.
36 37 38 |
# File 'lib/language_server/protocol/interface/publish_diagnostics_params.rb', line 36 def diagnostics attributes.fetch(:diagnostics) end |
#to_hash ⇒ Object
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 |
#uri ⇒ string
The URI for which diagnostic information is reported.
19 20 21 |
# File 'lib/language_server/protocol/interface/publish_diagnostics_params.rb', line 19 def uri attributes.fetch(:uri) end |
#version ⇒ number
Optional the version number of the document the diagnostics are published for.
28 29 30 |
# File 'lib/language_server/protocol/interface/publish_diagnostics_params.rb', line 28 def version attributes.fetch(:version) end |