emacs-tree-sitter / elisp-tree-sitter

Emacs Lisp bindings for tree-sitter

Home Page:https://emacs-tree-sitter.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

enabling tree-sitter-hl-mode results in incorrect highlighting

ville-h opened this issue · comments

There appears to be difference between only enabling tree-sitter-hl-mode or enabling tree-sitter-mode and then tree-sitter-hl-mode from the init file.

(add-hook 'c++-mode-hook
    (lambda()
        ;; setup packages:
        ;;(tree-sitter-mode t)
        (tree-sitter-hl-mode t)
    )
)

Above doesn't call tree-sitter-mode explicitly. Open main.cxx:

#include "iostream"

// namespace incorrect
// new incorrect
// operator incorrect

auto main() -> int {
    return 0;
}

And the commented out lines have issues with the words following the c++ language keywords. Inspecting the variable tree-sitter-mode indicates its value is t. Whilst not very harmful it's still somewhat surprising that there would be a difference.