-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide Intellisense for module import #2153
Comments
We have around 25k lines of Typescript with hundreds of Typescript modules, and we use CommonJS style module imports. Not having Intellisense for module import as described here is the main reason why we don't use VS Code. Would be really nice if you can add this (or push the Typescript team to provide it on a language service level :) ) |
👍 |
This is actually a feature that has to come from the tsserver. |
This issue was moved to microsoft/TypeScript#10092 |
TypeScript module exports can be fairly opaque in regard to their exports. Particularly when modules grow bigger.
With bigger modules (particularly with modules exporting other modules' exports) it becomes very hard to see which entities a module actually is exporting.
So I suggest to provide an Intellisense feature for module imports, which
#### The first part of the suggestion I propose to work like `LINQ`:
After entering the keyword
from
and hitting the [TAB] key, a file browser dropdown should be displayed, listing all valid module files. After confirming a file from the dropdown box, VS Code should automatically create a fullimport {} from "[...]"
statement, move the cursor position between the curly braces and display a dropdown box listing all the exports of that module.Here's a visualization:
#### The second part of the suggestion I propose to work like common Intellisense:
Everytime when hitting [CTRL]+[SPACE] from within the curly braces of an
import
statement, dropdown box (2) should be displayed, listing the module's exported entities. Selecting an entry should then add the selected export entity to the list of already imported entities within the curly braces.The text was updated successfully, but these errors were encountered: