Class: LanguageServer::Protocol::Interface::ChangeAnnotation
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::ChangeAnnotation
- Defined in:
- lib/language_server/protocol/interface/change_annotation.rb
Overview
Additional information that describes document changes.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#description ⇒ string | nil
A human-readable string which is rendered less prominent in the user interface.
-
#initialize(label:, needs_confirmation: nil, description: nil) ⇒ ChangeAnnotation
constructor
A new instance of ChangeAnnotation.
-
#label ⇒ string
A human-readable string describing the actual change.
-
#needs_confirmation ⇒ boolean | nil
A flag which indicates that user confirmation is needed before applying the change.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(label:, needs_confirmation: nil, description: nil) ⇒ ChangeAnnotation
Returns a new instance of ChangeAnnotation.
10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 10 def initialize(label:, needs_confirmation: nil, description: nil) @attributes = {} @attributes[:label] = label @attributes[:needsConfirmation] = needs_confirmation if needs_confirmation @attributes[:description] = description if description @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
47 48 49 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 47 def attributes @attributes end |
Instance Method Details
#description ⇒ string | nil
A human-readable string which is rendered less prominent in the user interface.
43 44 45 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 43 def description attributes.fetch(:description) end |
#label ⇒ string
A human-readable string describing the actual change. The string is rendered prominent in the user interface.
25 26 27 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 25 def label attributes.fetch(:label) end |
#needs_confirmation ⇒ boolean | nil
A flag which indicates that user confirmation is needed before applying the change.
34 35 36 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 34 def needs_confirmation attributes.fetch(:needsConfirmation) end |
#to_hash ⇒ Object
49 50 51 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 49 def to_hash attributes end |
#to_json(*args) ⇒ Object
53 54 55 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 53 def to_json(*args) to_hash.to_json(*args) end |