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
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#description ⇒ string
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
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.
8 9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 8 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)
Returns the value of attribute attributes.
45 46 47 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 45 def attributes @attributes end |
Instance Method Details
#description ⇒ string
A human-readable string which is rendered less prominent in the user interface.
41 42 43 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 41 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.
23 24 25 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 23 def label attributes.fetch(:label) end |
#needs_confirmation ⇒ boolean
A flag which indicates that user confirmation is needed before applying the change.
32 33 34 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 32 def needs_confirmation attributes.fetch(:needsConfirmation) end |
#to_hash ⇒ Object
47 48 49 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 47 def to_hash attributes end |
#to_json(*args) ⇒ Object
51 52 53 |
# File 'lib/language_server/protocol/interface/change_annotation.rb', line 51 def to_json(*args) to_hash.to_json(*args) end |