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
SQL strings are highlighted within PHP strings when that string begins with certain keywords. SQL highlighting can also be "forced" by using a heredoc whose identifier matches [DS]QL. The issue however is that different scopes are evaluated to for the same identifiers between double quoted strings and heredocs.
Steps to Reproduce
$maxId = 10;
$sql = "SELECT d.id FROM my_table d WHERE d.id BETWEEN 1 AND $maxId AND my_custom_func(d.name) > 10";
$sql = <<<SQL SELECT d.id FROM my_table d WHERE d.id BETWEEN 1 AND $maxId AND my_custom_func(d.name) > 10SQL;
Expected behavior: [What you expect to happen]
All symbols within the string should be highlighted the same and with the same scopes.
Actual behavior: [What actually happens]
Instead, several things are highlighted differently between the two types of PHP strings.
Scope inspector for the first my_table:
Scope inspector for the second my_table:
This creates a somewhat jarring experience for the developer when looking at SQL across a codebase. The colors should be the same at the very least.
Reproduces how often: [What percentage of the time does it reproduce?]
100%
Description
SQL strings are highlighted within PHP strings when that string begins with certain keywords. SQL highlighting can also be "forced" by using a heredoc whose identifier matches
[DS]QL
. The issue however is that different scopes are evaluated to for the same identifiers between double quoted strings and heredocs.Steps to Reproduce
Expected behavior: [What you expect to happen]
All symbols within the string should be highlighted the same and with the same scopes.
Actual behavior: [What actually happens]
Instead, several things are highlighted differently between the two types of PHP strings.
Scope inspector for the first
my_table
:Scope inspector for the second
my_table
:This creates a somewhat jarring experience for the developer when looking at SQL across a codebase. The colors should be the same at the very least.
Reproduces how often: [What percentage of the time does it reproduce?]
100%
Versions
VSCode
Version: 1.95.3 (user setup)
Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
Date: 2024-11-13T14:50:04.152Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631
Additional Information
N/A
The text was updated successfully, but these errors were encountered: