Sha256: 2c8c59d86f6dbc722329c862743709e95aceb37c29d0fa9b5b355d1096b4954c

Contents?: true

Size: 853 Bytes

Versions: 4

Compression:

Stored size: 853 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # Describe options to be used when registering for text document change events.
      #
      class TextDocumentChangeRegistrationOptions < TextDocumentRegistrationOptions
        def initialize(document_selector:, sync_kind:)
          @attributes = {}

          @attributes[:syncKind] = sync_kind

          @attributes.freeze
        end

        #
        # How documents are synced to the server. See TextDocumentSyncKind.Full
        # and TextDocumentSyncKind.Incremental.
        #
        # @return [number]
        def sync_kind
          attributes.fetch(:syncKind)
        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.14.0.1 lib/language_server/protocol/interface/text_document_change_registration_options.rb
language_server-protocol-3.14.0.0 lib/language_server/protocol/interface/text_document_change_registration_options.rb
language_server-protocol-3.12.0.0 lib/language_server/protocol/interface/text_document_change_registration_options.rb
language_server-protocol-3.7.0.0 lib/language_server/protocol/interface/text_document_change_registration_options.rb