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
{{ message }}
Repository navigation
Enable auto imports and add missing import for module/package namesΒ #52527
Auto imports / add missing imports should be able to add import * as XYZ from 'XYZ' when triggered on the symbol name XYZ in a file. This is useful if you prefer using namespace imports and can also help with discovering/exploring new packages
Right now we have auto imports and an add missing import quick fix for symbols in a module, but I don't see these options for the module itself
π Motivating Example
In a new project
npm I @types/vscode
Open new TS file and write vscode.
Right now I don't get an auto import for vscode. I'd expect an import that adds: import * as vscode from 'vscode'; at the top of the file
π» Use Cases
Make it easier to reference a symbol if you prefer using namespaces from the start
Helping users explore new packages (just type vscode. to see suggestions in the vscode package)
Working with node packages. It'd be nice to be able to type fs. to get an fs import
Fixing code that has been copy and pasted between files
Daniel Rosenwasser (@DanielRosenwasser) Looks like it. Andrew's answer makes sense but it does feel like we could do better here. Maybe only apply this for node packages to start?
Activity
DanielRosenwasser commentedon Feb 7, 2023
This was discussed at #23830, right?
mjbvz commentedon Feb 8, 2023
Daniel Rosenwasser (@DanielRosenwasser) Looks like it. Andrew's answer makes sense but it does feel like we could do better here. Maybe only apply this for node packages to start?