-
Notifications
You must be signed in to change notification settings - Fork 6
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
Vim integration #1
Comments
Hi @stapelberg, Thanks for the tool, this looks great! I really love this tool and was going to work on a similar one, however now that you wrote it there is no need for me (Which is great!). Can you please update your Readme to include instructions how it's used inside an editor? Does it accept an offset? What does it return? Does it output in JSON? As an example please check out this section from gomodifgtags: https://github.com/fatih/gomodifytags#editor-integration As you see the tool provides all the necessary primivites so other editors can easily integrate it. Especially a JSON output is crucial for some editors as it's more efficient because we can just replace the necessary lines with it. I'm more than happy to integrate but first I need all the information available (above questions on how to use it) so we can integrate this into vim-go. |
Hey @fatih, thanks for your message! Currently, the tool accepts a guru-like byte offset into the file, e.g. “myfile.go:#90”. I think that matches gomodifytags’s expanderr’s output is the entire file contents, with the specified call expression expanded — this was the most convenient for Emacs integration. We can totally introduce the JSON output format which you use in gomodifytags. Would you be interested in sending a PR? If not, I can work on it (most likely tomorrow). |
This is making me so happy right now 😄 |
I took your silence as “too busy right now” and went ahead creating pull request #3. If that looks good to you, I’ll merge it and you can add support in vim-go…? |
Thanks @stapelberg. Sorry for the late response, I'm quite busy handling the issues on vim-go and my official work. I've opened this fatih/vim-go#1445 so it's known by us (vim-go). I'll add comments to your PR once I've tried it out. |
I've just looked into this and think this needs some improvements until it's ready. Some of the things are:
func foo() error {
bar()
// no return yet as I'm still developting this
}
func bar() error {
return errors.New("foo")
} When I put my cursor on top of
It actually returns something. However this is wrong. The error should be part of json and we should be able to decide whether we can change the buffer or not. I think the error message above can be mitigated, but not sure how expanderr implemented it.
When I call
I think if there are no returns, it should default to |
No description provided.
The text was updated successfully, but these errors were encountered: