Sha256: d995c3ea4c4f432d4d389c04e0f6d5c54f7d7c49b0b7f14668b2f529e2545426

Contents?: true

Size: 1.1 KB

Versions: 107

Compression:

Stored size: 1.1 KB

Contents

module LanguageServer
  module Protocol
    module Interface
      class PublishDiagnosticsParams
        def initialize(uri:, version: nil, diagnostics:)
          @attributes = {}

          @attributes[:uri] = uri
          @attributes[:version] = version if version
          @attributes[:diagnostics] = diagnostics

          @attributes.freeze
        end

        #
        # The URI for which diagnostic information is reported.
        #
        # @return [string]
        def uri
          attributes.fetch(:uri)
        end

        #
        # Optional the version number of the document the diagnostics are published
        # for.
        #
        # @return [number]
        def version
          attributes.fetch(:version)
        end

        #
        # An array of diagnostic information items.
        #
        # @return [Diagnostic[]]
        def diagnostics
          attributes.fetch(:diagnostics)
        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

107 entries across 107 versions & 13 rubygems

Version Path
language_server-protocol-3.17.0.3 lib/language_server/protocol/interface/publish_diagnostics_params.rb
language_server-protocol-3.17.0.2 lib/language_server/protocol/interface/publish_diagnostics_params.rb
language_server-protocol-3.17.0.1 lib/language_server/protocol/interface/publish_diagnostics_params.rb
language_server-protocol-3.16.0.3 lib/language_server/protocol/interface/publish_diagnostics_params.rb
language_server-protocol-3.16.0.2 lib/language_server/protocol/interface/publish_diagnostics_params.rb
language_server-protocol-3.16.0.1 lib/language_server/protocol/interface/publish_diagnostics_params.rb
language_server-protocol-3.16.0.0 lib/language_server/protocol/interface/publish_diagnostics_params.rb