Placeholders panel shows 0 when `foam.files.include` is restricted to a subdirectory
Describe the bug
Summary
The Foam graph correctly contains placeholders, but the Placeholders tree view shows 0 when foam.files.include is restricted to a subdirectory such as docs/**/*.md.
This looks like the placeholder URIs are being filtered a second time by the workspace file matcher, even though placeholders are synthetic placeholder: URIs rather than indexed files.
Small Reproducible Example
No response
Steps to Reproduce the Bug or Issue
Reproduction
Workspace:
workspace/
└── docs/
└── note.mdSettings:
{
"foam.files.include": [
"docs/**/*.md"
]
}docs/note.md:
[[missing-note]]
[missing](missing.md)Reload the VS Code window.
Actual behavior
- Foam recognizes the links as missing/internal links.
- The missing nodes are visible in the Foam graph when placeholders are enabled in the graph view.
- The Placeholders tree view nevertheless shows:
Placeholders (0)
No placeholders found for selected resource or workspace.This happens both in workspace mode and current-file mode.
Expected behavior
Expected behavior
The Placeholders tree view should list the placeholders already present in graph.placeholders.
Screenshots or Videos
No response
Operating System Version
Windows
Visual Studio Code Version
1.135.0
Additional context
Suspected cause
PlaceholderTreeView.getUris() correctly returns placeholders from listPlaceholders(this.workspace, this.graph), but the inherited GroupedResourcesTreeDataProvider.getValues() then applies:
return uris.filter(uri => this.matcher.isMatch(uri));The matcher is created from Config.getFilesInclude():
const { matcher } = await createMatcherAndDataStore(
Config.getFilesInclude(),
getPlaceholdersConfig().exclude
);With:
"foam.files.include": ["docs/**/*.md"]synthetic placeholder URIs do not necessarily match the file glob, so valid placeholders already present in the graph are filtered out by the UI layer.
Relevant files in current main:
packages/foam-vscode/src/vscode/features/notes/placeholders.tspackages/foam-vscode/src/vscode/utils/tree-views/grouped-resources-tree-data-provider.tspackages/foam-vscode/src/vscode/services/editor.tspackages/foam-core/src/model/graph.ts
Notes
The graph itself appears to be correct: the issue seems limited to the Placeholders tree view / matcher interaction.
I reproduced this on a workspace where only Markdown files under docs/ are intentionally part of the Foam knowledge base. Removing that restriction is not a desirable workaround because it would index unrelated project files.
Source: foambubble/foam