Skip to content

fix: guarantee eager activation for vim/neovim extensions on Windows#205

Merged
j4rviscmd merged 1 commit into
mainfrom
fix/vscode-neovim-fix
Jun 15, 2026
Merged

fix: guarantee eager activation for vim/neovim extensions on Windows#205
j4rviscmd merged 1 commit into
mainfrom
fix/vscode-neovim-fix

Conversation

@j4rviscmd

Copy link
Copy Markdown
Owner

Summary

  • PR feat: add eager extension activation for vim/neovim #193's * injection in ImplicitActivationEvents worked on macOS but failed on Windows cold starts: the coderm.extensions.eagerActivation config value is sometimes not yet loaded at AbstractExtensionService constructor time, leaving _eagerExtensions empty and falling back to the extension's declared events (e.g. vscode-neovim 1.19.0's ['onCommand:type', 'onStartupFinished']). onCommand:type only fires on first key press — exactly the reported symptom.
  • Add an authoritative activation path that does not depend on activation events: a new _activateEagerExtensions() invoked after _initialize() completes (config is guaranteed loaded by then), which uses activateById() to force-start each configured extension directly.
  • Keep the existing * injection as backup and for future extension scans (_refreshEagerExtensionConfig()).
  • Add an onDidChangeConfiguration listener so users can add/remove eager extensions without a restart.

Test plan

  • Build Coderm with npm run watch
  • Launch on Windows, confirm vscode-neovim is active immediately (no key press required)
  • Verify on macOS that behavior remains unchanged
  • Confirm [Coderm] Eagerly activating extension: asvetliakov.vscode-neovim log appears in Output > Log (Extension Host)

🤖 Generated with Claude Code

PR #193 injected `*` into activation events via ImplicitActivationEvents
in the AbstractExtensionService constructor. This worked on macOS but
on Windows cold starts the `coderm.extensions.eagerActivation` config
value is sometimes not yet loaded at constructor time, leaving
`_eagerExtensions` empty and falling back to the extension's declared
events (e.g. vscode-neovim's `onCommand:type`, which only fires on
first key press — exactly the symptom users reported).

Add a second, authoritative activation path that does not depend on
activation events at all:

- New `_activateEagerExtensions()` invoked after `_initialize()`
  completes, where the config registry is guaranteed loaded. It uses
  `activateById()` to force-start each configured extension directly.
- `_refreshEagerExtensionConfig()` keeps the `*` injection map in sync
  as a backup and for future extension scans.
- An `onDidChangeConfiguration` listener re-runs both paths when the
  setting changes, so users can add/remove eager extensions without
  restarting.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@j4rviscmd j4rviscmd added the bug Something isn't working label Jun 15, 2026
@j4rviscmd j4rviscmd merged commit ea12f3c into main Jun 15, 2026
3 checks passed
@j4rviscmd j4rviscmd deleted the fix/vscode-neovim-fix branch June 15, 2026 05:09
j4rviscmd added a commit that referenced this pull request Jun 15, 2026
Eager activation (coderm.extensions.eagerActivation, PR #193/#205)
activates vscode-neovim early, but other startup work running
afterwards occasionally strands focus on <body> (no pane focused),
so vscode-neovim stops responding to normal-mode keys until the
user alt+tabs away and back.

Add StartupFocusGuardController that opens a short window after each
eager extension finishes activating (onDidChangeExtensionsStatus +
activationTimes) and refocuses the active editor group only when
focus truly lands on nothing (getActiveElement() is body/html/null).
Intentional focus moves (e.g. clicking the terminal) are respected.

New setting: coderm.startup.focusGuard.enabled (default: true).

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant