Class: LanguageServer::Protocol::Interface::CodeActionParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::CodeActionParams
- Defined in:
- lib/language_server/protocol/interface/code_action_params.rb
Overview
Params for the CodeActionRequest
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#context ⇒ CodeActionContext
Context carrying additional information.
-
#initialize(text_document:, range:, context:) ⇒ CodeActionParams
constructor
A new instance of CodeActionParams.
-
#range ⇒ Range
The range for which the command was invoked.
-
#text_document ⇒ TextDocumentIdentifier
The document in which the command was invoked.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(text_document:, range:, context:) ⇒ CodeActionParams
Returns a new instance of CodeActionParams.
8 9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/code_action_params.rb', line 8 def initialize(text_document:, range:, context:) @attributes = {} @attributes[:textDocument] = text_document @attributes[:range] = range @attributes[:context] = context @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
42 43 44 |
# File 'lib/language_server/protocol/interface/code_action_params.rb', line 42 def attributes @attributes end |
Instance Method Details
#context ⇒ CodeActionContext
Context carrying additional information.
38 39 40 |
# File 'lib/language_server/protocol/interface/code_action_params.rb', line 38 def context attributes.fetch(:context) end |
#range ⇒ Range
The range for which the command was invoked.
30 31 32 |
# File 'lib/language_server/protocol/interface/code_action_params.rb', line 30 def range attributes.fetch(:range) end |
#text_document ⇒ TextDocumentIdentifier
The document in which the command was invoked.
22 23 24 |
# File 'lib/language_server/protocol/interface/code_action_params.rb', line 22 def text_document attributes.fetch(:textDocument) end |
#to_hash ⇒ Object
44 45 46 |
# File 'lib/language_server/protocol/interface/code_action_params.rb', line 44 def to_hash attributes end |
#to_json(*args) ⇒ Object
48 49 50 |
# File 'lib/language_server/protocol/interface/code_action_params.rb', line 48 def to_json(*args) to_hash.to_json(*args) end |