aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-07-06 07:48:25 +0200
committerTristan Gingold <tgingold@free.fr>2021-07-06 07:48:25 +0200
commit1285cbfce0f3ec34add10d4896471d7cffb1231a (patch)
tree3fc971cdff5210ea4c7b0a8092f9cb36178bcc99 /pyGHDL
parent61dafdf7768513cd970ae40c9ddfb05485b91990 (diff)
downloadghdl-1285cbfce0f3ec34add10d4896471d7cffb1231a.tar.gz
ghdl-1285cbfce0f3ec34add10d4896471d7cffb1231a.tar.bz2
ghdl-1285cbfce0f3ec34add10d4896471d7cffb1231a.zip
lsp/lsp.py: do not quote driver letter colon when creating an uri.
For ghdl-language-server#79
Diffstat (limited to 'pyGHDL')
-rw-r--r--pyGHDL/lsp/lsp.py6
1 files changed, 5 insertions, 1 deletions
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)