Skip to content

Prefer parent uri when matching uri#682

Merged
ccordoba12 merged 3 commits into
python-lsp:developfrom
mnauw:uri_match_parent
Jul 18, 2026
Merged

Prefer parent uri when matching uri#682
ccordoba12 merged 3 commits into
python-lsp:developfrom
mnauw:uri_match_parent

Conversation

@mnauw

@mnauw mnauw commented Oct 25, 2025

Copy link
Copy Markdown
Contributor

At present, match_uri_to_workspace can return a workspace that is not a parent of the uri. In particular, if /a/b/c is a workspace, and also /a/b, then searching for a workspace for /a/b/x/y can return either one of the previous. In this case, however, /a/b is preferred as it is actually a parent (whereas /a/b/c is not). While this may be an "odd" workspace setup, it can occur when dealing with git submodules or some other project setup (also depending on the LSP client). But presumably it is preferable to be robust at the LSP server end than to declare such invalid.

@mnauw

mnauw commented Dec 27, 2025

Copy link
Copy Markdown
Contributor Author

Looks like the Mac runners are down, should otherwise be OK now (with prior glitch for Windows case handling).

@ccordoba12 ccordoba12 changed the title utils: prefer parent uri when matching uri Prefer parent uri when matching uri Jul 18, 2026
@ccordoba12 ccordoba12 added this to the v1.15.0 milestone Jul 18, 2026
@ccordoba12 ccordoba12 added the bug Something isn't working label Jul 18, 2026

@ccordoba12 ccordoba12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @mnauw!

@ccordoba12
ccordoba12 merged commit 0f283d4 into python-lsp:develop Jul 18, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants