agentPlugins: allow root dir source#304611
Merged
connor4312 merged 6 commits intomainfrom Mar 26, 2026
Merged
Conversation
TylerLeonhardt
previously approved these changes
Mar 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Enables marketplace plugins to be sourced from the repository root directory by treating an empty source (and implicitly missing source) as the repo root when no pluginRoot is provided.
Changes:
- Update plugin source resolution to allow empty source to resolve to repo root instead of
undefined. - Adjust
parsePluginSourcetest expectations for empty source withoutpluginRoot.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts | Removes the empty-source early return so repo-root sources resolve to '' (relative path). |
| src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts | Updates the unit test to expect repo-root resolution for empty source without pluginRoot. |
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts:786
- After removing the empty-source special-case,
resolvePluginSourcewill always return a string (including''for repo root) for file URIs, so thestring | undefinedreturn type is now misleading and theresolved === undefinedchecks inparsePluginSourceare effectively dead. Consider updating the return type/JSDoc to reflect that''is a valid result (or reintroduce an explicitundefinedoutcome if callers rely on it to skip entries).
function resolvePluginSource(pluginRoot: string | undefined, source: string): string | undefined {
const normalizedRoot = pluginRoot ? normalizeMarketplacePath(pluginRoot) : '';
const normalizedSource = normalizeMarketplacePath(source);
const repoRoot = URI.file('/');
const pluginRootUri = normalizedRoot ? normalizePath(joinPath(repoRoot, normalizedRoot)) : repoRoot;
if (normalizedRoot && (normalizedSource === normalizedRoot || normalizedSource.startsWith(`${normalizedRoot}/`))) {
return normalizedSource;
}
const resolvedUri = normalizePath(joinPath(pluginRootUri, normalizedSource));
return relativePath(repoRoot, resolvedUri) ?? undefined;
src/vs/workbench/contrib/chat/test/common/plugins/pluginMarketplaceService.test.ts
Show resolved
Hide resolved
joshspicer
previously approved these changes
Mar 25, 2026
DonJayamanne
approved these changes
Mar 26, 2026
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.
No description provided.