-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix: replace kdl tree-sitter to fix highlighting #8652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The queries in runtime/queries/kdl/*.scm
will need to be updated to match the new grammar. For example cargo xtask query-check
is currently failing because the queries match a comment
node which doesn't exist in the new grammar (it has a single_line_comment
node instead https://github.com/amaanq/tree-sitter-kdl/blob/e180e05132c4cb229a8ba679b298790ef1eca77c/grammar.js#L291)
Thanks for your comments. I updated Also, I added indent queries. |
I added text object queries for tree sitter navigation:
I also added indents, they just work. Lastly, I slightly improved the syntax highlighting. node identifiers are now variable colored, which afaik is normally the most common color, white. This removes colors, with them being the most common element of kdl documents, and removes color clashes with type annotations. Also, types and their brackets are differently colored. |
* replace kdl tree-sitter * kdl: adopt highlights for new tree-sitter * kdl: add indent queries * kdl: add textobjects * kdl: improve syntax highlighting * kdl: update lang-support * kdl: make indents more concise --------- Co-authored-by: Constantin Gahr <constantin.gahr@ipp.mpg.de>
* replace kdl tree-sitter * kdl: adopt highlights for new tree-sitter * kdl: add indent queries * kdl: add textobjects * kdl: improve syntax highlighting * kdl: update lang-support * kdl: make indents more concise --------- Co-authored-by: Constantin Gahr <constantin.gahr@ipp.mpg.de>
* replace kdl tree-sitter * kdl: adopt highlights for new tree-sitter * kdl: add indent queries * kdl: add textobjects * kdl: improve syntax highlighting * kdl: update lang-support * kdl: make indents more concise --------- Co-authored-by: Constantin Gahr <constantin.gahr@ipp.mpg.de>
* replace kdl tree-sitter * kdl: adopt highlights for new tree-sitter * kdl: add indent queries * kdl: add textobjects * kdl: improve syntax highlighting * kdl: update lang-support * kdl: make indents more concise --------- Co-authored-by: Constantin Gahr <constantin.gahr@ipp.mpg.de>
* replace kdl tree-sitter * kdl: adopt highlights for new tree-sitter * kdl: add indent queries * kdl: add textobjects * kdl: improve syntax highlighting * kdl: update lang-support * kdl: make indents more concise --------- Co-authored-by: Constantin Gahr <constantin.gahr@ipp.mpg.de>
The tree-sitter for the kdl language currently being used contains bugs.
Consider the following kdl config:
With the current tree-sitter implementation, escaped double quotes
\"
are being detected as characters ending a string. As such, they are improperly highlighted.I propose to change the used implementation to https://github.com/amaanq/tree-sitter-kdl. It seems to be more up to date, more activate and highlights the previous example correctly.