microsoft / microsoft/TypeScript

ts1484 Quick fix will dupe comments

Offen
#64,272 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

### 🔎 Search Terms

"quickfix comment" "dupe comment"

### 🕗 Version & Regression Information

- This changed between versions 6.0.0-dev.20260416 and 6.0.3 of vscode extensions.

### ⏯ Playground Link

_No response_

### 💻 Code

index.ts:
```ts
// upper comment
/*left comment*/ import { foo } from "./foo"; // right comment
// lower comment
```
foo.ts:
```ts
export type foo = "foo":
```
and enable verbatimModuleSyntax.
then run quick fix `use 'import type'`.

### 🙁 Actual behavior
index.ts:
```ts
// upper comment
/*left comment*/ // upper comment
/*left comment*/ import type { foo } from "./foo"; // right comment
// right comment
// lower comment
```
upper, left and right comment is duped.

### 🙂 Expected behavior
```ts
// upper comment
/*left comment*/ import type { foo } from "./foo"; // right comment
// lower comment
```
### Additional information about the issue

ts1484 error: 'foo' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduce the issue with the index.ts and foo.ts snippets, enable verbatimModuleSyntax, and invoke the ts1484 quick fix to use an import type. Start by tracing the quick-fix behavior for that diagnostic; done means the import changes without duplicating the upper, left, or right comments.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.