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
language_server-protocol-3.17.0.4 lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
minato_ruby_api_client-0.2.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
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/language_server-protocol-3.17.0.3/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb
harbr-2.8.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
bison-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
mlh-rubocop-config-1.0.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.2.7 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.2.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.2.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.2.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.2.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.2.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.2.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
study_line-0.2.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
harbr-0.2.10 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.2.9 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.2.8 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.2.7 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.2.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