summaryrefslogtreecommitdiff
path: root/lsp-write.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-09 21:59:51 -0500
committerpommicket <pommicket@gmail.com>2023-01-09 22:00:23 -0500
commit7f0255cb40bb85276191ec3ddffe507e53abf2ac (patch)
tree2376d10183d4085a7e8c85bba008f8ba3516d731 /lsp-write.c
parentce158f26b9136b3fc831c6325ad911e3bf403a4b (diff)
fixed a bunch of windows stuff
also compile_commands.json does fix the usages problem!
Diffstat (limited to 'lsp-write.c')
-rw-r--r--lsp-write.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/lsp-write.c b/lsp-write.c
index 0883929..8472190 100644
--- a/lsp-write.c
+++ b/lsp-write.c
@@ -181,26 +181,22 @@ static void write_arr_elem_string(JSONWriter *o, const char *s) {
write_string(o, s);
}
-static void write_file_uri_direct(JSONWriter *o, const char *path) {
+static void write_file_uri(JSONWriter *o, LSPDocumentID document) {
+ const char *path = lsp_document_path(o->lsp, document);
str_builder_append(&o->builder, "\"file://");
+ #if _WIN32
+ // why the fuck is there another slash it makes no goddamn sense
+ str_builder_append(&o->builder, "/");
+ #endif
write_escaped(o, path);
str_builder_append(&o->builder, "\"");
}
-static void write_file_uri(JSONWriter *o, LSPDocumentID document) {
- write_file_uri_direct(o, lsp_document_path(o->lsp, document));
-}
-
static void write_key_file_uri(JSONWriter *o, const char *key, LSPDocumentID document) {
write_key(o, key);
write_file_uri(o, document);
}
-static void write_key_file_uri_direct(JSONWriter *o, const char *key, const char *path) {
- write_key(o, key);
- write_file_uri_direct(o, path);
-}
-
static void write_position(JSONWriter *o, LSPPosition position) {
write_obj_start(o);
write_key_number(o, "line", (double)position.line);