This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Unclosed parentheses in MySQL string breaks highlighting #375
Open
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq
- Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom
- Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages
Description
Failing to close parentheses in a MySQL string causes syntax highlighting to break (it remains in "string" mode).
Steps to Reproduce
- Create a new file with the contents:
<?php // Unclosed parentheses break highlighting echo "SELECT ()"; // This is a comment :) echo "SELECT ( "; // This is a comment? Hack to fix: ")"; // Closing parentheses in different type of quote breaks highlighting echo "SELECT (".")"; // This is a comment :) echo "SELECT (".')'; // This is a comment? Hack to fix: ")";
- Change the syntax highlighting mode to "PHP"
Expected behavior:
- Comments in all four examples should all highlight as comments
- First semicolon in each example should highlight as such
- Closing parenthesis in last example (
echo "SELECT (".')'; ///...
) should highlight as a closing parentheses (or a basic string if saving state between MySQL statements proves difficult) - Period in third and fourth examples should highlight as such
Actual behavior:
- First semicolon and comments in second and fourth example are highlighted as strings
- Closing parenthesis in fourth example is highlighted as a normal string
- Period in third and fourth examples is highlighted as a string
Reproduces how often:
100%
Versions
$ atom --version
Atom : 1.41.0
Electron: 4.2.7
Chrome : 69.0.3497.128
Node : 10.11.0
$ apm --version
apm 2.4.3
npm 6.2.0
node 10.2.1 x64
atom 1.41.0
python 2.7.17rc1
git 2.20.1
OS: Pop!_OS 19.10