-
Notifications
You must be signed in to change notification settings - Fork 12.8k
"importModuleSpecifier" ignores "paths" in tsconfig when auto importing #40116
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
Comments
Does this reproduce in the latest VS Code insiders build too? |
Yes it does. |
Duplicate #36235 |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
@Floriferous there’s a lot going on in your repro. What’s the symlink for? Your tsconfig says to exclude the symlink, but include the realpath. Those both refer to the same folder, and the exclude wins, so constants.js is excluded from the program, which is why it doesn’t show up in your auto-import at all.
Suppose you had another file in |
I have 2 conflicting settings, that I wish were making a different compromise:
javascript.preferences.importModuleSpecifier: "relative"
insettings.json
compilerOptions.paths
intsconfig.json
I defined an alias in
paths
, and would like all imports to it to be absolute imports. For the rest of my code, I want to use relative paths. However, when setting both these settings above, autoImport always resolves the aliased path relatively, instead of absolutely.Here's a reproduction: https://github.com/Floriferous/paths-resolution
When you go into
test.js
and try to importsomeVar
, it will only suggest to import it with a relative path. I wonder if this is by design, or if this is something that could be altered?EDIT: This has been happening for a long time, I just decided to open an issue now.
The text was updated successfully, but these errors were encountered: