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
VSCode's JS intellisense can't handle the expression
constv=await(awaitfn1()).method2()
Repo
class Banana { }
class BananaTree {
async requestBanana() {
return new Banana();
}
}
async function requestBananaTree() {
return new BananaTree();
}
const banana1 = await (await requestBananaTree()).requestBanana();
const tree = await requestBananaTree();
const banana2 = await tree.requestBanana();
If you hover over banana2 you'll see it says const banana2: Banana. But if you hover over banana1 it says const banana1: any even though those are equivalent statements in JavaScript itself.
Is that a known issue?
VS Code version: Code 1.100.2 (Universal) (848b80a, 2025-05-14T21:47:40.416Z)
OS version: Darwin arm64 24.5.0
Modes:
The text was updated successfully, but these errors were encountered:
greggman
changed the title
await (await fn).method() gets wrong type in intellisense
await (await fn()).method() gets wrong type in intellisense
May 30, 2025
Type: Bug
VSCode's JS intellisense can't handle the expression
Repo
If you hover over
banana2
you'll see it saysconst banana2: Banana
. But if you hover overbanana1
it saysconst banana1: any
even though those are equivalent statements in JavaScript itself.Is that a known issue?
VS Code version: Code 1.100.2 (Universal) (848b80a, 2025-05-14T21:47:40.416Z)
OS version: Darwin arm64 24.5.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Extensions (26)
(1 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: