Class: LanguageServer::Protocol::Interface::RenameParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::RenameParams
- Defined in:
- lib/language_server/protocol/interface/rename_params.rb
Overview
The parameters of a [RenameRequest](#RenameRequest).
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(text_document:, position:, new_name:, work_done_token: nil) ⇒ RenameParams
constructor
A new instance of RenameParams.
-
#new_name ⇒ string
The new name of the symbol.
-
#position ⇒ Position
The position at which this request was sent.
-
#text_document ⇒ TextDocumentIdentifier
The document to rename.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
Constructor Details
#initialize(text_document:, position:, new_name:, work_done_token: nil) ⇒ RenameParams
Returns a new instance of RenameParams.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/rename_params.rb', line 8 def initialize(text_document:, position:, new_name:, work_done_token: nil) @attributes = {} @attributes[:textDocument] = text_document @attributes[:position] = position @attributes[:newName] = new_name @attributes[:workDoneToken] = work_done_token if work_done_token @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
53 54 55 |
# File 'lib/language_server/protocol/interface/rename_params.rb', line 53 def attributes @attributes end |
Instance Method Details
#new_name ⇒ string
The new name of the symbol. If the given name is not valid the request must return a [ResponseError](#ResponseError) with an appropriate message set.
41 42 43 |
# File 'lib/language_server/protocol/interface/rename_params.rb', line 41 def new_name attributes.fetch(:newName) end |
#position ⇒ Position
The position at which this request was sent.
31 32 33 |
# File 'lib/language_server/protocol/interface/rename_params.rb', line 31 def position attributes.fetch(:position) end |
#text_document ⇒ TextDocumentIdentifier
The document to rename.
23 24 25 |
# File 'lib/language_server/protocol/interface/rename_params.rb', line 23 def text_document attributes.fetch(:textDocument) end |
#to_hash ⇒ Object
55 56 57 |
# File 'lib/language_server/protocol/interface/rename_params.rb', line 55 def to_hash attributes end |
#to_json(*args) ⇒ Object
59 60 61 |
# File 'lib/language_server/protocol/interface/rename_params.rb', line 59 def to_json(*args) to_hash.to_json(*args) end |
#work_done_token ⇒ ProgressToken | nil
An optional token that a server can use to report work done progress.
49 50 51 |
# File 'lib/language_server/protocol/interface/rename_params.rb', line 49 def work_done_token attributes.fetch(:workDoneToken) end |