Class: LanguageServer::Protocol::Interface::InlineValueVariableLookup
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::InlineValueVariableLookup
- Defined in:
- lib/language_server/protocol/interface/inline_value_variable_lookup.rb
Overview
Provide inline value through a variable lookup.
If only a range is specified, the variable name will be extracted from the underlying document.
An optional variable name can be used to override the extracted name.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#case_sensitive_lookup ⇒ boolean
How to perform the lookup.
-
#initialize(range:, variable_name: nil, case_sensitive_lookup:) ⇒ InlineValueVariableLookup
constructor
A new instance of InlineValueVariableLookup.
-
#range ⇒ Range
The document range for which the inline value applies.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#variable_name ⇒ string
If specified the name of the variable to look up.
Constructor Details
#initialize(range:, variable_name: nil, case_sensitive_lookup:) ⇒ InlineValueVariableLookup
Returns a new instance of InlineValueVariableLookup.
13 14 15 16 17 18 19 20 21 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 13 def initialize(range:, variable_name: nil, case_sensitive_lookup:) @attributes = {} @attributes[:range] = range @attributes[:variableName] = variable_name if variable_name @attributes[:caseSensitiveLookup] = case_sensitive_lookup @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
49 50 51 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 49 def attributes @attributes end |
Instance Method Details
#case_sensitive_lookup ⇒ boolean
How to perform the lookup.
45 46 47 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 45 def case_sensitive_lookup attributes.fetch(:caseSensitiveLookup) end |
#range ⇒ Range
The document range for which the inline value applies. The range is used to extract the variable name from the underlying document.
29 30 31 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 29 def range attributes.fetch(:range) end |
#to_hash ⇒ Object
51 52 53 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 51 def to_hash attributes end |
#to_json(*args) ⇒ Object
55 56 57 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 55 def to_json(*args) to_hash.to_json(*args) end |
#variable_name ⇒ string
If specified the name of the variable to look up.
37 38 39 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 37 def variable_name attributes.fetch(:variableName) end |