Skip to content

fix(plugin-ext): match plugins by folder boundary#17512

Merged
sdirix merged 5 commits into
masterfrom
sdirix/fix-vsx-prefix
Jun 15, 2026
Merged

fix(plugin-ext): match plugins by folder boundary#17512
sdirix merged 5 commits into
masterfrom
sdirix/fix-vsx-prefix

Conversation

@sdirix

@sdirix sdirix commented May 17, 2026

Copy link
Copy Markdown
Member

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

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

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.
@github-project-automation github-project-automation Bot moved this to Waiting on reviewers in PR Backlog May 17, 2026
@ndoschek ndoschek requested a review from colin-grant-work May 18, 2026 15:36

@colin-grant-work colin-grant-work left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

@github-project-automation github-project-automation Bot moved this from Waiting on reviewers to Needs merge in PR Backlog May 18, 2026
@sdirix

sdirix commented May 20, 2026

Copy link
Copy Markdown
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.

@sdirix sdirix requested a review from colin-grant-work May 20, 2026 14:40
@sdirix

sdirix commented May 21, 2026

Copy link
Copy Markdown
Member Author

I merged in master to get rid of the build errors. No functional changes

@ndoschek

ndoschek commented Jun 9, 2026

Copy link
Copy Markdown
Member

@sdirix this looks ready and is mergeable, could you go ahead and merge it? TIA!

@sdirix sdirix merged commit 5c76836 into master Jun 15, 2026
11 of 18 checks passed
@sdirix sdirix deleted the sdirix/fix-vsx-prefix branch June 15, 2026 09:53
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Jun 15, 2026
@github-actions github-actions Bot added this to the 1.73.0 milestone Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

VS Code plugin API may be routed to the wrong plugin when one plugin's folder name is a prefix of another's

3 participants