-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.7.0-dev.2018123
Search Terms:
- Quick fix all
- JavaScript
- Ts-ignore
Code
Create a js file with two errors on the same line:
// @ts-check
const a = 1;
const b = 2;
a = 1; b = 1;
Trigger quick fix all to add // @ts-ignore
before this line
Expected behavior:
Returned edit inserts a single // @ts-ignore
Actual behavior:
getCombinedCodeFix
returns two duplicate insertions for // @ts-ignore
. This results in:
// @ts-check
const a = 1;
const b = 2;
// @ts-ignore
// @ts-ignore
a = 1; b = 1;
[Trace - 15:40:36] Response received: getCombinedCodeFix (2112). Request took 1 ms. Success: true
Result: {
"changes": [
{
"fileName": "/Users/matb/projects/san/b.js",
"textChanges": [
{
"start": {
"line": 6,
"offset": 1
},
"end": {
"line": 6,
"offset": 1
},
"newText": "// @ts-ignore\n"
},
{
"start": {
"line": 6,
"offset": 1
},
"end": {
"line": 6,
"offset": 1
},
"newText": "// @ts-ignore\n"
}
]
}
]
}
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue