Class: LanguageServer::Protocol::Interface::InlineValue
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::InlineValue
- Defined in:
- lib/language_server/protocol/interface/inline_value.rb
Overview
Inline value information can be provided by different means:
-
directly as a text value (class InlineValueText).
-
as a name to use for a variable lookup (class InlineValueVariableLookup)
-
as an evaluatable expression (class InlineValueEvaluatableExpression)
The InlineValue types combines all inline value types into one type.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#case_sensitive_lookup ⇒ boolean
How to perform the lookup.
-
#expression ⇒ string | nil
If specified the expression overrides the extracted expression.
-
#initialize(range:, text:, variable_name: nil, case_sensitive_lookup:, expression: nil) ⇒ InlineValue
constructor
A new instance of InlineValue.
-
#range ⇒ Range
The document range for which the inline value applies.
-
#text ⇒ string
The text of the inline value.
- #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:, text:, variable_name: nil, case_sensitive_lookup:, expression: nil) ⇒ InlineValue
Returns a new instance of InlineValue.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 14 def initialize(range:, text:, variable_name: nil, case_sensitive_lookup:, expression: nil) @attributes = {} @attributes[:range] = range @attributes[:text] = text @attributes[:variableName] = variable_name if variable_name @attributes[:caseSensitiveLookup] = case_sensitive_lookup @attributes[:expression] = expression if expression @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
66 67 68 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 66 def attributes @attributes end |
Instance Method Details
#case_sensitive_lookup ⇒ boolean
How to perform the lookup.
54 55 56 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 54 def case_sensitive_lookup attributes.fetch(:caseSensitiveLookup) end |
#expression ⇒ string | nil
If specified the expression overrides the extracted expression.
62 63 64 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 62 def expression attributes.fetch(:expression) end |
#range ⇒ Range
The document range for which the inline value applies.
30 31 32 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 30 def range attributes.fetch(:range) end |
#text ⇒ string
The text of the inline value.
38 39 40 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 38 def text attributes.fetch(:text) end |
#to_hash ⇒ Object
68 69 70 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 68 def to_hash attributes end |
#to_json(*args) ⇒ Object
72 73 74 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 72 def to_json(*args) to_hash.to_json(*args) end |
#variable_name ⇒ string | nil
If specified the name of the variable to look up.
46 47 48 |
# File 'lib/language_server/protocol/interface/inline_value.rb', line 46 def variable_name attributes.fetch(:variableName) end |