diff options
Diffstat (limited to 'lsp-write.c')
-rw-r--r-- | lsp-write.c | 16 |
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); |