Use string query for comment font-lock (#match? compat) - #14
Closed
bbatsov wants to merge 1 commit into
Closed
Conversation
Emacs 30.2 and earlier translate the sexp :match form to #match (without ?). Whether this works depends on the tree-sitter C library version linked with Emacs -- some accept both forms, some require #match? exclusively. Using a string query bypasses treesit-query-expand so #match? reaches tree-sitter verbatim. Ref #13
Owner
Author
|
Closing this — the CI shows Emacs 29.4 and 30.1 reject The situation is:
The sexp |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emacs 30.2
treesit.ctranslates the sexp:matchform to#match(without?). Whether that works depends on the tree-sitter C library linked with Emacs — statically linked builds (e.g., macOS) tend to accept both, but dynamically linked builds (e.g., some Linux distros) may require#match?and reject#match.This switches the comment font-lock rule to a string query so
#match?bypassestreesit-query-expandand reaches tree-sitter verbatim.@david2038 — could you try this branch and let us know if it fixes the issue on your build?
Ref #13