-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Set GOPATH for both possible go guru execution paths #1193
Conversation
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.
lgtm, just couple of small changes 👍
autoload/go/guru.vim
Outdated
@@ -217,11 +213,19 @@ endfunc | |||
|
|||
" run_guru runs the given guru argument | |||
function! s:run_guru(args) abort | |||
|
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.
Can you remove this newline please
autoload/go/guru.vim
Outdated
if go#util#has_job() | ||
return s:async_guru(a:args) | ||
let abort = s:async_guru(a:args) |
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.
This has several meanings. For async it's the job id however for sync_guru it's the output. So the caller defines what to look. Can you rename it to res
as for result
? I think that would make more sense.
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 have no idea why I called it abort
. I think I was distracted by the abort
in the function signature.
On closer examination... does the result need to be returned at all? No callers seem to use it. Can we just call the appropriate function and then return nothing here?
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 was returning with the previous one, as we might need it in the future and it's handy. You can also just return however I'm not sure how to unset it easily (as Vim doesn't have defer like we have in Go)
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.
Ok, I've left it and changed the name to res
as you suggested.
autoload/go/guru.vim
Outdated
let $GOPATH = old_gopath | ||
|
||
return abort | ||
|
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.
Can you remove this newline as well please?
d3b38ba
to
a3f707b
Compare
autoload/go/guru.vim
Outdated
endif | ||
|
||
return s:sync_guru(a:args) | ||
let res = s:sync_guru(a:args) |
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.
This line should now be in an else block so that guru isn't called twice when async_guru
was called.
a3f707b
to
b3a5628
Compare
b3a5628
to
0c348ec
Compare
Thanks @jblebrun |
No description provided.