-
Notifications
You must be signed in to change notification settings - Fork 12.8k
importModuleSpecifierEnding does not apply for module specifier completions (manual imports) #39155
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
This should be transferred to the TypeScript repo when someone gets to it. |
Still needs microsoft/TypeScript#39155 though :(
See #42157 for a description of how to fix this |
@andrewbranch Hi there, you said that in #42157 that
I'm wondering if you could elaborate more on what I'm supposed to do with preference in the Sorry if this is a dumb question, it's my first time doing open source. |
- const extensions = getExtensionOptions(compilerOptions);
+ const extensions = getExtensionOptions(compilerOptions, preferences.importModuleSpecifierEnding === "js"); |
@andrewbranch I was doing some debugging thanks to your article and I found that the |
I believe VS Code passes along whichever one is relevant based on what kind of file you're currently editing. |
…le specifier completions) (#42467) * Pass preferences down to getCompletionEntriesForRelativeModules * Add preferences to getExtensionsOptions call * Add test case * Fix test case typos
I am still having this problem. |
Me too. Whenever I move a file, I have to update all imports because VS Code rewrites the imports to the new path. During that process the |
@andrewbranch Thanks! Can't wait until this is released. |
This issue was about path completions (you are typing in the module specifier of an import declaration). #50710 is about the Move To New File functionality, which adds and updates imports as part of moving the declaration. What we usually call “auto imports” is yet another thing. |
Right! Sorry it was a long day 😅 The issue I encounter is: And I just found out why this happens only in certain parts of my application. I have set |
Could be it. Thanks for your help! |
A while back, the
importModuleSpecifierEnding
preference was added to specify the preferred path ending for auto imports (see microsoft/vscode#90405).While this seems to work with auto imports (i.e. referencing an export of another file and letting the editor perform module importing automatically), it does not work with path completions when typing the import statement manually.
Actual Behavior:
Expected Behavior:
Steps to Reproduce:
javascript.preferences.importModuleSpecifierEnding
to"js"
Expected Behavior:
The file chosen from the suggestions list should have the ".js" extension.
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: