-
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
Auto import with wildcard imports with expanded path #51398
Comments
Can you set up a sample repo we can clone? There are a bunch of other factors that go into this we'd need to investigate further |
Thanks for taking your time @RyanCavanaugh! I have provided a simple reproducer repository that showcases the problem: https://github.com/dtdesign/typescript-issue-51398 How to reproduce the issue:
|
Thanks for setting that up - it's much clearer in that form. I haven't cloned this yet, but looking at the tree, it looks like you may need to set your "auto import" preference to "non-relative". AI always prefers names that look like properly-qualified module reference over those that come in via |
I’ve tried both “non-relative” and “project-relative”, but none of them appear to make a difference. In addition, I have repeated the changes, but with a restart of VSCode each time, just to make sure nothing got stuck. The IDE was previously set up with the default value of “shortest”. I have tested the behavior for the same import of |
May I ask if there is anything else I can provide to help you to identify the cause of this issue? |
Reconfirmed the repro on 5.6 |
Does this issue occur when all extensions are disabled?: Yes
Context
We are maintaining TypeScript projects across multiple repositories with one repository being the primary framework that provides the majority of the functionality. For historic reasons we are using an AMD-based module bundler (
require.js
) that expects fully qualified paths for module dependencies.Project Configuration
We are referencing this main project in the
package.json
using a commit id like this:In the
tsconfig.json
we have set up a path wildcard to map references to modules from the primary repository:Observed Behavior
The auto import works, but the generated import expands it to the entire path.
Expected Behavior
Auto imports should be referenced using their full path, but not expanding it to the full path:
It is important to note that the TypeScript compiler will correctly resolve and validate the above dependency. This will also generate valid AMD dependencies that can be resolved by our module bundler.
The text was updated successfully, but these errors were encountered: