microsoft / microsoft/TypeScript
ts1484 Quick fix will dupe comments
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.3k
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 132
Descripción
### 🔎 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.
Guía de contribución
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 68/100