From 1285cbfce0f3ec34add10d4896471d7cffb1231a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 6 Jul 2021 07:48:25 +0200 Subject: lsp/lsp.py: do not quote driver letter colon when creating an uri. For ghdl-language-server#79 --- pyGHDL/lsp/lsp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pyGHDL/lsp') diff --git a/pyGHDL/lsp/lsp.py b/pyGHDL/lsp/lsp.py index d76c04616..49c5502e3 100644 --- a/pyGHDL/lsp/lsp.py +++ b/pyGHDL/lsp/lsp.py @@ -47,8 +47,12 @@ def path_from_uri(uri): def path_to_uri(path): # Convert path to file uri (add html like head part) + # :param path: is an absolute path. if is_windows: - return "file:///" + quote(path.replace("\\", "/")) + # On windows, do not quote the colon after the driver letter, as + # it is not quoted in uri from the client. + path = path.replace("\\", "/") + return "file:///" + path[:2] + quote(path[2:]) else: return "file://" + quote(path) -- cgit v1.2.3