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
Currently, PHP strings are highlighted as nested SQL when the string begins with one of the following: SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND|WITH
That list seems somewhat restrictive. My suggestion would be to add in at least WHERE and keyword variations related to JOINs with optional prefixing keywords that specify the type of join. Something like: (FULL|LEFT|RIGHT)?\s+(INNER|OUTER|CROSS)?\s+JOIN (not even going to pretend this is correct or covers all cases).
Steps to Reproduce
$sql = 'SELECT * FROM my_table a ';
$sql .= 'JOIN my_table b ON b.id = a.parent_id ';
$sql .= 'WHERE a.key = \'MY_KEY\'';
Expected behavior: [What you expect to happen]
I'd expect it to work just like how it does if the string starts with AND or how the initial setting of the $sql variable appears.
$sql = 'SELECT * FROM my_table a WHERE a.key = \'MY_KEY\'';
$sql .= 'AND a.parent_id = 3';
Actual behavior: [What actually happens]
Reproduces how often: [What percentage of the time does it reproduce?]
100%
Description
Currently, PHP strings are highlighted as nested SQL when the string begins with one of the following: SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND|WITH
That list seems somewhat restrictive. My suggestion would be to add in at least WHERE and keyword variations related to JOINs with optional prefixing keywords that specify the type of join. Something like:
(FULL|LEFT|RIGHT)?\s+(INNER|OUTER|CROSS)?\s+JOIN
(not even going to pretend this is correct or covers all cases).Steps to Reproduce
Expected behavior: [What you expect to happen]
I'd expect it to work just like how it does if the string starts with AND or how the initial setting of the $sql variable appears.
Actual behavior: [What actually happens]
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: