Class: LanguageServer::Protocol::Interface::ApplyWorkspaceEditResult

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

Overview

The result returned from the apply workspace edit request.

Since:

  • 3.17 renamed from ApplyWorkspaceEditResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(applied:, failure_reason: nil, failed_change: nil) ⇒ ApplyWorkspaceEditResult

Returns a new instance of ApplyWorkspaceEditResult.

Since:

  • 3.17 renamed from ApplyWorkspaceEditResponse



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

def initialize(applied:, failure_reason: nil, failed_change: nil)
  @attributes = {}

  @attributes[:applied] = applied
  @attributes[:failureReason] = failure_reason if failure_reason
  @attributes[:failedChange] = failed_change if failed_change

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.17 renamed from ApplyWorkspaceEditResponse



48
49
50
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 48

def attributes
  @attributes
end

Instance Method Details

#appliedboolean

Indicates whether the edit was applied or not.

Returns:

  • (boolean)

Since:

  • 3.17 renamed from ApplyWorkspaceEditResponse



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

def applied
  attributes.fetch(:applied)
end

#failed_changeuinteger | nil

Depending on the client’s failure handling strategy failedChange might contain the index of the change that failed. This property is only available if the client signals a failureHandlingStrategy in its client capabilities.

Returns:

  • (uinteger | nil)

Since:

  • 3.17 renamed from ApplyWorkspaceEditResponse



44
45
46
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 44

def failed_change
  attributes.fetch(:failedChange)
end

#failure_reasonstring | nil

An optional textual description for why the edit was not applied. This may be used by the server for diagnostic logging or to provide a suitable error for a request that triggered the edit.

Returns:

  • (string | nil)

Since:

  • 3.17 renamed from ApplyWorkspaceEditResponse



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

def failure_reason
  attributes.fetch(:failureReason)
end

#to_hashObject

Since:

  • 3.17 renamed from ApplyWorkspaceEditResponse



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.17 renamed from ApplyWorkspaceEditResponse



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

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