summaryrefslogtreecommitdiff
path: root/lsp-parse.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-parse.c
parentce158f26b9136b3fc831c6325ad911e3bf403a4b (diff)
fixed a bunch of windows stuff
also compile_commands.json does fix the usages problem!
Diffstat (limited to 'lsp-parse.c')
-rw-r--r--lsp-parse.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lsp-parse.c b/lsp-parse.c
index f794c4b..fd07913 100644
--- a/lsp-parse.c
+++ b/lsp-parse.c
@@ -101,7 +101,17 @@ static bool parse_document_uri(LSP *lsp, const JSON *json, JSONValue value, LSPD
free(string);
return false;
}
- *id = lsp_document_id(lsp, string + strlen("file://"));
+ char *path;
+ #if _WIN32
+ path = string + strlen("file:///");
+ // replace slashes with backslashes
+ for (char *p = path; *p; ++p)
+ if (*p == '/')
+ *p = '\\';
+ #else
+ path = string + strlen("file://");
+ #endif
+ *id = lsp_document_id(lsp, path);
free(string);
return true;
}