Conversation
On the first JS/TS file opened in a config-less project, create a jsconfig.json so vtsls scopes the whole project (cross-file Find Usages, Rename, Go to Definition) and show an unobtrusive toast with See Config / Enable TypeScript / Learn more. The toast uses a new reusable SUBTLE NotificationUI style and opens instantly (instantOpen). Deleting the config opts out (remembered per project via a 'created' flag, so it is not recreated); the Problems panel then shows a re-enable row for JS/TS files. Always creates jsconfig.json (editor-only, never affects builds) which still scopes .ts files. Desktop-only; skipped in test windows.
Restart was awaiting the graceful LSP shutdown handshake unbounded, so a busy or cold server could stall a project-switch restart. Bound it to 3s then hard-kill (the graceful path is kept for servers that need it). Also drop inbound messages for a server that is stopping, so stale diagnostics from a dying instance can't leak into the fresh one that replaces it. Tests: warm up tsserver once in the TypeScript LSP integration beforeAll (its one-time cold start can exceed a spec timeout on slow CI runners) and add per-spec timeout headroom; replace the fixed-time wait in the jump-to-definition spec with a retry until the LSP result lands.
Run completion documentation through highlight.js (same path as the hover popup) so fenced code blocks render as colored code instead of flat monospace. Extract the theme-aware hljs token colours into a shared .lsp-hover-quickview/.lsp-hint-doc-popup rule used by both popups.
…estart Restarting the language server on every project switch re-paid tsserver's cold start (spawning node + loading the TypeScript library) each time. When the server advertises workspace.workspaceFolders.changeNotifications, re-point it live with workspace/didChangeWorkspaceFolders (remove old root, add new) instead - no process restart, no cold start. Generic in LSPClient: servers without the capability transparently fall back to a full restart, and restart remains the recovery path for crashes / server-version changes. Verified: A->B project switch ~160ms with cross-file Find Usages working in both projects and no vtsls respawn in the logs.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



On the first JS/TS file opened in a config-less project, create a jsconfig.json so vtsls scopes the whole project (cross-file Find Usages, Rename, Go to Definition) and show an unobtrusive toast with See Config / Enable TypeScript / Learn more. The toast uses a new reusable SUBTLE NotificationUI style and opens instantly (instantOpen).
Deleting the config opts out (remembered per project via a 'created' flag, so it is not recreated); the Problems panel then shows a re-enable row for JS/TS files. Always creates jsconfig.json (editor-only, never affects builds) which still scopes .ts files. Desktop-only; skipped in test windows.