Sha256: 85f5b84860ea3513fa50114e4cb14727d68f16bf46cd0f540c34a76f96d9c322

Contents?: true

Size: 1.25 KB

Versions: 104

Compression:

Stored size: 1.25 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # 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.
      #
      class InlineValueEvaluatableExpression
        def initialize(range:, expression: nil)
          @attributes = {}

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

          @attributes.freeze
        end

        #
        # The document range for which the inline value applies.
        # The range is used to extract the evaluatable expression from the
        # underlying document.
        #
        # @return [Range]
        def range
          attributes.fetch(:range)
        end

        #
        # If specified the expression overrides the extracted expression.
        #
        # @return [string]
        def expression
          attributes.fetch(:expression)
        end

        attr_reader :attributes

        def to_hash
          attributes
        end

        def to_json(*args)
          to_hash.to_json(*args)
        end
      end
    end
  end
end

Version data entries

104 entries across 104 versions & 13 rubygems

Version Path
harbr-0.1.84 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.83 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.82 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.81 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.80 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.79 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.78 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.77 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.76 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.75 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.74 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.73 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.72 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.71 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.70 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.69 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.68 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.67 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.66 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-0.1.65 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb