Open fjl opened 6 years ago
Should it work for those?
It was designed and implemented to work the way it does; that is, it's not a bug.
That doesn't mean we're doing the right thing. I have a somewhat large redesign of go-mode planned, with better parsing of Go code (probably backed by a Go process using go/parser), which would make it trivial to navigate between any kind of syntax – right now we're limited by what's easy and reliable to match via regexps. When that time comes, I'll happily evaluate the major modes of popular programming languages to see if our behaviour or that of c-mode is more common.
We will revisit this in the context of the upcoming tree-sitter-based major mode.
In other modes, e.g. c-mode, beginning-of-defun jumps to the beginning of any definition. For go-mode it works with functions and methods but not for types, variables and constants. Should it work for those?