Skip to content

Rewrite using tree-sitter #428

@dominikh

Description

@dominikh

I have started on a tree-sitter-based rewrite of go-mode. The plan going forward is to tag a final release of the existing go-mode, then replace it with the tree-sitter-based one and require Emacs 29 + tree-sitter for all future versions.

The tree-sitter version, aside from being much simpler, will also fix various bugs involving indentation and navigation, especially involving generics. Syntax highlighting will likely get a fair bit more powerful, too.

I have decided against maintaining both the old and new version as separate modes. Using a proper (and fast) parser is the way forward. The current implementation of syntax highlighting, indentation and navigation is based on a hacky collection of regular expressions. The code is barely maintainable, doesn't handle several corner-cases correctly, and we haven't managed to update it to support generics reliably for years. We clearly don't have the manpower or interest to keep working on the existing code base. Instead of keeping an unmaintained copy of the old version around, make it very clear that we will only work on the tree-sitter version going forward.

This also means that the tree-sitter-based mode will not be getting its own name; it will continue to be called go-mode. There will be two tree-sitter-based modes: our go-mode, and the buggy, low-effort go-ts-mode that comes bundled with Emacs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions