Closed dunric closed 6 months ago
"Node type error at" means that go-ts-mode needs to be updated.
Adding some flavour, go-ts-mode
is packaged with emacs and the latest release of emacs (29.3 at time of writing) is not compatible with the latest release of tree-sitter-go
, and treesit-install-language-grammar
doesn't allow for specifying specific version.
Rolling back to v0.20.0
fixed the issue for me.
Copying the quick fix for others that installed via treesit-install-language-grammar
like myself on fresh installs of emacs:
git clone https://github.com/tree-sitter/tree-sitter-go && cd tree-sitter-go
git checkout v0.20.0
tree-sitter generate
tree-sitter build
# mac specific instructions
rm ~/.emacs.d/tree-sitter/libtree-sitter-go.dylib
cp go.dylib ~/.emacs.d/tree-sitter/libtree-sitter-go.dylib
And restart emacs.
@MacMcIrish Good find, stock go-ts-mode
is out of sync with current parser lib and it causes such issues.
However you don't need retire to manual compilation of older version. Just pass to treesit-install-language-grammar
function desired tag/branch in interactive mode. In this case v0.20.0
and it will rebuild it automatically.
Syntax highlighting of current go-ts-mode
with tree-sitter-go
parser seems to lack some features available in normal go-mode
like distinguished rendering of method/function names and module identifiers.
I've successfully installed
libtree-sitter-go.so
lib from current master branch.Attempt to start
go-ts-mode
fails withGNU Emacs 29.3 on x86_64 Linux go-mode.el version 1.6.0 tree-sitter-go current tree-sitter-gomod current