-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 #10092
Comments
From @atifsyedali on March 2, 2016 20:39 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 :) ) |
From @Haemoglobin on July 16, 2016 8:58 👍 |
This is actually a feature that has to come from the tsserver. |
Not quite a dupe, as #2371 is about changing the syntax, whereas this issue is about providing a list of exported symbols recursively. Shouldn't be too complex. First implementation iteration:
|
#188 provides completions for module names and I am not too crazy about typing |
Thanks, Mohamed, yes, the typescript-hero VS Code extension seems to be right the thing I've been looking for. Thanks for sharing this link with me! 😀 👍 Cheers, /cc: @dbaeumer |
@waderyan no not exactly the same. He has a nice suggestion of using snippets to create import statements. The major problem is that if write a new import statement then you do |
this should be covered by #7849 |
From @SetTrend on January 21, 2016 14:56
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.Copied from original issue: microsoft/vscode#2153
The text was updated successfully, but these errors were encountered: