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
@@ -4,36 +4,160 @@ This section explains the overall architecture of the Workspace Wiki extension,
4
4
5
5
## Main Components
6
6
7
-
-**Scanner/Indexer**: Discovers documentation files in the workspace, caches metadata, and watches for changes.
8
-
-**TreeDataProvider**: Renders the documentation tree in the sidebar, applying ordering and title normalization.
9
-
-**Preview/Open Controller**: Handles file opening (preview/editor) and user interactions.
10
-
-**Settings Manager**: Reads and applies extension settings.
11
-
-**Sync Module**: Keeps the tree in sync with the active editor.
12
-
-**Utilities**: Helpers for title normalization and file type detection.
7
+
-**[Scanner](../../src/scanner/workspaceScanner.ts)**: Discovers documentation files using `workspace.findFiles`, respects `.gitignore` and exclude patterns, filters hidden files, and returns URIs.
8
+
-**[Tree Provider](../../src/tree/treeProvider.ts)**: Implements VS Code's `TreeDataProvider` interface, builds hierarchical tree structure, applies ordering rules, manages node mapping for sync.
9
+
-**[Tree Builder](../../src/tree/buildTree.ts)**: Constructs hierarchical tree from flat file list, calculates common base path, sorts nodes, handles folder/file relationships.
10
+
-**[Preview Controller](../../src/controllers/previewController.ts)**: Handles file opening with double-click detection (500ms threshold), manages preview vs editor modes, respects `openWith` configuration.
11
+
-**[Configuration Utilities](../../src/utils/configUtils.ts)**: Provides typed access to extension settings with default values.
12
+
-**[Text Utilities](../../src/utils/textUtils.ts)**: Normalizes file names to human-readable titles, preserves acronym casing, handles special cases (README).
-**[Sync Module](../../src/extension.ts)**: Integrated into main extension activation, reveals active file in tree with configurable delay, respects visibility state.
This diagram shows the main modules and their interactions. The Scanner/Indexer discovers files, which are passed to the TreeDataProvider for display. The Preview/Open Controller manages file opening, and all modules use the Settings Manager and Utilities as needed. The Sync Module keeps the tree in sync with the active editor.
124
+
## Data Flow
125
+
126
+
```mermaid
127
+
sequenceDiagram
128
+
participant User
129
+
participant VSCode as VS Code
130
+
participant Extension
131
+
participant Scanner
132
+
participant TreeProvider
133
+
participant TreeView
134
+
participant Controller
135
+
136
+
User->>VSCode: Opens workspace
137
+
VSCode->>Extension: activate()
138
+
Extension->>TreeProvider: new WorkspaceWikiTreeProvider()
0 commit comments