Sha256: 32070aecd5a9a54396c04517376209c40f95526a25fb1ce54da50a07b4aad4bb

Contents?: true

Size: 850 Bytes

Versions: 1

Compression:

Stored size: 850 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # Descibe options to be used when registered 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 TextDocumentSyncKindIncremental.
        #
        # @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

1 entries across 1 versions & 1 rubygems

Version Path
language_server-protocol-0.5.0 lib/language_server/protocol/interface/text_document_change_registration_options.rb