-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: replace deprecated oracle with guru #6774
Conversation
change to prefix for guru commands from `mr` to `mf` to separate from rename commands. Better prefix? Fixes syl20bnr#6772.
@bogdanteleaga does this look ok to you? |
Maybe you can have a look at the conventions document to make sure that the bindings make sense. |
|
||
(defun go/init-go-rename() | ||
(use-package go-rename | ||
:init | ||
(spacemacs/declare-prefix-for-mode 'go-mode "mr" "rename") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except you nuked all keybindings for this prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh you're right. I thought there were some "rename" bindings. what does the go-rename package do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you miss the fact that no keybindings with that prefix existed? I don't know -- I don't do too much go coding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just quickly fixed this because I became blocked while doing some go work by an issue with oracle.
It looks like the main entry point for go rename is actually mapped to mrr
(see the next line).
I can just put the bindings back under mr
if folks are happy with them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hrm...I think I missed that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any update?
Anything I can do to move this forward? I can see the key remapping being possibly controversial; I'm happy to change it back. Potential go-coding reviewers? @bogdanteleaga Thanks all |
Hey, sorry, I saw the email initially and completely forgot about it. Thanks for the contribution, I was not aware they were going to rename oracle, I could never use it that much because it didn't work properly for the projects I was working on. That being said, I always found the bindings being under As for the point @TheBB made, some of them look like they could work as a replacement for go to defintion (go-guru-definition) or documentation (go-guru-describe). But I believe we should just let the whole thing sit under its own keybinding, mostly because guru/oracle doesn't work without setting a scope and that might be confusing to new users. Most of the functionality it provides is rather unique and doesn't really fit under the rest of the conventions we use in spacemacs as far as I am aware. What I'd like is at least some warning sign(probably in the documentation), that oracle is deprecated and we should use guru now. Even though oracle users are most likely aware, I don't think it would hurt to have it around for a while. tl;dr 👍, but add an explanation in the docs. |
Ok, I'll update the docs warning users about oracle deprecation. Thanks for taking a look! |
Ping! I was about to merge this but looks like it's not updated yet. |
@TheBB yeah I still need to do another pass, will update when ready |
Is it possible to reuse the |
@enzochiau I'd like that. Example needed. Updated the issue text to add that as a todo. |
go-path "/src/golang.org/x/tools/cmd/oracle/oracle.el") | ||
(spacemacs/declare-prefix-for-mode 'go-mode "mr" "rename") | ||
go-path "/src/golang.org/x/tools/cmd/guru/go-guru.el") | ||
(spacemacs/declare-prefix-for-mode 'go-mode "mf" "guru") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use mf
? what about mj
? ; j for jump(definition)
I'm new to emacs, but I use |
I was waiting for this.
If the PR works as is and someone submits a new one with documentation update on top, I can merge. |
I'll take a look this weekend |
@TheBB new one submitted building on this one |
@TheBB It seems that golang.org/x/tools/cmd/oracle is gone now. So this PR should have high priority. |
Thanks! Cherry-picked in develop as part of #7242. You can safely delete your branch.. |
updates go-oracle -> go-guru. It's the same command, probably renamed because of recent legal disputes..
Outstanding issues with this patch:
mr
tomf
to separate from rename commandmr
go-guru-map
rather than maintaining a separate list of bindings.go-guru-definition
results in an error:cdr: Wrong type argument: listp, "definition"
This might be due to upstream, further investigation is needed.
GOPATH
needs to be set via launchd or guru initialization is skipped, see http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x. Document this.guru
subcommands (callers
, ...)? Maybe we can figure out the package name at the top level of the project and provide that as a default value in the prompt? What about persisting it across emacs sessions per-project?Fixes #6772.