-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
go-mode vs. go-ts-mode (included with Emacs) #440
Comments
Last time I checked (which was around the release of 29), go-ts-mode was a pretty barebones wrapper around tree-sitter that didn't provide any extra functionality. Admittedly, in the days of LSP, there's less functionality the mode itself needs to provide, but go-mode still offers functionality that LSP doesn't cover, such as support for displaying Go coverage profiles, integration with the Go playground, and ironically a set of movement functions (go to arguments, imports, etc) that would've been a lot easier to implement using tree-sitter... Furthermore, go-mode's indentation is an almost perfect match to gofmt, while go-ts-mode's is far from correct on any of the more complex cases. My plans for go-mode are a complete rewrite, using tree-sitter for any functionality that depends on syntax. I have local work to that end, which is 80% complete. I temporarily stopped work on that 8 months ago, primarily because I was blocked on bugs in Emacs's tree-sitter integration. I'll have to check if the fixes for those have been released yet. I will merge and release that rewrite once I feel comfortable making tree-sitter a hard dependency. I'm not inclined to maintain both the old and the new mode concurrently. As for coexistence: I reckon the two will coexist indefinitely, even after my rewrite. I am not willing to contribute my mode upstream, and Emacs is unlikely to drop an existing mode of theirs in favour of a 3rd party one. |
Thanks for your explanation! It would probably be good to add a comparison table to the README so that users know when to reach for go-mode.el and when the builtin go-ts-mode is sufficient. For example, I wasn’t aware of any of the advanced features you mentioned :) |
I'm not sure how many people would see that, considering the README already lists all of those features: https://github.com/dominikh/go-mode.el?tab=readme-ov-file#features |
Sorry for not checking the README more closely before writing my message. I’m sure I must have seen it before, though, so I thought a little bit about why nothing seems to have stuck. To hopefully contribute something positive, here are a few suggestions for improvements to the feature list:
|
Hey @dominikh and community, also cc @aclonegeek (author of go-ts-mode)
I recently learnt that Emacs 29 includes tree-sitter: https://www.masteringemacs.org/article/how-to-get-started-tree-sitter
Notably, aside from tree-sitter itself, Emacs 29 also includes a
go-ts-mode
package which provides tree-sitter based syntax highlighting for Go code.In fact, I found blog posts that outline how to set up Emacs for Go development (e.g. https://magnus.therning.org/2023-11-16-using-the-golang-mode-shipped-with-emacs.html) that don’t use
go-mode.el
at all anymore.This got me wondering: Is some sort of transition underway from
go-mode
togo-ts-mode
? Or are both supposed to coexist indefinitely? What reasons might one have to prefergo-mode
overgo-ts-mode
on Emacs 29+? It would probably be good to eventually explain this in the README, but I figured I’d ask here first.Thanks in advance
The text was updated successfully, but these errors were encountered: