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 assigns the wrong TextMate scope to several built-in PHP functions. The following functions are classified as entity.name.function.php instead of their corresponding support.function scope.
hrtime(); //should be support.function.datetime.php
stream_context_set_options(); //should be support.function.streamsfuncs.php
mysqli_connect_error(); //should be support.function.mysqli.php
mysqli_connect_errno(); //should be support.function.mysqli.php
mysqli_affected_rows(); //should be support.function.mysqli.php
mysqli_stmt_error(); //should be support.function.mysqli.php
mysqli_error(); //should be support.function.mysqli.php
mysqli_errno(); //should be support.function.mysqli.php
The issue is that entity.name.function.php means that a function is user defined and might have a different color than support.function.* which is a built-in function. If we indeed use a different color and add similar built-in functions the issue becomes more apparent:
I am not sure I understand what you mean by that. Isn't Atom supposed to be a different code editor than VSCode? Is VSCode using this archived repo to recognize tokens in PHP files? Does this mean that from now on VSCode will not be able to correctly recognize PHP syntax tokens?
Is VSCode using this archived repo to recognize tokens in PHP files?
Precisely haha
now on VSCode will not be able to correctly recognize PHP syntax tokens?
No, since that implies it used to be able to correctly recognize PHP syntax tokens. But also you can get extensions that override the grammar, and you can revive the archived repo by making your own.
Type: Bug
VSCode assigns the wrong TextMate scope to several built-in PHP functions. The following functions are classified as entity.name.function.php instead of their corresponding support.function scope.
hrtime(); //should be support.function.datetime.php
stream_context_set_options(); //should be support.function.streamsfuncs.php
mysqli_connect_error(); //should be support.function.mysqli.php
mysqli_connect_errno(); //should be support.function.mysqli.php
mysqli_affected_rows(); //should be support.function.mysqli.php
mysqli_stmt_error(); //should be support.function.mysqli.php
mysqli_error(); //should be support.function.mysqli.php
mysqli_errno(); //should be support.function.mysqli.php
The issue is that entity.name.function.php means that a function is user defined and might have a different color than support.function.* which is a built-in function. If we indeed use a different color and add similar built-in functions the issue becomes more apparent:
stream_context_set_params(); //correct
stream_context_get_params(); //correct
stream_context_set_options(); //incorrect
stream_context_get_options(); //correct
time(); //correct
microtime(); //correct
hrtime(); //incorrect
sleep(); //correct
usleep(); //correct
mysqli_report(); //correct
mysqli_connect(); //correct
mysqli_query(); //correct
mysqli_fetch_row(); //correct
mysqli_fetch_assoc(); //correct
mysqli_affected_rows(); //incorrect
mysqli_stmt_error(); //incorrect
mysqli_error(); //incorrect
mysqli_errno(); //incorrect
mysqli_stmt_close(); //correct
mysqli_close(); //correct
It seems possible that there are further built-in functions that are misclassified, these are merely the ones that I encountered.
VS Code version: Code 1.80.0 (Universal) (660393deaaa6d1996740ff4880f1bad43768c814, 2023-07-04T13:39:33.766Z)
OS version: Darwin arm64 22.5.0
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Extensions (1)
(1 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: