microsoft / microsoft/TypeScript

ts1484 Quick fix will dupe comments

オープン
#64,272 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

### 🔎 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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。