Class: LanguageServer::Protocol::Interface::ApplyWorkspaceEditResult
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::ApplyWorkspaceEditResult
- Defined in:
- lib/language_server/protocol/interface/apply_workspace_edit_result.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#applied ⇒ boolean
Indicates whether the edit was applied or not.
-
#failed_change ⇒ number
Depending on the client’s failure handling strategy ‘failedChange` might contain the index of the change that failed.
-
#failure_reason ⇒ string
An optional textual description for why the edit was not applied.
-
#initialize(applied:, failure_reason: nil, failed_change: nil) ⇒ ApplyWorkspaceEditResult
constructor
A new instance of ApplyWorkspaceEditResult.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(applied:, failure_reason: nil, failed_change: nil) ⇒ ApplyWorkspaceEditResult
Returns a new instance of ApplyWorkspaceEditResult.
5 6 7 8 9 10 11 12 13 |
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 5 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
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
44 45 46 |
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 44 def attributes @attributes end |
Instance Method Details
#applied ⇒ boolean
Indicates whether the edit was applied or not.
19 20 21 |
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 19 def applied attributes.fetch(:applied) end |
#failed_change ⇒ number
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 `failureHandling` strategy in its client capabilities.
40 41 42 |
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 40 def failed_change attributes.fetch(:failedChange) end |
#failure_reason ⇒ string
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.
29 30 31 |
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 29 def failure_reason attributes.fetch(:failureReason) end |
#to_hash ⇒ Object
46 47 48 |
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 46 def to_hash attributes end |
#to_json(*args) ⇒ Object
50 51 52 |
# File 'lib/language_server/protocol/interface/apply_workspace_edit_result.rb', line 50 def to_json(*args) to_hash.to_json(*args) end |