This is the main entry point of the Brwne VS Code extension. It orchestrates extension initialization, environment setup, lifecycle management, and integration of subsystems like tracking, highlighting, and syncing.
Called automatically by VS Code when the extension is activated.
Responsibilities:
Identify Brwne Mode
Determines whether the CLI is running in development (brd) or production (br) based on the BRWNE_MODE environment variable. This is for the cli interface.
Enable Auto-Save
Ensures VS Code is set to auto-save after a 1-second delay using enableAutoSaveWithDelay().
Initialize File and Editor Tracking
Calls EditorTracker.getInstance() to start watching file and editor changes.
Trigger Initial Highlighting
Initializes highlighting system and calls startPollingForChanges() on the active file.
Check CLI Availability
Executes brd/br --version to confirm Brwne CLI is available. Warns the user if not.
📴 Deactivation
deactivate(): void
Cleans up persistent listeners related to highlighting using cleanupHighlightListeners().
🔗 Integrated Modules
This file coordinates functionality from several key subsystems: