diff options
author | pommicket <pommicket@gmail.com> | 2023-01-05 11:34:11 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-05 11:34:11 -0500 |
commit | f897a6a62e9572f1f3cc6c7905192d49d7868c9a (patch) | |
tree | 23584ccafbf85e081acf396bfea3343a051006e5 /command.c | |
parent | b3d5c74a52945b592f13c6870ccb1f0a82fa1f42 (diff) |
lsp-reset command
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -71,6 +71,7 @@ static CommandName const command_names[] = { {"goto-definition-at-cursor", CMD_GOTO_DEFINITION_AT_CURSOR}, {"goto-declaration-at-cursor", CMD_GOTO_DECLARATION_AT_CURSOR}, {"goto-type-definition-at-cursor", CMD_GOTO_TYPE_DEFINITION_AT_CURSOR}, + {"lsp-reset", CMD_LSP_RESET}, {"find", CMD_FIND}, {"find-replace", CMD_FIND_REPLACE}, {"tab-close", CMD_TAB_CLOSE}, @@ -427,6 +428,15 @@ void command_execute(Ted *ted, Command c, i64 argument) { buffer_goto_word_at_cursor(buffer, GOTO_TYPE_DEFINITION); } } break; + case CMD_LSP_RESET: + for (int i = 0; i < TED_LSP_MAX; ++i) { + LSP *lsp = ted->lsps[i]; + if (lsp) { + lsp_free(lsp); + ted->lsps[i] = NULL; + } + } + break; case CMD_FIND_USAGES: usages_find(ted); break; |