As mentioned in 7.10. section of documentation
The "vim-go" Vim plugin (https://github.com/fatih/vim-go) uses |quickfix|
lists, and thus doesn't conflict with syntastic (which uses |location-list|
lists).
It uses Location lists now, so it needs to be resolved somehow.
Right, and there's no way to turn that off. _grumble_
Ok, I updated the manual in 91814d6. However, I'm not sure setting g:go_fmt_fail_silently the way I recommend there is actually enough to keep vim-go from trampling over syntastic's loclists. I'm not using vim-go, so I can't really check. Reports either way from people using both syntastic and the latest versions of vim-go would be highly appreciated.
Actually when using vim-go and Syntastic I cannot view any Location Lists that vim-go opens when using it without Syntastic. g:go_fmt_fail_silently seems not to solve problem at all.
What happens if you set g:go_fmt_fail_silently to 1?
Location list doesn't open.
But there are error indicators on the left side of window
The same happens when g:go_fmt_fail_silently is set to 0
Then perhaps it's time to ask vim-go maintainers to play nicer? A feature that can't be turned off is a bug.
@fatih what do you think about?
I don't know what play nicer means @lcd047 :) g:go_fmt_fail_silently does exactly what it says, it doesn't open any location list if there is any kind of error while saving the file via :GoFmt, either explicit either via autosave trigger. What exactly is the problem here?
@fatih "Play nicer" means vim-go not assuming it has exclusive control over location lists. Syntastic has such a mode: if you set g:syntastic_always_populate_loc_list and g:syntastic_auto_loc_list to 0, it would save and restore old location lists. Sadly, there is no way to have both vim-go and syntastic use loclists without sacrificing functionality.
it would save and restore old location lists.
Can you please expand this. What do you mean by old location lists? The same can be applied to syntastic too. Btw, I've abstracted all my list operations and I'm easily able to disable/change it to quickfix and do many other things. I'm just trying to learn what still the problem is.
What do you mean by old location lists?
@fatih There's actually a stack of location lists (and quickfix lists). Syntastic does something like this when it runs a checker (simplified):
lgetexpr some_lines
let local_loclist = deepcopy(getloclist(0))
lolder
It then uses the local copy local_loclist until a checker is run again. If g:syntastic_always_populate_loc_list is set to 0 and the user doesn't run :Errors to open the error window, that's all there is to it, the loclist is all yours to play with.
However, if g:syntastic_always_populate_loc_list is set to 1, or if the user runs :Errors, there's also some later call to setloclist(0, local_loclist), because lopen works with the current location list. Basically, syntastic expects the location list not to change under its feet after that.
This is further complicated by the fact that Vim API has no function to get the window owner of a location list. Syntastic tries to work around this by calling getloclist(0) for all windows and comparing the result with the loclist for the current error window. It needs to do that when it decides whether to close the error window automatically.
The same can be applied to syntastic too.
With vim-go using location lists, there is a mutual exclusion: either syntastic or vim-go needs to leave alone location lists. As I said above, if g:syntastic_always_populate_loc_list is set to 0, location lists are yours for the taking, at the price of users not being able to use error windows in syntastic. It would be nice if vim-go would have a similar way to leave location lists to syntastic.
Btw, I've abstracted all my list operations and I'm easily able to disable/change it to quickfix and do many other things.
For what it's worth, syntastic can't do the same because of the logic around automatic closing of the error window. That can't be made robust because of limitations in Vim's API. Automatic opening and closing the error window is by far the most messy feature of syntastic. Removing it would solve most known bugs, but it's of course way too late to do that now.
I'm just trying to learn what still the problem is.
I can't seem to reproduce the problem with the latest syntastic (17a4c01) and the latest vim-go (eec4e3e). Perhaps @nothingelsematters7 can describe in more detail what still doesn't work.
I take it the problem is solved then? Feel free to reopen this if it isn't.