Closed
Description
TypeScript Version: 3.9.0-dev.20200420
Search Terms:
- fix all
- code action
- quick fix
Code
With @types/node
installed, open a file:
join();
homedir()
- Now trigger quick fixes and select
add all missing imports
Bug:
The two imports are added on the same line:
import { join } from "path";import { homedir } from "os";
join();
homedir()
Here's the edit that TS Server returns in this case
[Trace - 23:52:04.985] <semantic> Response received: getCombinedCodeFix (72). Request took 13 ms. Success: true
Result: {
"changes": [
{
"fileName": "/Users/matb/projects/san/test.ts",
"textChanges": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "import { join } from \"path\";"
},
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 1,
"offset": 1
},
"newText": "import { homedir } from \"os\";\n"
}
]
}
]
}