Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/agents/extension-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ class WikiTreeDataProvider implements vscode.TreeDataProvider<WikiItem> {

```typescript
const disposables: vscode.Disposable[] = [];
disposables.push(
vscode.commands.registerCommand('workspaceWiki.refreshTree', () => provider.refresh())
);
disposables.push(vscode.commands.registerCommand('workspaceWiki.refreshTree', () => provider.refresh()));
return vscode.Disposable.from(...disposables);
```

Expand Down
23 changes: 16 additions & 7 deletions docs/architecture/preview-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,21 @@ See also: [Settings Manager](./settings.md)
```mermaid
sequenceDiagram
participant User as User
participant Tree as Workspace Wiki Tree
participant Controller as Preview/Open Controller
participant Editor as VS Code Editor
User->>Tree: Click file
Tree->>Controller: Request open (preview/editor)
Controller->>Editor: Open file (preview or editor)
participant Tree as Tree View
participant Handler as handleFileClick
participant Command as VS Code
User->>Tree: Single Click
Tree->>Handler: Trigger Click Handler
activate Handler
Handler->>Handler: Check Click Time
alt Single Click (< 500ms)
Handler->>Command: Execute Default Command
Command->>User: Open Preview
else Double Click (< 500ms apart)
Handler->>Command: Execute vscode.open
Command->>User: Open in Editor
end
deactivate Handler
```

This diagram shows how user actions in the tree trigger file opening in preview or editor mode.
This diagram shows the double-click detection flow: single clicks open files in preview mode (using the configured `openWith` command), while double clicks within 500ms open files in the full editor.
31 changes: 25 additions & 6 deletions docs/architecture/scanner.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,30 @@ See also: [Settings Manager](./settings.md)

```mermaid
flowchart TD
A[Start Scan] --> B{Find Files}
B -->|Supported Extensions| C[Collect Metadata]
C --> D[Cache Metadata]
D --> E[Watch for Changes]
E -->|File Changed| B
A[Start Scan] --> B[Read Config]
B -->|Get supportedExtensions| C[Set Extension Patterns]
B -->|Get excludeGlobs| D[Set Exclude Patterns]
B -->|Check showIgnoredFiles| E{Read .gitignore?}
E -->|Yes| F[Parse .gitignore]
E -->|No| G[Find Files]
F --> H[Merge Exclude Patterns]
H --> G
C --> G
D --> G
G -->|Pattern Matching| I[Get File URIs]
I -->|README Filter| J[Handle README Matching]
I -->|Hidden Files Filter| K{showHiddenFiles?}
K -->|No| L[Exclude Dot Files]
K -->|Yes| M[Include All Files]
J --> N{Depth OK?}
N -->|Yes| O[Return Files]
N -->|No| P[Skip Deep Files]
P --> O
L --> N
M --> N
O --> Q[Setup File Watcher]
Q --> R[Watch for Changes]
R -->|File Changed| G
```

This diagram shows the scanning process: finding files, collecting and caching metadata, and watching for changes.
This diagram shows the core scanning process: reading configuration, matching file patterns, filtering by various rules, and watching for changes.
20 changes: 10 additions & 10 deletions docs/architecture/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ The Settings Manager reads and applies user configuration for the Workspace Wiki

- `workspaceWiki.supportedExtensions`: File types to scan (default: `md`, `markdown`, `txt`).
- If `md` or `markdown` is included, files named `README` (no extension, case-insensitive) are also included and treated as Markdown.
- `workspaceWiki.excludeGlobs`: Patterns to exclude (e.g., `**/node_modules/**`).
- `workspaceWiki.maxSearchDepth`: Limit scan depth for large repos.
- `workspaceWiki.showIgnoredFiles`: Show files listed in .gitignore and excludeGlobs (default: false).
- `workspaceWiki.showHiddenFiles`: Show hidden files/folders starting with a dot (default: false).
- `workspaceWiki.excludeGlobs`: Glob patterns to exclude files and folders (default: `**/node_modules/**`, `**/.git/**`).
- `workspaceWiki.maxSearchDepth`: Maximum directory depth to search for documentation files (default: `10`).
- `workspaceWiki.showIgnoredFiles`: Show files listed in `.gitignore` and matched by `excludeGlobs` patterns (default: `false`).
- `workspaceWiki.showHiddenFiles`: Show hidden files and folders starting with a dot (e.g., `.github`, `.env`) (default: `false`).

### File Opening & Display

- `workspaceWiki.defaultOpenMode`: `preview` or `editor`.
- `workspaceWiki.openWith`: Commands to use for opening different file types.
- `workspaceWiki.directorySort`: How to sort files and folders (default: "files-first").
- `workspaceWiki.defaultOpenMode`: `preview` or `editor` (default: `preview`).
- `workspaceWiki.openWith`: Commands to use for opening different file types (default: `markdown.showPreview` for `.md`/`.markdown`, `vscode.open` for `.txt`).
- `workspaceWiki.directorySort`: How to sort files and folders: `files-first`, `folders-first`, or `alphabetical` (default: `files-first`).

### Title Formatting

- `workspaceWiki.acronymCasing`: Acronyms to preserve proper casing in file titles.
- `workspaceWiki.acronymCasing`: Acronyms to preserve proper casing in file titles (default: `HTML`, `CSS`, `JS`, `TS`, `API`, `URL`, `JSON`, `XML`, `HTTP`, `HTTPS`, `REST`, `SQL`, `CSV`, `FHIR`).

### Sync & Auto-Reveal

- `workspaceWiki.autoReveal`: Enable automatic file revelation in tree (default: `true`).
- `workspaceWiki.autoRevealDelay`: Delay in milliseconds before revealing (default: `500`).
- `workspaceWiki.autoReveal`: Automatically reveal the active file in the Workspace Wiki tree when the editor changes (default: `true`).
- `workspaceWiki.autoRevealDelay`: Delay in milliseconds before revealing the active file (default: `500`). Set to `0` for immediate reveal.

## Example

Expand Down
30 changes: 23 additions & 7 deletions docs/architecture/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,28 @@ See also: [Tree Data Provider](./tree-data-provider.md), [Settings](./settings.m

```mermaid
sequenceDiagram
participant VSCode as VS Code
participant User as User
participant Tree as Workspace Wiki Tree
User->>VSCode: Change active editor
VSCode->>Tree: Notify active file
Tree->>Tree: Reveal file in tree
participant VSCode as VS Code Editor
participant Listener as Editor Change Listener
participant Config as Config Manager
participant Tree as Tree Provider
participant View as Tree View
VSCode->>Listener: onDidChangeActiveTextEditor
activate Listener
Listener->>Config: Get autoReveal Setting
alt autoReveal disabled
Listener-->>VSCode: Return
else autoReveal enabled
Listener->>Config: Get autoRevealDelay
alt autoRevealDelay > 0
Listener->>Listener: Wait (setTimeout)
end
Listener->>Tree: findNodeByPath
alt Node Found & Tree Visible
Listener->>View: reveal(node)
View->>VSCode: Highlight & Expand
end
end
deactivate Listener
```

This diagram shows how the sync module listens for editor changes and reveals the corresponding file in the tree.
This diagram shows how the sync module listens for active editor changes, checks configuration, and reveals the corresponding file in the tree with optional delay.
32 changes: 20 additions & 12 deletions docs/architecture/tree-data-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,28 @@ Workspace Wiki

See also: [Scanner/Indexer](./scanner.md)

## TreeDataProvider Ordering Logic
## Ordering Logic

```mermaid
flowchart TD
A[All Files] --> B{Is Root?}
B -->|Yes| C[README.md First]
B -->|No| D[Folder Node]
C --> E[Other Root Docs A-Z]
D --> F{index.md Exists?}
F -->|Yes| G[Folder Named by index.md]
F -->|No| H[Folder Name]
G --> I[README.md in Folder]
G --> J[Other Files A-Z]
H --> J
A[All Nodes] --> B{Is README?}
B -->|Yes| C[Rank First]
B -->|No| D{Root Level?}
D -->|Yes| E[Apply Sort Mode]
D -->|No| F[Subfolder Node]
E -->|Get directorySort| G{Sort Mode}
G -->|files-first| H[Files before Folders]
G -->|folders-first| I[Folders before Files]
G -->|alphabetical| J[Alphabetical Order]
H --> K[Then Alphabetical]
I --> K
J --> K
K --> L[Final Sorted List]
F -->|index.md Exists| M[Folder Named by index]
F -->|No index.md| N[Use Folder Name]
M --> O[Children Sorted]
N --> O
O --> L
```

This diagram shows how files are ordered and displayed in the tree.
This diagram shows the node ordering logic: README files rank first, then root-level files/folders are sorted according to `directorySort` setting, then alphabetically by title within each type.
12 changes: 7 additions & 5 deletions docs/usage/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ The extension works out-of-the-box, but you can customize it via settings:

- `workspaceWiki.supportedExtensions`: File types to include (default: `md`, `markdown`, `txt`).
- `workspaceWiki.excludeGlobs`: Glob patterns to exclude (e.g., `**/node_modules/**`).
- `workspaceWiki.defaultOpenMode`: `preview` or `editor`.
- `workspaceWiki.directorySort`: How to sort files and folders (default: `files-first`).
- `workspaceWiki.openWith`: Commands to use for opening different file types.
- `workspaceWiki.maxSearchDepth`: Maximum directory depth to search (default: `10`).
- `workspaceWiki.autoReveal`: Auto-reveal active file in tree (default: `true`).
- `workspaceWiki.autoRevealDelay`: Delay before revealing active file in milliseconds (default: `500`).
- `workspaceWiki.showIgnoredFiles`: Show files/folders listed in .gitignore and excludeGlobs (default: false).
- `workspaceWiki.showHiddenFiles`: **Show hidden files and folders** (those starting with a dot, e.g. `.github`, `.env`) in the Workspace Wiki tree, unless excluded by .gitignore or excludeGlobs. Default is false (hidden files are not shown).
- `workspaceWiki.showIgnoredFiles`: Show files/folders listed in .gitignore and excludeGlobs (default: `false`).
- `workspaceWiki.showHiddenFiles`: Show hidden files and folders (those starting with a dot, e.g. `.github`, `.env`) in the Workspace Wiki tree, unless excluded by .gitignore or excludeGlobs (default: `false`).

To change settings:

Expand All @@ -36,9 +38,9 @@ To change settings:
{
"workspaceWiki.supportedExtensions": ["md", "markdown", "txt"],
"workspaceWiki.excludeGlobs": ["**/node_modules/**", "**/.git/**"],
"workspaceWiki.defaultOpenMode": "preview",
"workspaceWiki.directorySort": "files-first",
"workspaceWiki.autoReveal": true,
"workspaceWiki.autoRevealDelay": 500,
"workspaceWiki.showHiddenFiles": true
"workspaceWiki.showHiddenFiles": false
}
```
Loading