From 53451f331667180e4b30c1ac0bf33bb48beb37f0 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 27 Dec 2022 00:34:38 -0500 Subject: better workspaceFolders idea ("withhold judgement") --- lsp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lsp.h') diff --git a/lsp.h b/lsp.h index b931b5c..e0595e2 100644 --- a/lsp.h +++ b/lsp.h @@ -296,7 +296,7 @@ typedef struct LSP { SDL_mutex *error_mutex; Language language; SDL_mutex *workspace_folders_mutex; - LSPDocumentID *workspace_folders; // dynamic array of root directories of LSP "workspaces" (meaningless garbage) + LSPDocumentID *workspace_folders; // dynamic array of root directories of LSP workspace folders char error[256]; } LSP; @@ -316,6 +316,8 @@ void lsp_send_response(LSP *lsp, LSPResponse *response); const char *lsp_response_string(const LSPResponse *response, LSPString string); LSP *lsp_create(const char *root_dir, Language language, const char *analyzer_command); // try to add a new "workspace folder" to the lsp. +// IMPORTANT: only call this if lsp->initialized is true +// (if not we don't yet know whether the server supports workspace folders) // returns true on success or if new_root_dir is already contained in a workspace folder for this LSP. // if this fails (i.e. if the LSP does not have workspace support), create a new LSP // with root directory `new_root_dir`. -- cgit v1.2.3