File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,5 +29,6 @@ def to_path(self) -> Path:
2929 @staticmethod
3030 def from_path (path : t .Union [str , Path ]) -> "URI" :
3131 if isinstance (path , Path ):
32- path = path .as_posix ()
33- return URI (from_fs_path (path ))
32+ path = str (path )
33+ encoded_path = path .replace (":" , "%3A" )
34+ return URI (from_fs_path (encoded_path ))
Original file line number Diff line number Diff line change @@ -20,3 +20,10 @@ def test_lsp_context():
2020 # Check that the value is a ModelInfo with the expected model name
2121 assert isinstance (lsp_context .map [active_customers_key ], ModelTarget )
2222 assert "sushi.active_customers" in lsp_context .map [active_customers_key ].names
23+
24+ # Check that all the values in the map are normalised
25+ keys = lsp_context .map .keys ()
26+ for key in keys :
27+ stripped_key_from_prefix = str (key ).split ("file://" )[1 ]
28+ assert ":" not in stripped_key_from_prefix
29+ assert "\\ " not in stripped_key_from_prefix
You can’t perform that action at this time.
0 commit comments