Sha256: b152bb1335e653360d7f7c26702ce16919290ab9aa59f94bd595ff944e89b8d4

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

module LanguageServer
  module Protocol
    module Interface
      class DocumentFormattingParams
        def initialize(text_document:, options:)
          @attributes = {}

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

          @attributes.freeze
        end

        #
        # The document to format.
        #
        # @return [TextDocumentIdentifier]
        def text_document
          attributes.fetch(:textDocument)
        end

        #
        # The format options.
        #
        # @return [FormattingOptions]
        def options
          attributes.fetch(:options)
        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/document_formatting_params.rb
language_server-protocol-0.3.0 lib/language_server/protocol/interface/document_formatting_params.rb