Commit Graph
1739 Commits
Author SHA1 Message Date
69e459e483 fix: signature help's active overload not updating (#320980)
* fix: signature help active overload not updating

- Active overload now updates when typed arguments narrow the overload set

* fix: replace findIndex with direct index lookup in getActiveSignature

- Instead of searching signatures by label to get an index and comparing
  it to info.selectedItemIndex, look up signatures[info.selectedItemIndex]
  directly so both sides of the comparison use the same index source

* test: add unit tests for #268728 overload fix

- Extract getActiveSignature as an exported function so unit
  tests can import it without the extension host
- Add BEFORE suite documenting the original bug: on retrigger,
  old code returned the stale overload index even after
  TypeScript updated selectedItemIndex (e.g. after a string
  argument narrows the overload set on the comma trigger)
- Add AFTER suite verifying the fix: retrigger now honours
  TypeScript's updated selectedItemIndex; the BUG test case
  that returned 0 now correctly returns 1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: address Copilot review on #268728

- Rename exported helper to computeActiveSignatureIndex to
  avoid identifier collision with the private method
- Stop returning activeSignatureHelp.activeSignature: that
  index refers to the previous signature list, which is stale
  if the list reorders between invocations; always use
  tsSelectedItemIndex instead
- Add regression test for the reordering case: verifies that
  when the list reorders and TS still selects the same overload
  by label, the current index is returned, not the stale one

* fix: address Copilot review on #268728

- Simplify computeActiveSignatureIndex to only accept
  tsSelectedItemIndex; the context and signatures params
  were unused and made the API misleading
- Add @internal JSDoc to signal the
  computeActiveSignatureIndex export is for unit
  testing only, not public API
- Replace assertion-based BEFORE suite with block comment
  documenting the original bug; asserting known-wrong
  behaviour institutionalizes incorrect expectations

* fix: simplify active overload selection

- Replace the label-matching retrigger guard with result.activeSignature = info.selectedItemIndex;
  the guard became a no-op after the existingIndex === selectedItemIndex fix and its removal is the correct minimal change
- Export TypeScriptSignatureHelpProvider as _TypeScriptSignatureHelpProvider
  (VS Code underscore-prefix convention for test-only exports)
- Add unit tests via mock ITypeScriptServiceClient: documents the old buggy guard behavior
  and verifies the fix — the FIX test would fail if the label-matching guard were reintroduced

* fix: address Copilot unit test review comments

- Move CancellationTokenSource into setup/teardown so it is properly disposed after each test
- Add success: true and message: '' to mock response to match the protocol shape
- Add @internal test-only export JSDoc to _TypeScriptSignatureHelpProvider to make the export intent explicit

* Fix signature help overload selection

