-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
From @eodrap on July 21, 2018 16:0
VS Code version: Code 1.25.1 (1dfc5e557209371715f655691b1235b6b26a06be, 2018-07-11T15:33:29.235Z)
OS version: Darwin x64 17.6.0
TypeScript version: 2.9.2
Does this issue occur when all extensions are disabled?: Yes
Steps to reproduce -
- Define path alias in
tsconfig.json
-
"baseUrl": "./",
"paths": {
"@root/*": ["*"]
},
- Restart VS Code
- Trigger auto import by typing a module name and selecting the, 'Auto import from ...' menu entry
- The auto import path offered does not include the alias, a relative path is inserted -
Module pathx/y/z/module.ts
Expected path@root/x/y/z/module.ts
Inserted pathx/y/z/module.ts
Omitting the alias is causing module not found errors.
#39459 suggests this has been resolved but I cannot find a way to include the alias path prefix in auto import suggestions. I've tried setting typescript.preferences.importModuleSpecifier = 'non-relative'
. Apologies if I'm missing a required preference or doing something silly.
Copied from original issue: microsoft/vscode#54798
Venryx
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue