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

GoRename fails if there is some errors in code #664

Closed
nothingelsematters7 opened this issue Dec 22, 2015 · 6 comments
Closed

GoRename fails if there is some errors in code #664

nothingelsematters7 opened this issue Dec 22, 2015 · 6 comments

Comments

@nothingelsematters7
Copy link

I try to rename some variable in my code when there is some errors in it.

After running :GoRename command my cursor is moved to first error in code and I cannot even understand what happened. There is any error in status line and Location List with errors is not opened.
Only after running :lopen I can view list of errors.

Variable is not renamed.

@shazow
Copy link
Contributor

shazow commented Dec 30, 2015

Same here, :GoRename stopped working at some point with no output generated. Not even in :lopen or :messages. I'm running neovim, if it matters.

Would be nice if it was easy to run the equivalent of gorename -v (verbose mode) to get a better idea of what's going wrong. Definitely need somekind of indicator of failure, at least.

@shazow
Copy link
Contributor

shazow commented Dec 30, 2015

Performing a poor man's bisect, seems failure output was working in d5a1dff but missing in ecd2a83, so somewhere between those two. :P

@shazow
Copy link
Contributor

shazow commented Dec 30, 2015

Doing a slightly wealthier man's bisect, seems it was semi-working in 0ee6e91 (some errors, probably a broken commit), but 056a911 was the first commit where the output was missing altogether.

@shazow
Copy link
Contributor

shazow commented Jan 2, 2016

Looks like most (all?) commands' non-success output get eaten in the latest version. :GoTest timeout failure doesn't show up anywhere either.

@shazow
Copy link
Contributor

shazow commented Jan 3, 2016

Continuing the investigation (apologies for the comment trickle/barrage):

The problem is here:

if !empty(fatalerrors)

gorename produces failure messages like "gorename: can't find package containing ..." which is not considered an error by the regexp '^(fatal error:.*)$' so it gets swallowed.

I think a better approach would to only rely on the code of the exec? Or at least fall back on the original error string if ParseErrors fails to extract anything.

@shazow
Copy link
Contributor

shazow commented Jan 3, 2016

Ok I figured out what's going on and I think I understand how it's supposed to work based on the other commands. Sending a PR. :)

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

No branches or pull requests

2 participants