Global completion / Auto import for JavaScript symbols from modules without typings included. #33289
Closed
5 tasks done
Labels
Milestone
Search Terms
"auto import", "completion", "auto import global", "auto import cache"
Suggestion
Hi, first of all good job for your awesome work.
My suggestion is simple :
When the completion is triggered, we filter the results to exclude the ones that are not importable. As you can see in
TypeScript/src/services/codefixes/importFixes.ts
Line 610 in 3c42760
However in some cases we want symbols that are not directly importable.
For example, if a JavaScript dependency doesn't include a
.d.ts
file, and there is one available in the TypeScript cache folder (downloaded by VSCode Automatic Type Acquisition).I think this would fix a lot of users issues.
For example : #29039
Use Cases
This would permit, to auto import the symbols from a JavaScript package that does not include a
.d.ts
in his sources.For example :
react-redux
,lodash
.Examples
I commented the code inside



isImportablePath
to have a hacky prototype.This looks like this :
But a better version would be this (I simply copied the d.ts from the global cache to the
node_modules
) :Today it looks like this (you can reproduce it creating a JavaScript project and installing react-redux) :
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: