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

Improve the Tree-Sitter inspector #62

Closed
narnaud opened this issue Jun 24, 2024 · 3 comments · Fixed by #137 · May be fixed by #86
Closed

Improve the Tree-Sitter inspector #62

narnaud opened this issue Jun 24, 2024 · 3 comments · Fixed by #137 · May be fixed by #86
Assignees
Labels
👷 refactor Something needs to change
Milestone

Comments

@narnaud
Copy link
Member

narnaud commented Jun 24, 2024

More discussion, quite some changes as we did a 180° turn.

  • we keep the inspector as a second window
  • we add a button for the code views to open the inspector (for better discoverability)
  • improvement on the query editor
    • better syntax highlighting (use scm for that)
    • load/save queries (using scm extension for that)
    • wiggle on error line
@narnaud narnaud added ❔ question Further information is requested 👷 refactor Something needs to change labels Jun 24, 2024
@narnaud narnaud added this to the Release 1.0.0 milestone Jun 24, 2024
@narnaud
Copy link
Member Author

narnaud commented Jun 25, 2024

Here is a proposal:

  • Create a CodeView that could be split, with the code on the left and the TreeSitter tree on the right (one button click will show/hide it), something like Neovim TreeSitter
  • Add a dock for writing TreeSitter query, that you could save and load (apparently the extension is .scm)

This is completely removing the current dialog, but better integrate TreeSitter into Knut.

@LeonMatthesKDAB
Copy link
Collaborator

Sounds good overall. The inspector could definitely use some love. It's been working fine but it's UX isn't great right now.

Side Note: .scm stands for scheme. Tree-sitter doesn't actually use scheme syntax, but it's close enough that highlighting, etc. should work fine.
We should check whether KSyntaxHighlighter has a lisp/scheme highlighter, which could be good enough.

@narnaud
Copy link
Member Author

narnaud commented Jun 25, 2024

It does, and it's already in Knut... we should definitely try that before doing our own...

@narnaud narnaud removed the ❔ question Further information is requested label Jun 25, 2024
@narnaud narnaud self-assigned this Jul 15, 2024
narnaud added a commit to narnaud/knut that referenced this issue Jul 16, 2024
The right view shows the TreeSitter tree, like in the inspector view.

Related-to KDAB#62
narnaud added a commit to narnaud/knut that referenced this issue Jul 16, 2024
The button will display the treeSitter inspector dialog.

Related-to KDAB#62
narnaud added a commit that referenced this issue Jul 18, 2024
The button will display the treeSitter inspector dialog.

Related-to #62
@LeonMatthesKDAB LeonMatthesKDAB self-assigned this Jul 30, 2024
LeonMatthesKDAB added a commit to LeonMatthesKDAB/knut that referenced this issue Jul 31, 2024
This uses KSyntaxHighlighting::SyntaxHighlighter to enable a
scheme-based syntax highlighting on the TreeSitterInspector.

This still has a few issues, as e.g. #eq? produces a strange
highlighting result and certain keywords are marked up without reason.
But it's still a good improvement from no syntax highlighting.

Part of KDAB#62.
LeonMatthesKDAB added a commit that referenced this issue Jul 31, 2024
This uses KSyntaxHighlighting::SyntaxHighlighter to enable a
scheme-based syntax highlighting on the TreeSitterInspector.

This still has a few issues, as e.g. #eq? produces a strange
highlighting result and certain keywords are marked up without reason.
But it's still a good improvement from no syntax highlighting.

Part of #62.
LeonMatthesKDAB added a commit to LeonMatthesKDAB/knut that referenced this issue Aug 1, 2024
This should make it more convenient to design queries and store them for
later reuse.

Fix KDAB#62
LeonMatthesKDAB added a commit to LeonMatthesKDAB/knut that referenced this issue Aug 2, 2024
This should make it more convenient to design queries and store them for
later reuse.

Fix KDAB#62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👷 refactor Something needs to change
Projects
None yet
2 participants