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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of WorkspaceDiagnosticParams.



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

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

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

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



53
54
55
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 53

def attributes
  @attributes
end

Instance Method Details

#identifierstring

The additional identifier provided during registration.

Returns:

  • (string)


40
41
42
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 40

def identifier
  attributes.fetch(:identifier)
end

#partial_result_tokenProgressToken

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

Returns:

  • (ProgressToken)


32
33
34
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 32

def partial_result_token
  attributes.fetch(:partialResultToken)
end

#previous_result_idsPreviousResultId[]

The currently known diagnostic reports with their previous result ids.

Returns:



49
50
51
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 49

def previous_result_ids
  attributes.fetch(:previousResultIds)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#work_done_tokenProgressToken

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

Returns:

  • (ProgressToken)


23
24
25
# File 'lib/language_server/protocol/interface/workspace_diagnostic_params.rb', line 23

def work_done_token
  attributes.fetch(:workDoneToken)
end