So if you have ever written in a ECMAScript language (JavaScript/TypeScript/...) you know that the autocomplete on the import is crap. Since you first say what you want and then say where from so the autocomplete has no idea what is available:
Visual Studio Code lets you define where in the snippets you want to fill step by step
and that became a really good way to fix the problem. With the imp
snippet you can do:
You can simply add this snippet to your JavaScript / TypeScript snippets in the Visual Studio Code and have fun :)
{
"pouyas-import": {
"scope": "typescript,javascript",
"prefix": "imp",
"body": [
"import { $0 }",
" from \"$1\""
]
}
}
So @orta told me that:
From TypeScript 4.4 onwards, we autocomplete from after the import! e.g.
import Parse
should showimport { ParseState } from “../state”
It’s one of my fav features
You can find it as :
Yet I think that the imp
is much more easier to write than the original TypeScript snippet.
I'm not sure it is, you still have to write the filename, vs the TS version which will add that for you!