File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,10 +24,12 @@ def __repr__(self) -> str:
2424
2525 def to_path (self ) -> Path :
2626 p = to_fs_path (self .value )
27- return Path (p )
27+ unencoded_path = p .replace ("%3A" , ":" )
28+ return Path (unencoded_path )
2829
2930 @staticmethod
3031 def from_path (path : t .Union [str , Path ]) -> "URI" :
3132 if isinstance (path , Path ):
32- path = path .as_posix ()
33- return URI (from_fs_path (path ))
33+ path = str (path )
34+ encoded_path = path .replace (":" , "%3A" )
35+ 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