Class: LanguageServer::Protocol::Interface::RelatedUnchangedDocumentDiagnosticReport

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb

Overview

An unchanged diagnostic report with a set of related documents.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(related_documents: nil, kind:, result_id:) ⇒ RelatedUnchangedDocumentDiagnosticReport

Returns a new instance of RelatedUnchangedDocumentDiagnosticReport.

Since:

  • 3.17.0



10
11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb', line 10

def initialize(related_documents: nil, kind:, result_id:)
  @attributes = {}

  @attributes[:relatedDocuments] = related_documents if related_documents
  @attributes[:kind] = kind
  @attributes[:resultId] = result_id

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.17.0



54
55
56
# File 'lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb', line 54

def attributes
  @attributes
end

Instance Method Details

#kind"unchanged"

A document diagnostic report indicating no changes to the last result. A server can only return unchanged if result ids are provided.

Returns:

  • ("unchanged")

Since:

  • 3.17.0



41
42
43
# File 'lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb', line 41

def kind
  attributes.fetch(:kind)
end

Diagnostics of related documents. This information is useful in programming languages where code in a file A can generate diagnostics in a file B which A depends on. An example of such a language is C/C++ where marco definitions in a file a.cpp and result in errors in a header file b.hpp.

Returns:

Since:

  • 3.17.0



30
31
32
# File 'lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb', line 30

def related_documents
  attributes.fetch(:relatedDocuments)
end

#result_idstring

A result id which will be sent on the next diagnostic request for the same document.

Returns:

  • (string)

Since:

  • 3.17.0



50
51
52
# File 'lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb', line 50

def result_id
  attributes.fetch(:resultId)
end

#to_hashObject

Since:

  • 3.17.0



56
57
58
# File 'lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb', line 56

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.17.0



60
61
62
# File 'lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb', line 60

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