summaryrefslogtreecommitdiff
path: root/ide-rename-symbol.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-09-08 22:59:47 -0400
committerpommicket <pommicket@gmail.com>2023-09-08 22:59:47 -0400
commit0dcfd5a4f1fd865c24c01b17b214e1f72e4c06fe (patch)
treed693d70a57713cf4dbe48d30159100bab279c77d /ide-rename-symbol.c
parentf86b0aa1e843646056c08a91fcc759aa0d8a57ba (diff)
LSP code formatting (not entirely working yet)
Diffstat (limited to 'ide-rename-symbol.c')
-rw-r--r--ide-rename-symbol.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/ide-rename-symbol.c b/ide-rename-symbol.c
index b5208cc..c32f984 100644
--- a/ide-rename-symbol.c
+++ b/ide-rename-symbol.c
@@ -152,13 +152,7 @@ void rename_symbol_process_lsp_response(Ted *ted, const LSPResponse *response) {
goto done;
}
-
- const LSPTextEdit *edit = &change_data->edit;
- BufferPos start = buffer_pos_from_lsp(buffer, edit->range.start);
- BufferPos end = buffer_pos_from_lsp(buffer, edit->range.end);
- buffer_delete_chars_between(buffer, start, end);
- buffer_insert_utf8_at_pos(buffer, start, lsp_response_string(response, edit->new_text));
-
+ buffer_apply_lsp_text_edit(buffer, response, &change_data->edit);
}
break;
case LSP_CHANGE_RENAME: {