mytskine opened a new issue, #4789: URL: https://github.com/apache/netbeans/issues/4789
### Apache NetBeans version Apache NetBeans 15 ### What happened Netbeans fails to detect SQL strings that are written using PHP's heredoc syntax. Netbeans tries to guess if a PHP string is a SQL query, so that completion within the string can use the database connection. This works for plain string, with single or double quotes. It also works for nowdoc strings, i.e. using delimiters like `<<<'EOSQL'\n ...\nEOSQL`. But I've never seen it work with heredoc strings, i.e. using delimiters like `<<<"EOSQL" ... EOSQL` or just `<<<EOSQL ... EOSQL`. This bug was not introduced recently, because I've using this feature since at least Netbeans 12, on several computers. I looked at the code in `SQLStatement.java`, but it handles nowdoc and heredoc in the exact same way, so the problem is not there, and I'm not proficient enough with Java to fix it by myself. ### How to reproduce In a PHP project with a DB connection defined, create a new file containing: ```php <?php // completion OK $q = <<<'EOSQL' select * from [caret is here] EOSQL; ``` The completion (ctrl-space) works. Now remove the single quotes. The string is unchanged, but Netbeans' behaviour is changed. ```php <?php // completion broken $q = <<<EOSQL select * from [caret is here] EOSQL; ``` The completion (ctrl-space) should work, but it does not. Same probem with: ```php <?php // completion broken $q = <<<"EOSQL" select * from [caret is here] EOSQL; ``` ### Did this work correctly in an earlier version? No / Don't know ### Operating System Linux Debian ### JDK Oracle JRE 8, then Debian OpenJDK 8, then Debian OpenJDK 11 ### Apache NetBeans packaging Apache NetBeans provided installer ### Anything else _No response_ ### Are you willing to submit a pull request? No ### Code of Conduct Yes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
