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
feat(lsp): start the TypeScript server lazily, repoint only on project switch
The server was spawned eagerly on app boot and repointed on every project switch,
regardless of language - so a Python-only project still ran vtsls and re-indexed
it on switch. Mirror VS Code's onLanguage model instead: start the server only
when a served-language (JS/TS/JSX/TSX) file is the active editor, and repoint
(workspace/didChangeWorkspaceFolders) only when a served file is active right
after a project switch - never on ordinary file switches. Once started the server
stays alive idle (no proactive shutdown).
- main.js: _ensureServerForActiveEditor() driven by activeEditorChange + an initial
evaluation; a pendingRepoint flag (set on EVENT_PROJECT_OPEN) gates the repoint so
file switches don't touch the workspace-folder/restart machinery. Report a start
failure via window.logger.reportError, deduped (start is retried lazily). Drop the
eager appReady start and the now-meaningless readiness flag.
- LSPClient.changeWorkspaceRoot: check same-root first so a redundant call is a no-op
and never restarts a server that lacks live workspace-folder support.
- tests: the lazy "never started" state isn't observable in the reused integration
window (keep-alive, no stop path), so don't assert it; drop the readiness-flag wait
(window load already guarantees the extension's appReady ran).
0 commit comments