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
Add path alias to the auto import suggestions #20525
BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue
Right now the auto import feature provides the file location of any symbol, which is great but could be improved upon. In the ts compiler options you have the option to provide path aliases, so you can combine multiple symbols in one import declaration:
With this configuration you can import multiple classes in one declaration:
import { CommonA, CommonB } from '@my-application/common';
import { ClassA, ClassB, ClassC } from '@my-application/module1';
import { ClassD, ClassE } from '@my-application/module2';
It would be a great feature if the import suggestion provider would be able to pick up those paths from the tsconfig.json file and provide those aliases as well. Maybe the provider could have a configuration that allows you to include both options (the local file path and the alias) or just one or the other. As a note, when choosing the alias, the import feature would have to add the symbol to any existing declaration (and not just always add the alias as a new import line)
BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue
Activity
mjbvz commentedon Dec 7, 2017
Tested with TS 2.6.2 and 2.7-dev-20171203. Confirmed that auto imports do not seem to ever show suggestions that use the
paths