Class: LanguageServer::Protocol::Interface::DiagnosticRelatedInformation
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::DiagnosticRelatedInformation
- Defined in:
- lib/language_server/protocol/interface/diagnostic_related_information.rb
Overview
Represents a related message and source code location for a diagnostic. This should be used to point to code locations that cause or are related to a diagnostics, e.g when duplicating a symbol in a scope.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(location:, message:) ⇒ DiagnosticRelatedInformation
constructor
A new instance of DiagnosticRelatedInformation.
-
#location ⇒ Location
The location of this related diagnostic information.
-
#message ⇒ string
The message of this related diagnostic information.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(location:, message:) ⇒ DiagnosticRelatedInformation
Returns a new instance of DiagnosticRelatedInformation.
10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/diagnostic_related_information.rb', line 10 def initialize(location:, message:) @attributes = {} @attributes[:location] = location @attributes[:message] = @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
35 36 37 |
# File 'lib/language_server/protocol/interface/diagnostic_related_information.rb', line 35 def attributes @attributes end |
Instance Method Details
#location ⇒ Location
The location of this related diagnostic information.
23 24 25 |
# File 'lib/language_server/protocol/interface/diagnostic_related_information.rb', line 23 def location attributes.fetch(:location) end |
#message ⇒ string
The message of this related diagnostic information.
31 32 33 |
# File 'lib/language_server/protocol/interface/diagnostic_related_information.rb', line 31 def attributes.fetch(:message) end |
#to_hash ⇒ Object
37 38 39 |
# File 'lib/language_server/protocol/interface/diagnostic_related_information.rb', line 37 def to_hash attributes end |
#to_json(*args) ⇒ Object
41 42 43 |
# File 'lib/language_server/protocol/interface/diagnostic_related_information.rb', line 41 def to_json(*args) to_hash.to_json(*args) end |