diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-07-06 07:48:25 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-07-06 07:48:25 +0200 |
commit | 1285cbfce0f3ec34add10d4896471d7cffb1231a (patch) | |
tree | 3fc971cdff5210ea4c7b0a8092f9cb36178bcc99 /pyGHDL/lsp | |
parent | 61dafdf7768513cd970ae40c9ddfb05485b91990 (diff) | |
download | ghdl-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/lsp')
-rw-r--r-- | pyGHDL/lsp/lsp.py | 6 |
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) |