Auto-import priority rules
# Suggestion It seems there are many folks struggling with the priority/ordering of VSCode's auto-import (intellisense) suggestions. There are a few different cases, but they seem to be all somewhat related to the general theme of how these suggestions are prioritized. - My specific case is that when coding in Vue, the import of `watch` from `fs` is always prioritized over `vue` (/cc @cabal95) - Others have issues with code from external modules being prioritized over code defined within their repo - Others have issues related to preferring aliases defined in their tsconfig - Many edge cases around specific paths suggested when dealing with monorepos... It would be fantastic if VSCode provided a way to override the priority but it seems that TypeScript's language server suggestions could use some tweaking regardless. ## ⭐ Suggestion Seems like a fairly reasonable priority would be: - code found within the repo/module (preferring aliased paths if they exist, probably preferring "closer" imports over further away in the tree?) - code found in other repos/modules defined locally within a monorepo (again preferring aliases) - code found in _explicit_ dependencies found in package.json - code found in node internals (ex: `fs`, `path`) --- ## 🔍 Search Terms import priority prioritize prioritise auto-import vscode intellisense ## 🔗 Related Issues open - https://github.com/microsoft/TypeScript/issues/31710 - https://github.com/microsoft/TypeScript/issues/43352 closed - ht
Posted by theoephraim on Oct 12, 2022, 8:36 PM
Tags
Related issues
- Custom games stuck on "finding server" for all european servers
- Feature request: add ACP (Agent Client Protocol) stdio JSON-RPC mode
- Forza Horizon 6 (2483190)
- Turn off integrated browser for default
- Weekly updates are too frequent
- [BUG] Max 20x plan: 100% usage after 2 hours of light work (5 commits, no agents)
Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments
github (Sysadmin)
Custom games stuck on "finding server" for all european servers
Feature request: add ACP (Agent Client Protocol) stdio JSON-RPC mode
Forza Horizon 6 (2483190)
Turn off integrated browser for default
Weekly updates are too frequent
[BUG] Max 20x plan: 100% usage after 2 hours of light work (5 commits, no agents)
Add gemini-3.1-pro-preview
[TF2] Feature request: Bring Back Quickplay
Auto-import priority rules
# Suggestion It seems there are many folks struggling with the priority/ordering of VSCode's auto-import (intellisense) suggestions. There are a few different cases, but they seem to be all somewhat related to the general theme of how these suggestions are prioritized. - My specific case is that when coding in Vue, the import of `watch` from `fs` is always prioritized over `vue` (/cc @cabal95) - Others have issues with code from external modules being prioritized over code defined within their repo - Others have issues related to preferring aliases defined in their tsconfig - Many edge cases around specific paths suggested when dealing with monorepos... It would be fantastic if VSCode provided a way to override the priority but it seems that TypeScript's language server suggestions could use some tweaking regardless. ## ⭐ Suggestion Seems like a fairly reasonable priority would be: - code found within the repo/module (preferring aliased paths if they exist, probably preferring "closer" imports over further away in the tree?) - code found in other repos/modules defined locally within a monorepo (again preferring aliases) - code found in _explicit_ dependencies found in package.json - code found in node internals (ex: `fs`, `path`) --- ## 🔍 Search Terms import priority prioritize prioritise auto-import vscode intellisense ## 🔗 Related Issues open - https://github.com/microsoft/TypeScript/issues/31710 - https://github.com/microsoft/TypeScript/issues/43352 closed - ht
Comments (0)
No comments yet. Start the discussion.