-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Prioritise import suggestions from tsconfig alias over external dependencies #31710
Comments
@RyanCavanaugh This issue shows quick fixes specifically but I believe same issue would also apply for auto import suggestions. For quick fixes, VS Code will render them in the order TS Server returns them in. For auto import suggestions, we could explore giving auto imports from local files a higher priority than those from node_modules. |
Any more insight on this? It's a real pain and I'm considering whether I have change my User type to 'AppUser' or something clunky instead. I have a few classes with common names and it's so easy to accidentally import the wrong library. As the auto-suggestion dialog appears, I have to wait a full 1 second or so to confirm the import I want is coming from the correct module. A lot of supporting imports are provided by large libraries like AWS and ag-grid, and I obviously can't exclude them from tsconfig.json... it's a really niggling problem, I've lost count of the errors I've made and it's the only thing stopping my coding from being a perfectly smooth experience. ccing in more recent contibutors... @sandersn |
It's slightly out of scope from original request but I think related. It would be great to be able to specify which node modules take priority over others. For example, I am doing a lot of vue development and when I type |
It seems to me that it should be a no-brainer that the priority order for imports and auto-imports should be:
And this should be regardless the |
I get the following list when auto-suggest kicks in:
I always want to use the @shared alias I defined in my tsconfig file, and there appears to be no way to either omit the unwanted suggestions, or have my aliases be prioritised when auto-suggest/complete kicks in.
The text was updated successfully, but these errors were encountered: