summaryrefslogtreecommitdiff
path: root/lsp.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-25 16:58:26 -0500
committerpommicket <pommicket@gmail.com>2022-12-25 16:58:26 -0500
commit4bd6bbe54b291d8d65997e998a2a3946293adcdf (patch)
tree9951be5986187ec54531a7cb62fde90a48f9a559 /lsp.c
parent66a151badc6fb11b772c814ffcf2434e308923f2 (diff)
set rootUri correctly
Diffstat (limited to 'lsp.c')
-rw-r--r--lsp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lsp.c b/lsp.c
index b52312f..f2c3cf9 100644
--- a/lsp.c
+++ b/lsp.c
@@ -1,7 +1,7 @@
// print server-to-client communication
#define LSP_SHOW_S2C 0
// print client-to-server communication
-#define LSP_SHOW_C2S 1
+#define LSP_SHOW_C2S 0
#define write_bool lsp_write_bool
@@ -306,6 +306,13 @@ LSP *lsp_create(const char *root_dir, Language language, const char *analyzer_co
(void *)lsp, analyzer_command, language_to_str(language), root_dir);
#endif
+ str_hash_table_create(&lsp->document_ids, sizeof(u32));
+ strbuf_cpy(lsp->root_dir, root_dir);
+ lsp->language = language;
+ lsp->quit_sem = SDL_CreateSemaphore(0);
+ lsp->messages_mutex = SDL_CreateMutex();
+ lsp->requests_mutex = SDL_CreateMutex();
+
ProcessSettings settings = {
.stdin_blocking = true,
.stdout_blocking = false,
@@ -320,13 +327,6 @@ LSP *lsp_create(const char *root_dir, Language language, const char *analyzer_co
// immediately send the request rather than queueing it.
// this is a small request, so it shouldn't be a problem.
write_request(lsp, &initialize);
-
- str_hash_table_create(&lsp->document_ids, sizeof(u32));
- strbuf_cpy(lsp->root_dir, root_dir);
- lsp->language = language;
- lsp->quit_sem = SDL_CreateSemaphore(0);
- lsp->messages_mutex = SDL_CreateMutex();
- lsp->requests_mutex = SDL_CreateMutex();
lsp->communication_thread = SDL_CreateThread(lsp_communication_thread, "LSP communicate", lsp);
return lsp;
}