Class: Solargraph::LanguageServer::Message::TextDocument::Rename
- Defined in:
- lib/solargraph/language_server/message/text_document/rename.rb
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Base
#error, #host, #id, #method, #params, #request, #result
Instance Method Summary collapse
Methods inherited from Base
Methods included from UriHelpers
decode, encode, file_to_uri, uri_to_file
Methods inherited from Base
#initialize, #post_initialize, #send_response, #set_error, #set_result
Constructor Details
This class inherits a constructor from Solargraph::LanguageServer::Message::Base
Instance Method Details
#process ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/solargraph/language_server/message/text_document/rename.rb', line 5 def process locs = host.references_from(params['textDocument']['uri'], params['position']['line'], params['position']['character'], strip: true) changes = {} locs.each do |loc| uri = file_to_uri(loc.filename) changes[uri] ||= [] changes[uri].push({ range: loc.range.to_hash, newText: params['newName'] }) end set_result changes: changes end |