Keyword `$this` not correctly highlighted in interpolated php strings
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
In interpolated php strings the `$this` keyword is highlighted differently depending on the syntax used: `"{$this->name}"` vs `"$this->name"`. Both should use darker blue color.
Steps to Reproduce:
1. Paste text in a file, ensure file type is PHP
```php
name}\n";
echo "2 Name: $this->name\n";
echo "3 Name: {$this}\n";
echo "4 Name: $this\n";
echo '5 Name: ' . $this->name . "\n";
echo '6 Name: ' . $this . "\n";
}
public function __toString(): string {
return $this->name;
}
}
```
2. See difference in how `$this` is highlighted:
VS Code version: Code - Insiders 1.134.0-insider (f844934f854c9277a48627aac77ebcea69591ae1, 2026-08-11T22:56:11Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz (8 x 3691)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x11fa [NVIDIA Quadro K4000], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=10.18.13.5362 *ACTIVE*
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.5794
Machine model name:
Machine model version:
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
trees_in_viz: disabled_off
video_decode: enabled
video_encode: unavailable_off
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|31.95GB (10.28GB free)|
|Process Argv|--crash-reporter-id 59c38a97-6b20-42ad-b729-8c40ade347e9|
|Screen Reader|no|
|VM|0%|
Extensions: none
A/B Experiments
```
vsliv368:30146709
pythonvspyt551:31249597
nativeloc1:31118317
dwcopilot:31158714
dwoutputs:31242946
copilot_t_ci:31333650
g012b348:31231168
pythonrdcb7:31268811
pythonpcpt1:31399616
6518g693:31302842
4f60g487:31327383
envsactivate1:31349248
editstats-enabled:31346256
cloudbuttont:31366566
3efgi100_wstrepl:31403338
839jf696:31457053
cp_cls_t_966_ss:31526232
4je02754:31455664
8hhj4413:31478653
cp_cls_t_1081:31454832
conptydll_true:31485575
e9c30283:31453065
test_treatment2:31471001
46204921:31447328
ei9d7968:31462942
de16b994:31458079
7e884298:31462391
h08i8180:31475367
ddid_c:31478205
hmra_i5g22:31518061
bjc72774_agent_sandbox:31538428
7df3h592:31491241
cp_cls_t_1082:31535311
logging_enabled_new:31490725
jb_cp_cls_t_632:31543129
b1g4i769:31503653
ha629193:31508444
cdk-lw-on:31524445
a1ije391_t:31533808
hgf2d445:31510900
jbcp_cls_pctr_t:31531130
cp_intellij_t_nes:31548657
gf14b233:31526830
hide-eh-duplicates:31543293
replace-eh-with-ah:31545853
ihg5j128:31534457
f412h606:31543414
enable_editor_pane_layout:31551200
52258b4d:31547953
36h42362:31560305
c7c27ce7:31551212
6577i413_copy:31558653
1h923230:31564177
1532g621_copy:31554310
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0c1h4866:31562347
vrbsty_tr:31561056
cch_brk_fls:31561679
4553j735_t_off:31561845
be7id924_c:31561848
5b8j3302:31564600
atk_rai_validation_enable:31565114
```
Contributor guide
Assessment
This issue has not been assessed yet.