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
Copy file name to clipboardExpand all lines: TECHNICAL.md
+23-5Lines changed: 23 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -257,6 +257,14 @@ reload(): void
257
257
258
258
Patterns follow `.gitignore` syntax, parsed by the [`ignore`](https://www.npmjs.com/package/ignore) npm package — the standard implementation used by many tools. `IgnoreService` normalises backslash paths to forward slashes on Windows before passing them to `ignore`.
259
259
260
+
In addition to user-owned `.asnotesignore` content, the extension builds a runtime ignore layer via `createConfiguredIgnoreService()` for mandatory exclusions derived from current configuration. These patterns are added after `.asnotesignore` is loaded so they remain non-optional even if a user adds negation rules.
261
+
262
+
Mandatory runtime exclusions are:
263
+
264
+
-`.asnotes/`
265
+
- configured `templateFolder`
266
+
- configured `assetPath`
267
+
260
268
**`.asnotesignore` lifecycle:**
261
269
262
270
- Created by `initWorkspace()` at the workspace root (same level as `.asnotes/`) if it does not already exist.
@@ -272,7 +280,7 @@ The create-if-missing logic is centralised in a private `ensureIgnoreFile(worksp
272
280
|`rebuildIndex()`| At the start of every manual rebuild |
273
281
|`startPeriodicScan()` setInterval callback | On every periodic scan tick |
274
282
275
-
After `ensureIgnoreFile()` is called in `rebuildIndex()` and `startPeriodicScan()`, `ignoreService?.reload()` is called immediately so the in-memory patterns reflect any changes (including recreation after deletion) before the scan proceeds.
283
+
After `ensureIgnoreFile()` is called in `rebuildIndex()` and `startPeriodicScan()`, `ignoreService?.reload()` is called immediately so the in-memory patterns reflect any changes (including recreation after deletion) before the scan proceeds. When `templateFolder` or `assetPath` changes, the extension recreates the configured ignore service and re-runs a stale scan so the mandatory runtime exclusions update immediately without rewriting `.asnotesignore`.
276
284
277
285
**Integration with IndexScanner:**
278
286
@@ -2637,7 +2645,17 @@ In `extension.ts`, all index update triggers (`onDidSaveTextDocument`, `onDidCha
2637
2645
2638
2646
A private `isEncryptedFileUri(uri)` helper centralises the `.enc.md` check within `extension.ts`.
The index also excludes mandatory runtime directories built from extension configuration:
2651
+
2652
+
-`.asnotes/`
2653
+
- configured `templateFolder`
2654
+
- configured `assetPath`
2655
+
2656
+
These are enforced through `IgnoreService` rather than written into `.asnotesignore`, so settings changes take effect immediately and user ignore files remain user-owned.
See [IgnoreService and .asnotesignore](#ignoreservice-and-asnotesignore) in the Persistent index section.
2643
2661
@@ -2664,19 +2682,19 @@ AS Notes delegates file drop and paste to VS Code's **built-in** markdown editor
2664
2682
2665
2683
### Workspace configuration
2666
2684
2667
-
`applyAssetPathSettings()` in `src/ImageDropProvider.ts` reads `as-notes.assetPath` (default `assets/images`) and writes:
2685
+
`applyAssetPathSettings()` in `src/ImageDropProvider.ts` reads `as-notes.assetPath` (default `assets`) and writes:
2668
2686
2669
2687
```json
2670
2688
"markdown.copyFiles.destination": {
2671
-
"**/*.md": "assets/images/${fileName}"
2689
+
"**/*.md": "assets/${fileName}"
2672
2690
}
2673
2691
```
2674
2692
2675
2693
to `.vscode/settings.json` at workspace scope. `${fileName}` is a built-in VS Code variable that resolves to the original filename of the dropped/pasted file.
2676
2694
2677
2695
| Setting | Default | Description |
2678
2696
|---|---|---|
2679
-
|`as-notes.assetPath`|`assets/images`| Workspace-relative folder where dropped/pasted files are saved |
2697
+
|`as-notes.assetPath`|`assets`| Workspace-relative folder where dropped/pasted files are saved |
Copy file name to clipboardExpand all lines: vs-code-extension/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -292,7 +292,7 @@
292
292
},
293
293
"as-notes.assetPath": {
294
294
"type": "string",
295
-
"default": "assets/images",
295
+
"default": "assets",
296
296
"description": "Folder where dropped or pasted files are saved by VS Code's built-in markdown editor, relative to the AS Notes root directory. AS Notes configures the built-in markdown.copyFiles.destination setting to use this path."
0 commit comments