Skip to content

Use tree-sitter only for types and fallback to emacs for the rest #149

Answered by ubolonton
pushqrdx asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to use the coloring provided by font-lock-keywords, you need to set tree-sitter-hl-use-font-lock-keywords as well, like this:

(add-hook 'c++-mode-hook
  (lambda ()
    (setq-local tree-sitter-hl-use-font-lock-keywords t)
    (add-function :before-while (local 'tree-sitter-hl-face-mapping-function)
                  (lambda (capture-name)
                    (string= capture-name "type")))))

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ubolonton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Not a bug report or feature request
3 participants
Converted from issue

This discussion was converted from issue #148 on June 08, 2021 18:42.