You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(vscode): switch workspace file:// with files.exclude filtering
Replace the obs:// workspace folder with a single file:// folder at the
vault root, enabling Quick Open (Cmd+P) and full-text search support.
Non-autoMount entries and blocked paths are hidden via managed
files.exclude patterns tracked in context.workspaceState.
- addVaultWorkspaceFolder now creates file:// URI at vault root
- syncFilesExclude scans vault root, excludes non-autoMount entries and
blocked paths from vfsConfig, preserves user-set patterns
- clearManagedExcludes removes managed patterns on workspace disable
- Serialized via promise chain to prevent concurrent read-modify-write
- Graceful degradation when readdir fails (returns previous state)
- Extract CONFIG_SECTION/CONFIG_KEY constants to types.ts
- Version bump 0.2.3 → 0.3.0
Assisted-by: Claude
-**Single `file://` workspace folder at the vault root** for Quick Open (`Cmd+P`) and `Ctrl+Shift+F` search. VSCode's file discovery and ripgrep indexer only operate on `file://` workspace folders — `obs://` workspace folders provide zero discoverability (confirmed by spike, 2026-05-15).
34
+
-**`files.exclude` patterns** hide non-autoMount vault content from Explorer and Quick Open. Patterns are managed via `ConfigurationTarget.Workspace` (routes to `.vscode/settings.json` or `.code-workspace` file automatically). Extension-managed patterns are tracked in `context.workspaceState` and cleaned up on autoMount change or workspace disable.
35
+
-**`obs://` FileSystemProvider** remains registered for TreeView sidebar, wikilinks, drag-and-drop, and watch events — it does not back a workspace folder.
36
+
-**`FileSearchProvider`/`TextSearchProvider` are proposed (unstable) APIs** as of `@types/vscode@1.118.0`. When stabilized, the extension can switch to a single `obs://` workspace folder with native search, eliminating the `files.exclude` workaround. Check `@types/vscode` for stable availability — do not use while proposed.
37
+
31
38
## Documentation
32
39
33
-
Update the package's README and CONTRIBUTING.md when changes affect user-facing behavior or API surface. Link, don't duplicate.
40
+
Update the package's README and CONTRIBUTING.md when changes affect user-facing behavior or API surface. Link, don't duplicate.
Copy file name to clipboardExpand all lines: packages/vscode/README.md
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,26 +46,39 @@ Configure via **Settings UI** or `settings.json`:
46
46
|`obsidianVFS.autoMount`|`string[]`|`[]`| Vault-relative paths (folders or notes) to display in the Explorer tree view on activation |
47
47
|`obsidianVFS.explorer`|`boolean`|`true`| Show the Obsidian VFS tree view in the Explorer sidebar |
48
48
|`obsidianVFS.statusBar`|`boolean`|`true`| Show vault name and mode in the status bar |
49
-
|`obsidianVFS.workspace`|`boolean`|`true`| Add the vault as a workspace folder for Explorer browsing (see below) |
49
+
|`obsidianVFS.workspace`|`boolean`|`true`| Add the vault as a workspace folder for Quick Open and Search (see below) |
50
50
51
51
All three toggle settings (`explorer`, `statusBar`, `workspace`) take effect immediately — no reload required.
52
52
53
53
### Workspace Folder
54
54
55
-
When `obsidianVFS.workspace` is enabled, the extension adds a single **obs://\<vault\>** workspace folder using the `obs://` virtual file system. Mounted `autoMount` entries appear as children under this root — the Explorer shows one vault entry instead of one per folder. VS Code's **Search** (`Ctrl+Shift+F`) and **Quick Open** (`Cmd+P`) work across mounted content through the `FileSystemProvider`.
55
+
When `obsidianVFS.workspace` is enabled and at least one `autoMount` entry is configured, the extension adds a single `file://` workspace folder at the vault root (named **obs://\<vault\>** in the sidebar). VS Code's **Quick Open** (`Cmd+P`) and **Search** (`Ctrl+Shift+F`) discover vault files through this folder.
56
56
57
-
All file operations — stat, read, write, directory listing, and file watching — go through the `obs://` provider, which enforces `allowed`/`blocked` security rules from [`.obsidian/obsidian-vfs.json`](../../README.md#vault-configuration) at every level.
57
+
Non-autoMount vault content (`.obsidian/`, `.trash/`, and any directories not in `autoMount`) is hidden from Explorer and Quick Open via `files.exclude` patterns managed by the extension. Your own `files.exclude` patterns are never modified or removed.
58
58
59
59
**Requirements:**
60
60
61
61
- At least one local folder must be open — the vault workspace folder is appended to the list to avoid triggering an extension host restart.
62
+
- At least one `autoMount` entry must be configured — the workspace folder is not added when `autoMount` is empty.
62
63
63
-
**Notes:**
64
+
**How it works:**
64
65
65
-
- The Explorer tree view and the workspace folder both appear in the sidebar. The tree view provides custom UI (welcome view, context menus), while the workspace folder enables Quick Open and cross-extension visibility. The tree view uses `file://` URIs for opening files, which enables native features like Git integration.
66
-
-`autoMount` entries outside `allowed` or inside `blocked` are filtered from the workspace folder root listing. The core security layer remains as defense-in-depth for navigation into subdirectories.
66
+
- The extension scans the vault root and adds `files.exclude` patterns for entries not in `autoMount`. Patterns are written to workspace settings (`ConfigurationTarget.Workspace`) and tracked internally for cleanup.
67
+
- When `autoMount` entries change, patterns are re-synced automatically — stale patterns are removed and new ones added.
68
+
- When `obsidianVFS.workspace` is disabled, all managed patterns are removed and the workspace folder is deleted.
67
69
- The vault's `.git` repository is automatically added to `git.ignoredRepositories` (user-level setting) when the workspace folder is mounted, preventing VS Code's Git extension from listing it in Source Control. The entry is removed when `obsidianVFS.workspace` is disabled.
68
70
71
+
**Known limitations:**
72
+
73
+
-**Pattern scope:**`files.exclude` patterns apply to all workspace folders. If a non-autoMount vault directory shares a name with a directory in your project (e.g., both have a `docs/` folder), the project directory will also be hidden. Fix: add the vault directory to `autoMount`, or rename it in your vault.
74
+
-**Not a security boundary:**`files.exclude` hides content from Explorer and Quick Open but does not enforce access restrictions. The `obs://` FileSystemProvider's path security (`allowed`/`blocked` lists in `.obsidian-vfs.json`) applies to TreeView, wikilink, and drag-and-drop operations.
75
+
-**Title bar:** Adding the vault as a workspace folder creates a multi-root workspace. VS Code may show "UNTITLED (WORKSPACE)" in the title bar.
76
+
77
+
**Notes:**
78
+
79
+
- The Explorer tree view and the workspace folder both appear in the sidebar. The tree view provides custom UI (welcome view, context menus, drag-and-drop), while the workspace folder enables Quick Open and full-text search.
80
+
- The `obs://` FileSystemProvider remains registered for the TreeView sidebar, wikilink navigation, and drag-and-drop — it does not back a workspace folder.
81
+
69
82
## Related Tools
70
83
71
84
This VSCode extension provides file-system access and UI integration for Obsidian vaults. If you use **Claude Code**, the companion [`@obsidian-vfs/claude-plugin`](https://github.com/otaviof/obsidian-vfs/tree/main/packages/claude-plugin) enables Claude to read and search your vault via `@obs:` mentions and automatically resolves wikilinks in agent definitions and skills.
Copy file name to clipboardExpand all lines: packages/vscode/package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
"name": "obsidian-vfs",
3
3
"displayName": "Obsidian VFS",
4
4
"description": "Browse, search, and edit your Obsidian vault directly in VSCode via a virtual file system (obs://)",
5
-
"version": "0.2.3",
5
+
"version": "0.3.0",
6
6
"private": true,
7
7
"publisher": "otaviof",
8
8
"engines": {
@@ -127,7 +127,7 @@
127
127
"obsidianVFS.workspace": {
128
128
"type": "boolean",
129
129
"default": true,
130
-
"description": "Add the vault as a single obs:// workspace folder for Explorer browsing. Mounted entries appear as children under the vault root. Requires at least one local folder open."
130
+
"description": "Add the vault as a file:// workspace folder for Quick Open (Cmd+P) and Search (Ctrl+Shift+F). Non-autoMount content is hidden via files.exclude patterns managed by the extension. Requires at least one local folder open and at least one autoMount entry."
0 commit comments