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
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 | nil
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.
12 13 14 15 16 17 18 19 20 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 12 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)
47 48 49 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 47 def attributes @attributes end |
Instance Method Details
#case_sensitive_lookup ⇒ boolean
How to perform the lookup.
43 44 45 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 43 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.
27 28 29 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 27 def range attributes.fetch(:range) end |
#to_hash ⇒ Object
49 50 51 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 49 def to_hash attributes end |
#to_json(*args) ⇒ Object
53 54 55 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 53 def to_json(*args) to_hash.to_json(*args) end |
#variable_name ⇒ string | nil
If specified the name of the variable to look up.
35 36 37 |
# File 'lib/language_server/protocol/interface/inline_value_variable_lookup.rb', line 35 def variable_name attributes.fetch(:variableName) end |