class LanguageServer::Protocol::Interface::InlineValueEvaluatableExpression

Provide an inline value through an expression evaluation.

If only a range is specified, the expression will be extracted from the underlying document.

An optional expression can be used to override the extracted expression.

Attributes

attributes[R]

Public Class Methods

new(range:, expression: nil) click to toggle source
# File lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb, line 13
def initialize(range:, expression: nil)
  @attributes = {}

  @attributes[:range] = range
  @attributes[:expression] = expression if expression

  @attributes.freeze
end

Public Instance Methods

expression() click to toggle source

If specified the expression overrides the extracted expression.

@return [string]

# File lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb, line 36
def expression
  attributes.fetch(:expression)
end
range() click to toggle source

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

@return [Range]

# File lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb, line 28
def range
  attributes.fetch(:range)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb, line 42
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb, line 46
def to_json(*args)
  to_hash.to_json(*args)
end