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

beginning-of-defun, end-of-defun don't handle types #232

Open
fjl opened this issue Feb 7, 2018 · 3 comments
Open

beginning-of-defun, end-of-defun don't handle types #232

fjl opened this issue Feb 7, 2018 · 3 comments
Milestone

Comments

@fjl
Copy link
Contributor

fjl commented Feb 7, 2018

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?

@fjl fjl changed the title beginning-of-defun, end-of-defun doesn't handle types beginning-of-defun, end-of-defun don't handle types Feb 7, 2018
@dominikh
Copy link
Owner

dominikh commented Feb 9, 2018

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.

@dominikh dominikh added this to the Rewrite milestone Mar 27, 2018
@raxod502
Copy link

Workaround: https://github.com/raxod502/radian/blob/7bc3674919631689959e47a65e463ee7fbe03c59/emacs/radian.el#L2813-L2863

@dominikh
Copy link
Owner

We will revisit this in the context of the upcoming tree-sitter-based major mode.

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

No branches or pull requests

4 participants
@fjl @dominikh @raxod502 and others