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.

Bug 193557

Summary: SQL highlight incorrect
Product: db Reporter: gholmer <gholmer>
Component: SQL EditorAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED FIXED    
Severity: normal Keywords: NETFIX
Priority: P3    
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 155167    
Attachments: screenshot
screenshot #1
screenshot #2
proposed patch v1
proposed patch v1 - part 2 - further cleanup
proposed patch v2

Description gholmer 2010-12-17 18:22:43 UTC
[ BUILD # : 201012150001 ]
[ JDK VERSION : 1.6.23 ]

SQL highlighting is sometimes incorrect -- see attached screenshot.
Comment 1 gholmer 2010-12-17 18:23:26 UTC
Created attachment 104225 [details]
screenshot
Comment 2 Jiri Rechtacek 2010-12-21 10:30:37 UTC
I can see this problem, probably depends on editor's infrastructure, will be consult with editor team.
Comment 3 Jiri Rechtacek 2011-03-04 10:39:15 UTC
I'm not able to reproduce it in recent builds. Probably fixed in editor. Reopen if it's appears again. Thanks
Comment 4 gholmer 2012-04-24 15:46:42 UTC
Reopened with repro case against 201204240400 (see screenshots).

1) Enter SQL in first screenshot ("select signup...") and run. Comment out and put different SQL ("select * from event") and run.

2) Remove second SQL statement and uncomment first one. Text remains grey as if a comment.
Comment 5 gholmer 2012-04-24 15:47:09 UTC
Created attachment 118698 [details]
screenshot #1
Comment 6 gholmer 2012-04-24 15:47:29 UTC
Created attachment 118699 [details]
screenshot #2
Comment 7 matthias42 2012-04-24 18:00:04 UTC
*** Bug 210011 has been marked as a duplicate of this bug. ***
Comment 8 matthias42 2012-05-17 20:24:18 UTC
Created attachment 119585 [details]
proposed patch v1

The attached fix switches from a custom editor kit to the new editor infrastructure:

- the SQLSyntax is replaced by directly using the already present SQLLexer and registering that as a language provider for mime-type text/x-sql. 

- the quoting help is replaced by a TypedTextInterceptor registered for mime-type text/x-sql. 

- the ident engine was removed completly, as I could not see any usable functionality. It should/will be replaced with patches in bug 155167

In my tests this fixes Glens test-case.
Comment 9 matthias42 2012-05-17 20:25:10 UTC
Created attachment 119586 [details]
proposed patch v1 - part 2 - further cleanup
Comment 10 matthias42 2012-05-19 20:43:36 UTC
Created attachment 119648 [details]
proposed patch v2
Comment 11 Jaroslav Havlin 2012-05-21 15:23:52 UTC
Great job, thank you, Matthias.

Just a detail, it seems that the change causes a tiny regression.
Can I change INCOMPLETE_STRING("sql-string-literal")
to INCOMPLETE_STRING("sql-errors"), so that incomplete string literals are still marked as errors (underlined)?
Comment 12 matthias42 2012-05-21 18:24:45 UTC
Yes your right - I could reproduce the problem and your proposed change fixed that. Please go ahead - thanks for catching that!
Comment 13 Jaroslav Havlin 2012-05-22 15:25:07 UTC
http://hg.netbeans.org/core-main/rev/fd99cc5effc5
Patch applied. Thank you again!
Comment 14 Quality Engineering 2012-05-24 05:31:07 UTC
Integrated into 'main-golden', will be available in build *201205240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/fd99cc5effc5
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #193557 - SQL highlight incorrect