Hi!
I'm following and using this great editor since many years. But I'm afraid because '#' character continues present at SQL lexer sa a line comment (which is false almost in Oracle). It's possible modify this?
To disable the '#' as a comment start, someone would have to implement an option in the LexSQL code. Since I do not use SQL currently, I will not be working on this myself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, thanks for your answer.
Can you modify 'scintilla/lexers/LexSQL.cxx' to include this:
(in function "ColouriseSQLDoc")
bool sqlNumbersignComment = styler.GetPropertyInt("sql.numbersign.comment", 1) != 0;
(change )
} else if (sc.ch == '#') {
(to this)
} else if (sc.ch == '#') && sqlNumbersignComment {
This modification rely on new parameter "sql.numbersign.comment" that means:
0 = # is a valid comment (for MySQL and others)
1 = # isn't a valid comment (for Oracle and similar databases)
I hope the effect with this new parameter will be the same until now. Without this parameter Scite should recognize "#" as a comment.
What do you think? I'm right or wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi another time!
I want bring to you a possible solution for this:
(in "ColouriseSQLDoc" function of "LexSQL.cxx" add:)
// If "sql.numbersign.comment" Scite property is set to 0 a line beggining with '\#' will be a comment.boolsqlNumbersignComment=styler.GetPropertyInt\("sql.numbersign.comment",1\)\!=0;
(few lines later in same function, replace:)
} else if (sc.ch == '#') {
(with:)
// Oracle and others doesn't recognize '#' as a comment:
} else if (sc.ch == '#' && sqlNumbersignComment) {
(in "*propertiesToForward" structure of "SciteProps.cxx" add:)
"sql.numbersign.comment",
(in "knownIrregularProperties" array of "LexGen.py" add:)
"sql.numbersign.comment",
(in "sql.properties" add:)
# Activate '#' based comments for MySQL with 1 or disable for Oracle with 0:
sql.numbersign.comment=1
I hope this helps!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Committed but with the name changed to lexer.sql.numbersign.comment since properties that start with lexer.<lexerName> will be automatically found by the scripts that update SciteProps.cxx and SciTEDoc.html.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To disable the '#' as a comment start, someone would have to implement an option in the LexSQL code. Since I do not use SQL currently, I will not be working on this myself.
Ok, thanks for your answer.
Can you modify 'scintilla/lexers/LexSQL.cxx' to include this:
(in function "ColouriseSQLDoc")
bool sqlNumbersignComment = styler.GetPropertyInt("sql.numbersign.comment", 1) != 0;
(change )
} else if (sc.ch == '#') {
(to this)
} else if (sc.ch == '#') && sqlNumbersignComment {
This modification rely on new parameter "sql.numbersign.comment" that means:
0 = # is a valid comment (for MySQL and others)
1 = # isn't a valid comment (for Oracle and similar databases)
I hope the effect with this new parameter will be the same until now. Without this parameter Scite should recognize "#" as a comment.
What do you think? I'm right or wrong?
Hi another time!
I want bring to you a possible solution for this:
(in "ColouriseSQLDoc" function of "LexSQL.cxx" add:)
(few lines later in same function, replace:)
} else if (sc.ch == '#') {
(with:)
// Oracle and others doesn't recognize '#' as a comment:
} else if (sc.ch == '#' && sqlNumbersignComment) {
(in "*propertiesToForward" structure of "SciteProps.cxx" add:)
"sql.numbersign.comment",
(in "knownIrregularProperties" array of "LexGen.py" add:)
"sql.numbersign.comment",
(in "sql.properties" add:)
# Activate '#' based comments for MySQL with 1 or disable for Oracle with 0:
sql.numbersign.comment=1
I hope this helps!
Committed but with the name changed to lexer.sql.numbersign.comment since properties that start with lexer.<lexerName> will be automatically found by the scripts that update SciteProps.cxx and SciTEDoc.html.
Perfect! Thank you for your fast answer. Regards.