1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
module LanguageServer
module Protocol
module Interface
class ApplyWorkspaceEditResult
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
#
# Indicates whether the edit was applied or not.
#
# @return [boolean]
def applied
attributes.fetch(:applied)
end
#
# 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.
#
# @return [string]
def failure_reason
attributes.fetch(:failureReason)
end
#
# 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.
#
# @return [number]
def failed_change
attributes.fetch(:failedChange)
end
attr_reader :attributes
def to_hash
attributes
end
def to_json(*args)
to_hash.to_json(*args)
end
end
end
end
end
|