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.43 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.42 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.41 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.39 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.38 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.37 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
study_line-0.1.6 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
study_line-0.1.5 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
study_line-0.1.4 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
study_line-0.1.3 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
study_line-0.1.2 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
study_line-0.1.1 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
synctera_ruby_sdk-1.1.3 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
synctera_ruby_sdk-1.1.2 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
synctera_ruby_sdk-1.1.1 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
sampero-0.1.0 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
tursodb-0.1.0 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
synctera_ruby_sdk-1.0.0 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb