Closed cadin closed 4 years ago
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
Self contained example:
x.ts
export const a = 123;
export const b = 123;
export const c = 123;
index.ts
import {
b,
a,
} from './x'
console.log(c) // trigger import here
@andrewbranch does #40303 fix this for the 4.0 branch?
Yes
Well, I’m confused as to how this was happening on the nightly for the 11th. I’ll investigate, but this seems to be the exact same issue.
Yeah, I can't reproduce this with the nightly mentioned or with current master. @mjbvz was your repro using a nightly TS build?
Hi,
My TS version is 4.0.2 and I can confirm this happening.
@andrewbranch Actually this looks fixed in nightly; I must have tested it incorrectly. Can we make sure this fix is included in the next 4.0 recovery?
I have the same issue.
@mjbvz it’s already in the release branch: https://github.com/microsoft/TypeScript/pull/40303
@mjbvz it’s already in the release branch: #40303
OK, what does that mean? Will it get fixed in the next minor of TypeScript?
It will be in the next patch release, 4.0.3.
I am still facing this issue too, how can I fix it in my VS Code? -> https://github.com/microsoft/vscode/issues/107057
I still have this problem :(
I installed globally the newest typescript (4.1.3) and set typescript.tsdk
to my version. I have VS Code 1.52.1. Do I need to do anything more to have this fixed?
@mlewando does the TS version in the bottom-right match what you set?
If so, please post exact steps for how to reproduce.
Hi @andrewbranch I have a JavaScript project. I think that VS Code uses typescript under the hood anyway to autocomplete imports, but I don't have typescript version in my status bar:
the exact steps to reproduce for not is rather "it happens from time to time", but if it is (or may be) related, I will try to identify the exact reproduction.
In that case, when you have a JS file open, open the command palette and search for "Select TypeScript Version." Select it and make sure 4.1.3 is selected:
it is 4.1.3
so, I'll try to identify when exactly it happens and hopefully tomorrow I'll post working reproduction
Thanks! The text of all your imports before and after the auto import should be enough to reproduce.
So, I created a simple reproduction without a problem, and then I tried to reproduce it on the simple example with all extensions disabled - I failed. So I started to disable extensions until I identified the problematic one: exports autocomplete (https://github.com/capaj/vscode-exports-autocomplete) This extension is part of React Food Truck, but it became deprecated some time ago, which is even noted in https://github.com/burkeholland/react-food-truck/issues/6.
To sum up: for me, problem is solved :) thank you for attention :)
TS Template added by @mjbvz
TypeScript Version: 4.0.2
Search Terms
Steps to Reproduce:
Results: The new file is added to the import statement with an extra comma:
Expected Results: The import should be added on a new line with trailing comma:
The proper behavior occurs in version 1.48.2
Does this issue occur when all extensions are disabled?: Yes