Class: LanguageServer::Protocol::Interface::WorkspaceFullDocumentDiagnosticReport

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

Overview

A full document diagnostic report for a workspace diagnostic result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind:, result_id: nil, items:, uri:, version:) ⇒ WorkspaceFullDocumentDiagnosticReport

Returns a new instance of WorkspaceFullDocumentDiagnosticReport.



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

def initialize(kind:, result_id: nil, items:, uri:, version:)
  @attributes = {}

  @attributes[:kind] = kind
  @attributes[:resultId] = result_id if result_id
  @attributes[:items] = items
  @attributes[:uri] = uri
  @attributes[:version] = version

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



63
64
65
# File 'lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb', line 63

def attributes
  @attributes
end

Instance Method Details

#itemsDiagnostic[]

The actual items.

Returns:



42
43
44
# File 'lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb', line 42

def items
  attributes.fetch(:items)
end

#kindany

A full document diagnostic report.

Returns:

  • (any)


24
25
26
# File 'lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb', line 24

def kind
  attributes.fetch(:kind)
end

#result_idstring

An optional result id. If provided it will be sent on the next diagnostic request for the same document.

Returns:

  • (string)


34
35
36
# File 'lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb', line 34

def result_id
  attributes.fetch(:resultId)
end

#to_hashObject



65
66
67
# File 'lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb', line 65

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



69
70
71
# File 'lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb', line 69

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

#uristring

The URI for which diagnostic information is reported.

Returns:

  • (string)


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

def uri
  attributes.fetch(:uri)
end

#versionnumber

The version number for which the diagnostics are reported. If the document is not marked as open ‘null` can be provided.

Returns:

  • (number)


59
60
61
# File 'lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb', line 59

def version
  attributes.fetch(:version)
end