fix(plugin-ext): match plugins by folder boundary#17512
Merged
Conversation
When two plugin folders share a name prefix (e.g. `acme.foo` and `acme.foo-extras`), the longer-named plugin could receive the wrong `vscode` API object, leading to incorrect behaviour. Fixes #17504.
colin-grant-work
approved these changes
May 18, 2026
colin-grant-work
left a comment
Contributor
There was a problem hiding this comment.
Intent of the fix looks good to me. Just a question re: whether an existing utility would do the job.
Comment on lines
+87
to
+88
| const rel = path.relative(plugin.pluginFolder, filePath); | ||
| return !rel.startsWith('..') && !path.isAbsolute(rel); |
Contributor
There was a problem hiding this comment.
We've got an isEqualOrParent utility in https://github.com/eclipse-theia/theia/blob/master/packages/core/src/common/paths.ts . Would that work here?
Replace manual path.relative check with the existing isEqualOrParent utility from @theia/core/lib/common/paths.
Member
Author
|
@colin-grant-work Very good catch, I was not aware of that utility. Thank you! The fix still works with the util change. Testing is now even easier as the esm example plugins are now part of the branch. |
colin-grant-work
approved these changes
May 21, 2026
Member
Author
|
I merged in |
Member
|
@sdirix this looks ready and is mergeable, could you go ahead and merge it? TIA! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Makes sure that plugins which share the same prefix are correctly resolved.
Fixes #17504
How to test
See the description of #17504
Follow-ups
Breaking changes
Attribution
Review checklist
nlsservice (for details, please see the Internationalization/Localization section in the Coding Guidelines)Reminder for reviewers