Skip to content

feat(typescript): auto-enable project-wide code intelligence#2986

Merged
abose merged 4 commits into
mainfrom
ai
Jun 21, 2026
Merged

feat(typescript): auto-enable project-wide code intelligence#2986
abose merged 4 commits into
mainfrom
ai

Conversation

@abose

@abose abose commented Jun 20, 2026

Copy link
Copy Markdown
Member

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.

abose added 4 commits June 20, 2026 12:18
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.
@abose abose merged commit e6a7f2b into main Jun 21, 2026
9 of 21 checks passed
@abose abose deleted the ai branch June 21, 2026 11:05
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant