#725 Backslash causes Scintilla to not highlight keywords

Feature_Request
closed-wont-fix
Neil Hodgson
Scintilla (788)
2
2008-10-22
2008-09-09
Anonymous
No

When editing a SQL file, if there is a backslash before the quotation marks, SciTE (also Notepad2) ignores the quotation marks and treat the character after the quotation marks as part of the string, so we get no syntax highlighting for the commands after the string:

SELECT "hello\" FROM DUAL;

the "FROM DUAL" appears as part of the string, and it shouldn't since FROM is a SQL command not inside a string.

I was told that this is a Scintilla issue, and the editor cannot handle it, unless Scintilla get fixed it.

I use Oracle as my Database.

Discussion

  • Jason Oster
    Jason Oster
    2008-09-09

    Scintilla is treating the \" as an escaped double quote. This is by design, for [example] MySQL syntax. But this seems to be non-standard syntax supported by MySQL. Doubling quote characters (or using the special ESCAPE clause) seems to be the more widely accepted method of escaping text in SQL statements.

     
  • So, do you think the "by design" feature could be expanded to support the widely accepted method like doubling?
    and being able to disable the \ as escaping character? Currently it can be an error prone process to edit Oracle SQL files using Scintilla, since active commands will look like parts of strings - extremely confusing. Other editors do not have this issue.

     
  • Neil Hodgson
    Neil Hodgson
    2008-09-10

    Standard SQL only allows the use of single quotes for strings and uses double quotes for quoted identifiers. It would probably be reasonable to extend sql.backslash.escapes to behave the same with double quotes as with single quotes. I won't be working on this - lexer modifications are normally done by someone who benefits from the change.

     
  • Neil Hodgson
    Neil Hodgson
    2008-09-10

    • milestone: --> Feature_Request
    • priority: 5 --> 2
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-wont-fix
     
  • But is there a way to change it, so the \ will not be used as an escape character ?
    If so, where can I do it, I can take a look at the code.

     
  • Neil Hodgson
    Neil Hodgson
    2008-10-22

    • status: open-wont-fix --> closed-wont-fix