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
Although TypeScript support is an extension, technically, I could not find a separate repository for it, so I'm submitting here as support is built-in. I can post elsewhere if this is the wrong place.
Since upgrading to 1.60, TypeScript IntelliSense has become very overzealous in wanting to use non-relative paths when auto-importing, to a point where auto-import is now completely unusable in my project. It seems the auto-import greatly prefers to use non-relative paths, particularly path aliases, whenever possible, completely ignoring my settings for relative-ity of auto-imports.
This issue appears on two separate VSCode installs, one on Windows 10 (this one) and one on Ubuntu 20.04.
And my index.ts in each directory has export * from "./thing1A" and export * from "./thing2A".
When editing thing1A.ts and attempting to auto-import modules:
From another package: uses package name ✔️
From dirA/thing2A.ts: uses ~/dirA ❌ (this should be ./thing2A)
From dirB/index.ts: uses ~/dirB ✔️
From dirB/thing1B.ts: uses ../dirB/thing1B ❌ (this would be the correct place for the ~, why does it do relative imports here!?)
It almost seems like some logic got inverted somewhere for deciding when to use path aliases.
I have also tried every possible option of javascript.preferences.importModuleSpecifier and typescript.preferences.importModuleSpecifier, but none of them are any different, including the new project-relative.
On the plus side, path aliases didn't work at all for me in 1.59, so this is nice to see it's been worked on.
VS Code version: Code 1.60.2 (7f6ab5485bbc008386c4386d08766667e155244e, 2021-09-22T12:00:31.514Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
System Info
Item
Value
CPUs
Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (6 x 3192)
I believe this was fixed by #47516, which was released in 4.6. I’ll throw up a regression test for it since I just wrote one, thinking this was still a bug.
Issue Type: Bug
Although TypeScript support is an extension, technically, I could not find a separate repository for it, so I'm submitting here as support is built-in. I can post elsewhere if this is the wrong place.
Since upgrading to 1.60, TypeScript IntelliSense has become very overzealous in wanting to use non-relative paths when auto-importing, to a point where auto-import is now completely unusable in my project. It seems the auto-import greatly prefers to use non-relative paths, particularly path aliases, whenever possible, completely ignoring my settings for relative-ity of auto-imports.
This issue appears on two separate VSCode installs, one on Windows 10 (this one) and one on Ubuntu 20.04.
Here's a setup with an example:
The TSConfig has this:
And my
index.ts
in each directory hasexport * from "./thing1A"
andexport * from "./thing2A"
.When editing
thing1A.ts
and attempting to auto-import modules:dirA/thing2A.ts
: uses~/dirA
❌ (this should be./thing2A
)dirB/index.ts
: uses~/dirB
✔️dirB/thing1B.ts
: uses../dirB/thing1B
❌ (this would be the correct place for the~
, why does it do relative imports here!?)It almost seems like some logic got inverted somewhere for deciding when to use path aliases.
I have also tried every possible option of
javascript.preferences.importModuleSpecifier
andtypescript.preferences.importModuleSpecifier
, but none of them are any different, including the newproject-relative
.On the plus side, path aliases didn't work at all for me in 1.59, so this is nice to see it's been worked on.
VS Code version: Code 1.60.2 (7f6ab5485bbc008386c4386d08766667e155244e, 2021-09-22T12:00:31.514Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: