Class: LanguageServer::Protocol::Interface::RelatedFullDocumentDiagnosticReport
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::RelatedFullDocumentDiagnosticReport
- Defined in:
- lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb
Overview
A full diagnostic report with a set of related documents.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(related_documents: nil, kind:, result_id: nil, items:) ⇒ RelatedFullDocumentDiagnosticReport
constructor
A new instance of RelatedFullDocumentDiagnosticReport.
-
#items ⇒ Diagnostic[]
The actual items.
-
#kind ⇒ "full"
A full document diagnostic report.
-
#related_documents ⇒ DocumentUri => FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport | nil
Diagnostics of related documents.
-
#result_id ⇒ string | nil
An optional result id.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(related_documents: nil, kind:, result_id: nil, items:) ⇒ RelatedFullDocumentDiagnosticReport
Returns a new instance of RelatedFullDocumentDiagnosticReport.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb', line 10 def initialize(related_documents: nil, kind:, result_id: nil, items:) @attributes = {} @attributes[:relatedDocuments] = if @attributes[:kind] = kind @attributes[:resultId] = result_id if result_id @attributes[:items] = items @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
61 62 63 |
# File 'lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb', line 61 def attributes @attributes end |
Instance Method Details
#items ⇒ Diagnostic[]
The actual items.
57 58 59 |
# File 'lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb', line 57 def items attributes.fetch(:items) end |
#kind ⇒ "full"
A full document diagnostic report.
39 40 41 |
# File 'lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb', line 39 def kind attributes.fetch(:kind) end |
#related_documents ⇒ DocumentUri => FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport | nil
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.
31 32 33 |
# File 'lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb', line 31 def attributes.fetch(:relatedDocuments) end |
#result_id ⇒ string | nil
An optional result id. If provided it will be sent on the next diagnostic request for the same document.
49 50 51 |
# File 'lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb', line 49 def result_id attributes.fetch(:resultId) end |
#to_hash ⇒ Object
63 64 65 |
# File 'lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb', line 63 def to_hash attributes end |
#to_json(*args) ⇒ Object
67 68 69 |
# File 'lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb', line 67 def to_json(*args) to_hash.to_json(*args) end |