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 #39459
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)
Activity
mjbvz commentedon Dec 7, 2017
This issue was moved to microsoft/TypeScript#20525