Open marcpley opened 2 weeks ago
Functions Editor, Collations Editor, Code Snippets - in all these it does not work (at least I checked these). Apparently bracket pair highlighting feature is somehow not active there. Let's keep this issue to track it.
It works here:
../guiSQLiteStudio/windows/editorwindow.ui
line 50
<widget class="SqlEditor" name="sqlEdit">
line 154
<customwidget>
<class>SqlEditor</class>
<extends>QPlainTextEdit</extends>
<header>sqleditor.h</header>
</customwidget>
and not here
../guiSQLiteStudio/windows/functionseditor.ui
line 304
<widget class="QPlainTextEdit" name="initCodeEdit">
highlightCurrentCursorContext is never called, probably because initCodeEdit is not SqlEditor.
I've looked into this and yes, you are right about why it doesn't work. I also found out why it is how it is. Functions editor, Collations Editor - they can have different programming language implementations, therefore SqlEditor is not necessarily best fit for all of them.
Brackets matching code should ideally be moved out of SqlEditor class and made usable for any syntax highligter (as each function language can provide its own syntax highligter). Syntax Highligters are generic objects for all QPlainTextEdit
, so that should work, although it's potentially big effort. If you're willing to try and do it - let me know. Otherwise I will reschedule this issue into 3.5.0 or 3.6.0.
I'm not crawling easily into classes. at this time it is too difficult for me. Perhaps if you show me an action that I would have to reproduce on several files, I could try.
No no, we don't want to reproduce (repeat) such big chunks of code. This needs extraction int separate class and then re-usage from various points. I think it's not a good issue to work on when you're getting familiar with the project. Leave it to me - at least for now.
Details
It seems that the syntax checker work in all windows except the SQL Functions editor. It don't detect Unbalanced brackets. Is there a raison to that ?
SQLiteStudio version
3.4.4