class LanguageServer::Protocol::Interface::InlineValueVariableLookup

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.

Attributes

attributes[R]

Public Class Methods

new(range:, variable_name: nil, case_sensitive_lookup:) click to toggle source
# 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

Public Instance Methods

case_sensitive_lookup() click to toggle source

How to perform the lookup.

@return [boolean]

# File lib/language_server/protocol/interface/inline_value_variable_lookup.rb, line 45
def case_sensitive_lookup
  attributes.fetch(:caseSensitiveLookup)
end
range() click to toggle source

The document range for which the inline value applies. The range is used to extract the variable name from the underlying document.

@return [Range]

# File lib/language_server/protocol/interface/inline_value_variable_lookup.rb, line 29
def range
  attributes.fetch(:range)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/inline_value_variable_lookup.rb, line 51
def to_hash
  attributes
end
to_json(*args) click to toggle source
# 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() click to toggle source

If specified the name of the variable to look up.

@return [string]

# File lib/language_server/protocol/interface/inline_value_variable_lookup.rb, line 37
def variable_name
  attributes.fetch(:variableName)
end