-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add file extensions when auto-completing import paths #19019
Copy link
Copy link
Closed
Labels
Domain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Metadata
Metadata
Assignees
Labels
Domain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
From @Rich-Harris on October 6, 2017 14:58
Steps to Reproduce:
import x from './followed by the name of a sibling fileReproduces without extensions: Yes
When you start writing a local
importstatement, the intellisense helper will offer upfooandbarrather thanfoo.jsandbar.js. Extensionless imports is a Node idiom that is incompatible with browser module loaders — adding the file extension would increase browser compatibility with no ill-effect on Node apps (to the contrary, it speeds up module resolution, and I'd argue it makes code more explicit and readable).I wonder if you would consider changing the behaviour to add file extensions by default?
Copied from original issue: microsoft/vscode#35730