Class: LanguageServer::Protocol::Interface::LocationLink
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::LocationLink
- Defined in:
- lib/language_server/protocol/interface/location_link.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(origin_selection_range: nil, target_uri:, target_range:, target_selection_range: nil) ⇒ LocationLink
constructor
A new instance of LocationLink.
-
#origin_selection_range ⇒ Range
Span of the origin of this link.
-
#target_range ⇒ Range
The full target range of this link.
-
#target_selection_range ⇒ Range
The span of this link.
-
#target_uri ⇒ string
The target resource identifier of this link.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(origin_selection_range: nil, target_uri:, target_range:, target_selection_range: nil) ⇒ LocationLink
Returns a new instance of LocationLink.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/language_server/protocol/interface/location_link.rb', line 5 def initialize(origin_selection_range: nil, target_uri:, target_range:, target_selection_range: nil) @attributes = {} @attributes[:originSelectionRange] = origin_selection_range if origin_selection_range @attributes[:targetUri] = target_uri @attributes[:targetRange] = target_range @attributes[:targetSelectionRange] = target_selection_range if target_selection_range @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
51 52 53 |
# File 'lib/language_server/protocol/interface/location_link.rb', line 51 def attributes @attributes end |
Instance Method Details
#origin_selection_range ⇒ Range
Span of the origin of this link.
Used as the underlined span for mouse interaction. Defaults to the word range at the mouse position.
23 24 25 |
# File 'lib/language_server/protocol/interface/location_link.rb', line 23 def origin_selection_range attributes.fetch(:originSelectionRange) end |
#target_range ⇒ Range
The full target range of this link.
39 40 41 |
# File 'lib/language_server/protocol/interface/location_link.rb', line 39 def target_range attributes.fetch(:targetRange) end |
#target_selection_range ⇒ Range
The span of this link.
47 48 49 |
# File 'lib/language_server/protocol/interface/location_link.rb', line 47 def target_selection_range attributes.fetch(:targetSelectionRange) end |
#target_uri ⇒ string
The target resource identifier of this link.
31 32 33 |
# File 'lib/language_server/protocol/interface/location_link.rb', line 31 def target_uri attributes.fetch(:targetUri) end |
#to_hash ⇒ Object
53 54 55 |
# File 'lib/language_server/protocol/interface/location_link.rb', line 53 def to_hash attributes end |
#to_json(*args) ⇒ Object
57 58 59 |
# File 'lib/language_server/protocol/interface/location_link.rb', line 57 def to_json(*args) to_hash.to_json(*args) end |