This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Code formatting, folding and bracket matching | ||
---|---|---|---|
Product: | db | Reporter: | Roman Mostyka <romanmostyka> |
Component: | SQL Editor | Assignee: | Libor Fischmeistr <lfischmeistr> |
Status: | NEW --- | ||
Severity: | blocker | CC: | davidvc, javatlacati, nbphpuser |
Priority: | P3 | Keywords: | NETFIX |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 193557 | ||
Bug Blocks: | |||
Attachments: |
add bracket matching
add SQL-99 escape handling to lexer |
Description
Roman Mostyka
2008-12-10 17:37:44 UTC
Reassigned to new owner. *** Bug 146553 has been marked as a duplicate of this bug. *** *** Bug 185452 has been marked as a duplicate of this bug. *** Created attachment 119649 [details]
add bracket matching
Created attachment 119650 [details]
add SQL-99 escape handling to lexer
The last two patches can only be applied after the changes started in bug #193557 are applied. I'll have a look at code formatting next. I've tested the proposed bracket matching, and it seems to contain a bug. If SQL editor contains a word whose first and last letters are the same (e.g. "samples"), and the cursor is at the beginning or end of the word, this pair of letters is highlighted (I guess it is not intentional). Why have you decided to implement a custom bracket matcher? Do you think the the default one is not sufficient (http://hg.netbeans.org/core-main/rev/dbca6e992987)? I think that escape handling is a non-standard feature of MySQL (if I am wrong please correct me). Cannot it cause problems when writing SQL for other databases? Thank you very much. Hey, thanks for your feedback! Your right there is a bug in the bracket matcher. The bracket matching differs in the respect, that different things are matched. I intended this behavior: - match round brackets outside identifiers and strings - match quoting characters: - ' for strings - `" and the pair [] for identifiers The changed quote handling in the lexer is correct for the SQL-99 standard. There is no backslash to escape special meaning, but doubling the character to be protected (which is only the used quoting symbol). See http://savage.net.au/SQL/sql-99.bnf.html#doublequote%20symbol and http://savage.net.au/SQL/sql-99.bnf.html#quote%20symbol Before any of the two patches can be applied, they need another round (please give some feedback, if your interested). The backet matched needs to be bugfixed and the lexer change should get another fix to mark partly quoted identiefiers as errors (same as the string error marking). The lexer change is needed, because else a structure like "'identifier''with_embedded_quotes'" is cut into two tokens: "'identifier'" and "'with_embedded_quotes'" which is wrong. In the current situation the token sequence is mainly used for syntax highlighting, in which this is not a problem, but the correct token would be the complete sequence "'identifier''with_embedded_quotes'". Comment on attachment 119650 [details] add SQL-99 escape handling to lexer Moved patch to bug #183478 (it does not really belong here) http://hg.netbeans.org/core-main/rev/bc7d23461f89 The patch was applied. Thank you, Matthias! Integrated into 'main-golden', will be available in build *201302132300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/bc7d23461f89 User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #155167: Braces matcher for SQL editor Because I was just wondering whether this can be closed - remaining are: - Code folding - Code formating Both depend on a sql parser - at least at the current point I don't see another coherent possibility with structural knowledge. *** Bug 257354 has been marked as a duplicate of this bug. *** |