summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-08 09:39:39 -0500
committerpommicket <pommicket@gmail.com>2023-01-08 09:39:39 -0500
commit498b670de076909452c0fd6bc4629aca8974d9f7 (patch)
tree56f773483edd0adf90e0ebedb826e3cd4e51208d /ted.c
parent01d5fcc72f6ea29d0f90b845b7565137e7daac14 (diff)
fix up stuff for when LSP server exits
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ted.c b/ted.c
index e3f5aeb..dd2a759 100644
--- a/ted.c
+++ b/ted.c
@@ -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);