We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89265cd commit f6542bfCopy full SHA for f6542bf
pylsp/_utils.py
@@ -134,9 +134,17 @@ def match_uri_to_workspace(uri, workspaces):
134
if len(workspace_parts) > len(path):
135
continue
136
match_len = 0
137
+ is_parent = True
138
for workspace_part, path_part in zip(workspace_parts, path):
139
if workspace_part == path_part:
140
match_len += 1
141
+ else:
142
+ is_parent = False
143
+ break
144
+ # prefer a match that is actually a parent of uri
145
+ # otherwise fall back to longest matching non-parent
146
+ if is_parent and match_len > 0:
147
+ match_len += 1000
148
if match_len > 0:
149
if match_len > max_len:
150
max_len = match_len
0 commit comments