summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-27 00:34:38 -0500
committerpommicket <pommicket@gmail.com>2022-12-27 00:34:38 -0500
commit53451f331667180e4b30c1ac0bf33bb48beb37f0 (patch)
tree4bb3c933441ecde2e899f4486b7f32d84f5cbb22 /ted.c
parent85ee81b8ae972d17f0e3dc78657077924c047ada (diff)
better workspaceFolders idea ("withhold judgement")
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ted.c b/ted.c
index 8e2f669..825ab36 100644
--- a/ted.c
+++ b/ted.c
@@ -114,6 +114,13 @@ LSP *ted_get_lsp(Ted *ted, const char *path, Language language) {
if (!lsp) break;
if (lsp->language != language) continue;
+ if (!lsp->initialized) {
+ // withhold judgement until this server initializes.
+ // we shouldn't call lsp_try_add_root_dir yet because it doesn't know
+ // if the server supports workspaceFolders.
+ return NULL;
+ }
+
// check if root matches up or if we can add a workspace folder
char *root = ted_get_root_dir_of(ted, path);
bool success = lsp_try_add_root_dir(lsp, root);