feat(lsp): initial support for textDocument/rename

flow keybinds: changes f2 from toggle_input_mode to rename_symbol and
moves toggle_input_mode command to ctrl+shift+f2 (since ctrl+f2 is
already bound to insert_command_name)

the replacement text is hard coded for now. i've checked that replace
works with zls and pylsp which send WorkspaceEdit response messages in
different shapes - zls sends shape `{"changes": {}}` while pylsp sends
`{"documentChanges": []}`.

currently the 'rename_symbol_item' commands are sent one at a time.
however they should be buffered and be performed between one
buf_for_update, update_buf pair.  this will be addressed in a follow up.
This commit is contained in:
Travis Staloch 2025-01-12 14:00:48 -08:00 committed by CJ van den Berg
parent 7558a63819
commit 1fd4455adb
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
5 changed files with 172 additions and 1 deletions

View file

@ -128,7 +128,8 @@
["shift+enter", "smart_insert_line_before"],
["shift+backspace", "delete_backward"],
["shift+tab", "unindent"],
["f2", "toggle_input_mode"],
["f2", "rename_symbol"],
["ctrl+shift+f2", "toggle_input_mode"],
["ctrl+f2", "insert_command_name"],
["f3", "goto_next_match"],
["f15", "goto_prev_match"],