Microsoft/TypeScript

Suggestion isn't included in quick fixes

Open

#50.641 geöffnet am 5. Sept. 2022

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (6.726 Forks)batch import
Domain: LS: Quick FixesEffort: ModerateExperience EnhancementHelp WantedSuggestion

Repository-Metriken

Stars
 (48.455 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)

Beschreibung

Bug Report

Maybe this is by design, but I still find it a bit awkward. The issue is that the suggestion that appears when hovering over a TS error in VS Code (I could also reproduce it in VS, so it seems like a tsserver behavior and not an IDE thing) isn't included as a quick fix. See the code below for an example.

🔎 Search Terms

  • default
  • export

💻 Code

Say I have file1.ts with the following contents:

const foo = 0;

export default foo;

And I have the following in file2.ts:

import { foo } from './file1';

Because file1.ts has no named exports, the code in the second file has an error. When I hover over the squiggle, VS Code displays: image Despite the dialog mentioning exactly the fix that I would like to apply, that fix isn't included as a possible refactoring: image

My expectation is that the suggestion mentioned in the hover dialog is included as a quick fix.

Contributor Guide