Sha256: f6ce7076e9c2ee26f8f9f1aeb75e12e441cf276a41914c73b3f8044a31ebc363

Contents?: true

Size: 877 Bytes

Versions: 2

Compression:

Stored size: 877 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      #
      # The parameters send in a will save text document notification.
      #
      class WillSaveTextDocumentParams
        def initialize(text_document:, reason:)
          @attributes = {}

          @attributes[:textDocument] = text_document
          @attributes[:reason] = reason

          @attributes.freeze
        end

        #
        # The document that will be saved.
        #
        # @return [TextDocumentIdentifier]
        def text_document
          attributes.fetch(:textDocument)
        end

        #
        # The 'TextDocumentSaveReason'.
        #
        # @return [number]
        def reason
          attributes.fetch(:reason)
        end

        attr_reader :attributes

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
language_server-protocol-0.4.0 lib/language_server/protocol/interface/will_save_text_document_params.rb
language_server-protocol-0.3.0 lib/language_server/protocol/interface/will_save_text_document_params.rb