Skip to content

Incorrect Token Scoping for ⁠defer Keyword in TypeScript 5.9 in VSCode #1058

@jinyongp

Description

@jinyongp

Type: Bug

With the release of TypeScript 5.9, a new feature supporting the ⁠import defer functionality has been introduced. However, when using VSCode's "Developer: Inspect Editor Tokens and Scopes" to inspect the ⁠defer keyword, it is currently scoped as ⁠variable.other.readwrite.alias.ts instead of the expected ⁠import.control.defer.ts. This issue prevents the proper application of style changes using TextMate.
It seems that the ⁠defer keyword should be correctly scoped under the ⁠import.control.defer.ts range as mentioned above.
Thank you.

VS Code version: Code 1.103.0 (e3550cfac4b63ca4eafca7b601f0d2885817fd1f, 2025-08-06T21:40:10.271Z)
OS version: Darwin arm64 24.6.0
Modes:

System Info
Item Value
CPUs Apple M2 Pro (10 x 2400)
GPU Status 2d_canvas: enabled
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: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 16.00GB (1.27GB free)
Process Argv --crash-reporter-id 02ee976f-ec4c-41ed-91a6-793656140857
Screen Reader no
VM 0%
Extensions disabled
A/B Experiments
vsliv368:30146709
vswsl492:30256859
pythonvspyt551:31249599
binariesv615:30325510
vscrp:30673768
nativeloc1:31344060
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
c7cif404:31314491
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
0aa6g176:31307128
747dc170:31275177
aj953862:31281341
pylancequickfixf:31358881
9d2cg352:31346308
convertlamdaf:31358879
usemarketplace:31343026
nesew2to5:31336538
1292j425:31332164
agentclaude:31350858
replacestringexc:31350595
nes-set-on:31351930
testaa123cf:31335227
6abeh943:31336334
yijiwantestdri0626-c:31336931
0927b901:31350571
4gdec884:31348710
45650338:31358607
0cj2b977:31352657
gaj49834:31362110
asdad-cf:31365767
showgoogle:31363597

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions