diff options
author | pommicket <pommicket@gmail.com> | 2023-01-08 09:39:39 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-08 09:39:39 -0500 |
commit | 498b670de076909452c0fd6bc4629aca8974d9f7 (patch) | |
tree | 56f773483edd0adf90e0ebedb826e3cd4e51208d /ted.c | |
parent | 01d5fcc72f6ea29d0f90b845b7565137e7daac14 (diff) |
fix up stuff for when LSP server exits
Diffstat (limited to 'ted.c')
-rw-r--r-- | ted.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -151,7 +151,7 @@ LSP *ted_get_lsp_by_id(Ted *ted, LSPID id) { for (int i = 0; ted->lsps[i]; ++i) { LSP *lsp = ted->lsps[i]; if (lsp->id == id) - return lsp->died ? NULL : lsp; + return lsp->exited ? NULL : lsp; } return NULL; } @@ -173,8 +173,10 @@ LSP *ted_get_lsp(Ted *ted, const char *path, Language language) { // if the server supports workspaceFolders. return NULL; } - if (lsp->died) + if (lsp_covers_path(lsp, path) && lsp->exited) { + // this server died. give up. return NULL; + } // check if root matches up or if we can add a workspace folder char *root = ted_get_root_dir_of(ted, path); |