Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax cheker in Functions editor #5081

Open
marcpley opened this issue Oct 29, 2024 · 5 comments
Open

Syntax cheker in Functions editor #5081

marcpley opened this issue Oct 29, 2024 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@marcpley
Copy link

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

@pawelsalawa
Copy link
Owner

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.

@pawelsalawa pawelsalawa added this to the 3.4.5 milestone Oct 29, 2024
@pawelsalawa pawelsalawa added the bug Something isn't working label Oct 29, 2024
@marcpley
Copy link
Author

marcpley commented Nov 8, 2024

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.

@pawelsalawa
Copy link
Owner

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.

@marcpley
Copy link
Author

marcpley commented Nov 8, 2024

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.

@pawelsalawa
Copy link
Owner

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.

@pawelsalawa pawelsalawa modified the milestones: 3.4.5, 3.6.0 Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants