Class: LanguageServer::Protocol::Interface::WorkspaceDiagnosticParams

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

Overview

Parameters of the workspace diagnostic request.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier: nil, previous_result_ids:, work_done_token: nil, partial_result_token: nil) ⇒ WorkspaceDiagnosticParams

Returns a new instance of WorkspaceDiagnosticParams.

Since:

  • 3.17.0



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

def initialize(identifier: nil, previous_result_ids:, work_done_token: nil, partial_result_token: nil)
  @attributes = {}

  @attributes[:identifier] = identifier if identifier
  @attributes[:previousResultIds] = previous_result_ids
  @attributes[:workDoneToken] = work_done_token if work_done_token
  @attributes[:partialResultToken] = partial_result_token if partial_result_token

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.17.0



55
56
57
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 55

def attributes
  @attributes
end

Instance Method Details

#identifierstring | nil

The additional identifier provided during registration.

Returns:

  • (string | nil)

Since:

  • 3.17.0



25
26
27
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 25

def identifier
  attributes.fetch(:identifier)
end

#partial_result_tokenProgressToken | nil

An optional token that a server can use to report partial results (e.g. streaming) to the client.

Returns:

  • (ProgressToken | nil)

Since:

  • 3.17.0



51
52
53
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 51

def partial_result_token
  attributes.fetch(:partialResultToken)
end

#previous_result_idsPreviousResultId[]

The currently known diagnostic reports with their previous result ids.

Returns:

Since:

  • 3.17.0



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

def previous_result_ids
  attributes.fetch(:previousResultIds)
end

#to_hashObject

Since:

  • 3.17.0



57
58
59
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 57

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.17.0



61
62
63
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 61

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

#work_done_tokenProgressToken | nil

An optional token that a server can use to report work done progress.

Returns:

  • (ProgressToken | nil)

Since:

  • 3.17.0



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

def work_done_token
  attributes.fetch(:workDoneToken)
end