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

Run godef from buffer path #2150

Merged
merged 4 commits into from
Feb 22, 2019
Merged

Run godef from buffer path #2150

merged 4 commits into from
Feb 22, 2019

Conversation

ldelossa
Copy link
Contributor

This PR stemmed from this issue:
#2149

We now execute godef in the current directory of the buffer.

@ldelossa ldelossa changed the title plumb varags into ExecuteInDir Run godef from buffer path Feb 22, 2019
Copy link
Collaborator

@bhcleek bhcleek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing!

@@ -175,7 +175,7 @@ function! go#tool#ExecuteInDir(cmd) abort
let dir = getcwd()
try
execute cd . fnameescape(expand("%:p:h"))
let [l:out, l:err] = go#util#Exec(a:cmd)
let [l:out, l:err] = go#util#Exec(a:cmd, a:000)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since a:000 is a list that may or may not be populated we have to make a dynamic call to go#util#Exec with something like (untested): let [l:out, l:err] = call call('go#util#Exec', [a:cmd] + a:000)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I saw that in stack overflow: https://stackoverflow.com/questions/11703297/how-can-i-pass-varargs-to-another-function-in-vimscript but didn't quite wrap my head around it. I'll send another commit with this change.

@ldelossa
Copy link
Contributor Author

@bhcleek had to use the latest commit in order to get the tests to pass. Maybe the double call is not legal when gathering the output ?

@bhcleek
Copy link
Collaborator

bhcleek commented Feb 22, 2019

yeah, since the return values are assigned to variables, you don't need the call statement.

@bhcleek bhcleek merged commit bf951d9 into fatih:master Feb 22, 2019
bhcleek added a commit that referenced this pull request Feb 22, 2019
@bhcleek
Copy link
Collaborator

bhcleek commented Feb 22, 2019

Thank you for contributing again 🙇

@ldelossa
Copy link
Contributor Author

ldelossa commented Feb 22, 2019 via email

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

Successfully merging this pull request may close these issues.

2 participants