dragnilar / Databvase

A (sorta) lightweight query tool for MS Sql Server that makes usage of DevExpress to provide a rich user interface
3 stars 1 forks source link

Syntax Highlighting Does Not Parse Comments As Well As SSMS #4

Closed dragnilar closed 6 years ago

dragnilar commented 6 years ago

Syntax highlighting is currently being handled by a regex to just "make it work". This isn't really the most ideal solution as there are various scenarios that it doesn't cover. For example, you can have:

/* select * from sometable 
-- where somevalue = '' 
*/

The syntax highlighting may not work correctly in this scenario.

It would be ideal to possibly replace this with a true SQL parser to get the most SSMS like experience.

dragnilar commented 6 years ago

One possible solution would be to switch out the DX Rich Text Edit with AvalonEdit.

However if this were to be done, the pop up menu and various other aspects surrounding the Query Text Editor would have to be change significantly, especially since AvalonEdit is a WPF control and thus will not play "nicely" with the DX Windows Forms controls.

Internal testing HAS shown though that AvalonEdit provides much better syntax highlighting support in addition to performance.

dragnilar commented 6 years ago

This will possibly be resolved with implementing https://github.com/dragnilar/Databvase/issues/32

dragnilar commented 6 years ago

5bafb914 - This has been handled by getting rid of QueryTextEditor (which is a DevExpress RichTextEdit) and replacing it with Scintilla.NET.

The syntax highlighting is now much better and as a result comments are displayed more accurately thanks to Scintilla's SQL Lexer.