vscode.FileDecorationProvider in git extension is too greedy in applying file decorations to URIs
@lszomoru is already working on this.
Since May 20, 2026.
Assessment
This issue has not been assessed yet.
Description
Does this issue occur when all extensions are disabled?: No, the issue is in the built in Git extension.
- VS Code Version: 1.120.0
- OS Version: Mac OS Tahoe
The built in git extension in extensions/git/ uses a vscode.FileDecorationProvider, and its matching algorithm is too greedy. It only checks for a matching fsPath to apply the decorators, which overrides any fileDecorations created by other extensions even if they have an unrelated URI scheme. When I disable the built in Git extension, the problem goes away.
I am an extension developer who gives resource URIs to TreeItems. Since the tree items correspond to objects in a file, they have a fsPath field that matches the source file's fsPath. My custom URIs are differentiated by the URI scheme, as they don't use "file" for their URI scheme, but use something else entirely. The git extension only checks for a matching fsPath field in the URI and as a result, it overrides any fileDecorations that my extension creates for tree items with my custom URIs.
The fix is pretty simple. All we need to do is add a check for the URI scheme in the provideFileDecoration() function in extensions/git/src/decorationProvider.ts, and check that the URI scheme is a file.
The fix:
if (uri.scheme !== 'file') {
return;
}
I am happy to create a PR for this fix, but I would need to know if there are any other URI schemes besides files that we want to apply the fileDecorations to.
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·