Track TypeScript-selected and user-selected overloads separately so retriggers follow updated recommendations without resetting manual selections.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-29 15:55:32 +00:00
Rob LourensandGitHub a17439488d typescript: suppress Copilot Chat crash notification (#325405)
typescript: suppress Copilot Chat plugin crash notification

Do not show the JS/TS language service crash notification when Copilot Chat is the only contributing TypeScript server plugin. Continue reporting other plugins and preserve the existing no-plugin notification.\n\n(Written by Copilot)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-13 23:58:34 +00:00
Jake BaileyandGitHub ebfde981ed Merge pull request #321192 from jakebailey/new-corsa-name
Support new TS extension ID in addition to old ID
2026-06-16 07:48:38 -07:00
dileepyavanandGitHub ca425775e4 Revert "Optimize shared built-in extension dependencies (#318045)" (#319774)
This reverts commit 26e580781a.
2026-06-03 17:21:27 +00:00
Dmitriy VasyuraandGitHub 26e580781a Optimize shared built-in extension dependencies (#318045) 2026-06-03 08:49:40 +00:00
Matt Bierner 4d8a4fdb18 Fix a few simple anys in extensions 2026-05-19 15:38:59 -07:00
Matt BiernerandCopilot d9f2b9479f Add one time prompt to try ts 7.0 if you have ts nightly installed
Fixes #311966

Co-authored-by: Copilot <copilot@github.com>
2026-04-22 12:32:12 -07:00
Matt Bierner 602bc5a588 Override ts implicit project defaults explicitly
Fixes https://github.com/microsoft/vscode/issues/308559
2026-04-09 16:08:23 -07:00
yogeshwaran-c ef6d5f314e fix: send user preferences to TS server even without visible editor
When ensureConfigurationForDocument is called and no visible text editor
is found for the document, getFormattingOptions returns undefined and
the method returns early without sending any configuration including
user preferences like preferTypeOnlyAutoImports to the TS server.

This causes source.addMissingImports to ignore the user's
preferTypeOnlyAutoImports setting.

Fix by falling back to undefined formatting options when no visible
editor is found, ensuring user preferences are always sent.

Closes #272479
2026-03-26 06:45:15 +05:30
Logan RamosandGitHub c0f95d9bb1 Fix GDPR comment conflict (#303201) 2026-03-19 14:18:38 +00:00
deepak1556 f6da4b4e1a fix: add graceful shutdown path when heapprofile is enabled 2026-03-04 13:08:01 +09:00
deepak1556 278032fc75 feat: support heap profile and snapshot capture for tsserver 2026-03-04 01:36:10 +09:00
Matt Bierner c100c1fd24 Align js/ts.suggest.completeJSDocs with other names
Fixes #298734

Aligning this to use the id `js/ts.suggest.jsdoc.enabled` because we have another setting in the `#js/ts.suggest.jsdoc.*` scope
2026-03-02 08:26:55 -08:00
Matt Bierner 3fd6059046 Remove unused 2026-02-23 11:26:21 -08:00
Matt Bierner 11a5279976 Switch remaining settings to use js/ts prefix
For #292934

Also renames some of the server settings to have a more consistent naming scheme. This is going to be annoying but is the best time to do this since we are already changing the full setting id
2026-02-23 11:20:52 -08:00
Matt Bierner 000d29cc4e Add helper class to work with js/ts unified configs
For #292934
2026-02-22 23:33:29 -08:00
2a0ce9055c Update extensions/typescript-language-features/src/tsServer/bufferSyncSupport.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-20 18:03:03 -08:00
Matt Bierner 655ce6f07e Adopt unified js/ts setting for diagnostic settings
For #292934

Also renames validate.enable to `validate.enabled` to align with other settings
2026-02-20 17:54:24 -08:00
Matt BiernerandGitHub 840c39d319 Merge pull request #296137 from mjbvz/dev/mjbvz/criminal-capybara
Adopt unified js/ts setting for a few more language settings
2026-02-18 15:57:57 -08:00
Matt Bierner eeb0e12bed Adopt unified js/ts setting for a few more language settings
For #292934
2026-02-18 15:38:04 -08:00
Matt Bierner 19007fb635 Remove workaround for Microsoft/TypeScript#59831
This has been fixed for a while. We want to avoid having to shim out `os` for browser builds
2026-02-18 15:22:46 -08:00
Matt Bierner cd0e3f3485 Fixing scopes 2026-02-18 07:45:46 -08:00
Matt Bierner 3f8fc43e23 Use standard setting name and fix check 2026-02-17 16:56:50 -08:00
Matt Bierner 2a2f6407e4 Adopt unified js/ts setting for format settings
For #292934
2026-02-17 13:05:55 -08:00
Matt Bierner 5ded895db4 Adopt unified js/ts setting for preferences
For #292934
2026-02-13 15:33:01 -08:00
Matt Bierner dfc43c73a6 Adopt unified js/ts setting for suggest
Fixes #292934
2026-02-12 15:07:36 -08:00
Matt Bierner 7566dfb857 Switch to unified js/ts settings for inlay hints
For #292934
2026-02-11 17:12:25 -08:00
Matt Bierner 0493189e18 Start adopting unified js/ts config for code lenses
For #292934

Testing this with a self contained area first: code lenses. Will keep support for the old setting values too to avoid breaking existing settings
2026-02-10 16:14:49 -08:00
Matt Bierner cfbd57afa6 Remove region diagnostics setting
Part of #292934

This is an implementation detail. Was only really added in 5.6 in case the new behavior caused issues. Should be safe to remove now
2026-02-04 14:44:40 -08:00
Matt BiernerandGitHub b5be18e85d Merge pull request #280207 from mjbvz/dev/mjbvz/developing-mammal
Add native preview TS version pick option
2025-11-30 18:03:34 -08:00
Matt Bierner 1d5b9b5cd2 Add native preview TS version pick option
Fixes #280206
2025-11-30 17:43:52 -08:00
Matt Bierner dd5c1e4656 Fix tests 2025-11-25 11:22:33 -08:00
Matt Bierner 22ce98c190 Add title for jsdoc symbol links
Fixes #279417
2025-11-25 10:58:36 -08:00
Matt Bierner 9dfb647be4 Still register tsconfig features with tsgo
For https://github.com/microsoft/typescript-go/issues/2153
2025-11-24 08:42:36 -08:00
Tyler James LeonhardtandGitHub 8711dcb9da Fix offending l10n.t call and add an eslint rule to prevent it from happening (#277577)
ref https://github.com/microsoft/vscode/issues/277576
2025-11-14 18:13:03 -08:00
Matt BiernerandGitHub 078d0d5707 Merge pull request #264546 from ritesh006/test/implementations-codelens
feat(ts-codeLens): show "implementations" CodeLens for overridden methods #263749
2025-11-03 12:04:42 -08:00
Matt Bierner d02b204cb0 Make sure more TS commands are disabled when tsgo is active
We need to clear the contexts when switching to tsgo
2025-10-16 17:14:38 -07:00
Matt BiernerandGitHub e8b2531c8b Merge pull request #271470 from mjbvz/dev/mjbvz/panicky-mockingbird
Enforce single quote string usage in extension tests
2025-10-15 11:16:49 -07:00
Matt Bierner 29eb45f7fe Make sure we clear diagnostics when switching to tsgo 2025-10-15 10:58:57 -07:00
Matt Bierner 1c35a4d05c Enforce single quote string usage in extension tests
Single quoted string usage is already enforced everywhere except our tests. Having this inconsistent style can confuse contributors and code generation

Starting with converting over tests in the `extensions` dir
2025-10-15 01:51:43 -07:00
Matt Bierner c3bcc160ce Doc fixes 2025-10-15 00:42:59 -07:00
Matt Bierner c099047be6 Update tests and small tweaks 2025-10-15 00:40:11 -07:00
Ritesh KudkelwarandGitHub 1d291cd7a9 Merge branch 'main' into test/implementations-codelens 2025-10-11 10:50:06 +05:30
ritesh006 cd5348abcd ts-codelens: implementations for overrides + test 2025-10-11 10:49:03 +05:30
Matt Bierner ff4c31cbec Reduce any usage in ts extension
Follow up on #269213
2025-10-06 13:59:38 -07:00
Matt Bierner 4d32398e42 Fix checking $traceid for empty args 2025-10-06 10:10:49 -07:00
Matt Bierner 21337a4ad0 Add assertion 2025-10-03 14:45:09 -07:00
Matt Bierner cb01224865 Fix all any casts in TS extension
For #269213
2025-10-03 14:01:27 -07:00
Matt Bierner 360c9fd134 Add lint rule for as any and bulk ignore all existing breaks
For #269213

This adds a new eslint rule for `as any` and `<any>({... })`. We'd like to remove almost all of these, however right now the first goal is to prevent them in new code. That's why with this first PR I simply add `eslint-disable` comments for all breaks

Trying to get this change in soon after branching off for release to hopefully minimize disruption during debt week work
2025-10-02 23:38:33 -07:00
Matt BiernerandGitHub d26ff4659d Merge pull request #269402 from mjbvz/dev/mjbvz/outside-capybara
Only disable built-in TS if TS go is installed
2025-10-01 10:57:22 -07:00