-
-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,8 +120,6 @@ function! s:sync_guru(args) abort | |
endif | ||
endif | ||
|
||
let old_gopath = $GOPATH | ||
let $GOPATH = go#path#Detect() | ||
|
||
" run, forrest run!!! | ||
let command = join(result.cmd, " ") | ||
|
@@ -131,8 +129,6 @@ function! s:sync_guru(args) abort | |
let out = go#util#System(command) | ||
endif | ||
|
||
let $GOPATH = old_gopath | ||
|
||
if has_key(a:args, 'custom_parse') | ||
call a:args.custom_parse(go#util#ShellError(), out) | ||
else | ||
|
@@ -217,11 +213,19 @@ endfunc | |
|
||
" run_guru runs the given guru argument | ||
function! s:run_guru(args) abort | ||
|
||
let old_gopath = $GOPATH | ||
let $GOPATH = go#path#Detect() | ||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no idea why I called it 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I've left it and changed the name to |
||
endif | ||
|
||
return s:sync_guru(a:args) | ||
let abort = s:sync_guru(a:args) | ||
|
||
let $GOPATH = old_gopath | ||
|
||
return abort | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove this newline as well please? |
||
endfunction | ||
|
||
" Show 'implements' relation for selected package | ||
|
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