Sha256: 8d2ad0eaee46641c45664861cf6dd1f6bba02dbab71cf367f3a9049cc1abbadb

Contents?: true

Size: 996 Bytes

Versions: 4

Compression:

Stored size: 996 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # 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_hash
          attributes
        end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
language_server-protocol-3.16.0.3 lib/language_server/protocol/interface/completion_list.rb
language_server-protocol-3.16.0.2 lib/language_server/protocol/interface/completion_list.rb
language_server-protocol-3.16.0.1 lib/language_server/protocol/interface/completion_list.rb
language_server-protocol-3.16.0.0 lib/language_server/protocol/interface/completion_list.rb