Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite using tree-sitter #428

Open
dominikh opened this issue Oct 20, 2023 · 4 comments
Open

Rewrite using tree-sitter #428

dominikh opened this issue Oct 20, 2023 · 4 comments
Assignees

Comments

@dominikh
Copy link
Owner

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.

@fedeizzo
Copy link

fedeizzo commented Mar 8, 2024

Hey @dominikh 👋 thank you for the amazing work.
Any news on the rewrite? I don't see any public branch on tag, are you working on that? If not, are you open to contributions?

@dominikh
Copy link
Owner Author

dominikh commented Mar 8, 2024

@fedeizzo I am working on it, yes. In part I am waiting on the next release of Emacs, as the current one has some unfortunate bugs.

@emad-elsaid
Copy link

emad-elsaid commented May 18, 2024

is there a way we can help? if you have some plan to rewrite the parts and it could be done independently maybe we can help

@dominikh
Copy link
Owner Author

Thank you for the offer, but no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants