You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is that would be possible to have something like in WebStorm?
Unambiguous imports on the fly With this checkbox selected, WebStorm adds import statements when you type your code or paste a fragment with a symbol that is not yet imported if there is only one source to import the symbol from.
Meaning that for e.g. if I type Text while my suggest widget is turned off it automatically imports it from the react-native package, because Text exists there. Or lets say I'm in Node.js project and I type path. and it automatically adds: import path from "path".
I thought about creating an extension which reads diagnostics and uses built-in VS Code source.addMissingImports, but I do believe you guys are way more experienced to know more gotchas and if it really possible to have this feature which works reliably.
I thought about creating an extension which reads diagnostics and uses built-in VS Code source.addMissingImports, but I do believe you guys are way more experienced to know more gotchas and if it really possible to have this feature which works reliably.
@svipas Yes I have an extension exactly does this thing. It's called better snippets (https://github.com/zardoy/vscode-better-snippets,which has exactly this thing implemented with the feature called auto-imports, you can read the docs and try it with typing snippets, I use them on everyday basis. However TS doesn't provide auto import quick fixes in some cases such as path or fs. Will try to not to forget to attach some configuration examples once I'm home
@zardoy sounds awesome, but does it support that it auto-imports anything what I type, because I have bunch of packages and a lot of local exports does that mean I need to add into configuration each one of them? Because I want it to work with more than path or fs.
Please if it is possible, share me a configuration example if it is possible.
Is that would be possible to have something like in WebStorm?
Meaning that for e.g. if I type
Text
while my suggest widget is turned off it automatically imports it from thereact-native
package, becauseText
exists there. Or lets say I'm in Node.js project and I typepath.
and it automatically adds:import path from "path"
.I thought about creating an extension which reads diagnostics and uses built-in VS Code
source.addMissingImports
, but I do believe you guys are way more experienced to know more gotchas and if it really possible to have this feature which works reliably./cc @zardoy @Ilanaya
The text was updated successfully, but these errors were encountered: