Skip to content

Commit

Permalink
lsp/lsp.py: do not quote driver letter colon when creating an uri.
Browse files Browse the repository at this point in the history
For ghdl-language-server#79
  • Loading branch information
tgingold committed Jul 6, 2021
1 parent 61dafdf commit 1285cbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyGHDL/lsp/lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 1285cbf

Please sign in to comment.