You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File extensions in import autocomplete suggestions #42157
With javascript.preferences.importModuleSpecifierEnding set to "js":
Given a file ./foo.js that exports foo, typing
importfoofrom "./
brings up a suggestion for ./foo, without the extension.
In contrast, simply typing foo and letting auto import do the work correctly adds
importfoofrom"./foo.js";
at the top of the file, respecting the setting value.
This seems odd, especially considering that in most cases with ES modules specifying the extension isn't optional.
Also: if foo has mjs extension, it's not suggested at all (#27957). However its exports still appear as auto import suggestions, and selecting them does nothing (besides producing an 'unknown extension' error).
This seems reasonable to me, looks like we’d want to pass the preferences in stringCompletions.ts all the way down into getCompletionEntriesForRelativeModules and use that preference in the getExtensionOptions() call.
Activity
andrewbranch commentedon Dec 30, 2020
This seems reasonable to me, looks like we’d want to pass the
preferencesin stringCompletions.ts all the way down intogetCompletionEntriesForRelativeModulesand use that preference in thegetExtensionOptions()call.andrewbranch commentedon Jan 4, 2021
Duplicate of #39155
typescript-bot commentedon Jan 7, 2021
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.