Sha256: 88a0a4a772c3d8cf8a92610b29643883f7dd6b5c3da51ef257a7ed5bdbdce4e9

Contents?: true

Size: 874 Bytes

Versions: 2

Compression:

Stored size: 874 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      class DidSaveTextDocumentParams
        def initialize(text_document:, text: nil)
          @attributes = {}

          @attributes[:textDocument] = text_document
          @attributes[:text] = text if text

          @attributes.freeze
        end

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

        #
        # Optional the content when saved. Depends on the includeText value
        # when the save notifcation was requested.
        #
        # @return [string]
        def text
          attributes.fetch(:text)
        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/did_save_text_document_params.rb
language_server-protocol-0.3.0 lib/language_server/protocol/interface/did_save_text_document_params.rb