Class: TypeProf::LSP::Message::TextDocument::Rename
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::TypeProf::LSP::Message
|
|
|
Instance Chain:
self,
::TypeProf::LSP::Message
|
|
| Inherits: |
TypeProf::LSP::Message
|
| Defined in: | lib/typeprof/lsp/messages.rb |
Overview
textDocument/prepareRename request
Constant Summary
-
METHOD =
# File 'lib/typeprof/lsp/messages.rb', line 351
request
"textDocument/rename"
::TypeProf::LSP::Message - Inherited
Class Method Summary
::TypeProf::LSP::Message - Inherited
| .build_table, .find, .inherited, | |
| .new | : (Server, untyped) -> void. |
Instance Method Summary
Constructor Details
This class inherits a constructor from TypeProf::LSP::Message
Instance Method Details
#run
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 352
def run @params => { textDocument: { uri: }, position: pos, newName:, } text = @server.open_texts[uri] unless text respond(nil) return end renames = @server.rename(text.path, TypeProf::CodePosition.from_lsp(pos)) if renames changes = {} renames.each do |path, cr| (changes[@server.path_to_uri(path)] ||= []) << { range: cr.to_lsp, newText: newName, } end respond({ changes:, }) else respond(nil) end end