#1702·foam

Placeholders panel shows 0 when `foam.files.include` is restricted to a subdirectory

Author: DrakeWhuCreated Sep 8, 2026Updated Sep 8, 2026

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.md

Settings:

json
{
  "foam.files.include": [
    "docs/**/*.md"
  ]
}

docs/note.md:

markdown
[[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:

typescript
return uris.filter(uri => this.matcher.isMatch(uri));

The matcher is created from Config.getFilesInclude():

typescript
const { matcher } = await createMatcherAndDataStore(
  Config.getFilesInclude(),
  getPlaceholdersConfig().exclude
);

With:

json
"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.ts
  • packages/foam-vscode/src/vscode/utils/tree-views/grouped-resources-tree-data-provider.ts
  • packages/foam-vscode/src/vscode/services/editor.ts
  • packages/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.