All script text following an unclosed quotation mark should be highlighted as a string or object
See original GitHub issueIs your feature request related to a problem? Please describe. In a SQL editor, if you type in an opening quotation mark, either for a string literal (single quote) or a SQL object (double quote or square bracket), everything following that quote is highlighted as if it were code rather than a string or object name until such time as the closing quote is entered.
Describe the solution you’d like When an opening quote is typed, everything between that and the next closing quote (or the end of the script, if none exists) should be highlighted appropriately as either a string or object name.
Describe alternatives you’ve considered This isn’t normally problematic because the closing quotes can be auto-generated at the time the opening quote is entered via preferences. I also have a strict policy of not including carriage returns or linefeeds in my object names 😃
Additional context
String Literal Examples
See comment thread on #11364 for background information. This: should look like this instead: (achieved by adding a closing quote one line below the snipped screenshot)
Object Names
The current behavior is a bit more complicated for object names. Everything following an unclosed quote on a line will be highlighted as code.
But after hitting enter
, the text following the quote is highlighted as if it were an object name, though nothing on the following line is:
Once the closing quote is entered, the entire string is highlighted appropriately:
Same behavior with square brackets:
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Indeed, MSSQL allows this:
verified