summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
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);