Sha256: daf1a2df12f0f4f5a2ccf0592f246ec729cda8243f77e1b42aa5a02fb9d11888

Contents?: true

Size: 946 Bytes

Versions: 7

Compression:

Stored size: 946 Bytes

Contents

module LanguageServer
  module Protocol
    module Interfaces
      #
      # Represents a collection of [completion items](#CompletionItem) to be presented
      # in the editor.
      #
      class CompletionList
        def initialize(is_incomplete:, items:)
          @attributes = {}

          @attributes[:isIncomplete] = is_incomplete
          @attributes[:items] = items

          @attributes.freeze
        end

        #
        # This list it not complete. Further typing should result in recomputing
        # this list.
        #
        # @return [boolean]
        def is_incomplete
          attributes.fetch(:isIncomplete)
        end

        #
        # The completion items.
        #
        # @return [CompletionItem[]]
        def items
          attributes.fetch(:items)
        end

        attr_reader :attributes

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

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
language_server-protocol-0.2.0 lib/language_server/protocol/interfaces/completion_list.rb
language_server-protocol-0.1.0 lib/language_server/protocol/interfaces/completion_list.rb
language_server-0.4.0 lib/language_server/protocol/interfaces/completion_list.rb
language_server-0.3.1 lib/language_server/protocol/interfaces/completion_list.rb
language_server-0.3.0 lib/language_server/protocol/interfaces/completion_list.rb
language_server-0.2.0 lib/language_server/protocol/interfaces/completion_list.rb
language_server-0.1.0 lib/language_server/protocol/interfaces/completion_list.rb