Languageclient-neovim: quickfix conflict with fugitive Glog

Created on 27 Aug 2018  ·  7Comments  ·  Source: autozimu/LanguageClient-neovim

Describe the bug

LanguageClient-neovim, by default, puts diagnostics into the quickfix list. This list is also used by fugitive's Glog command to browse the history of a file. Once Glog has been triggered, a previous revision of the current file is shown, the language client passes the file to the language server and invalidates the quickfix entries that fugitive has populated. Thus, you are never able to browse further into the history.

Somehow, mangling the quickfix list should be disabled while browsing the history with fugitive.

Environment

  • neovim/vim version (nvim --version or vim --version): v0.3.1
  • This plugin version (git rev-parse --short HEAD): 0b6b10a9e6923e616707ae430332f9646b0fe063
  • This plugin's binary version (bin/languageclient --version): languageclient 0.1.113 0b6b10a9e6923e616707ae430332f9646b0fe063
  • Minimal vimrc content (A minimal vimrc is the smallest vimrc that could
    reproduce the issue. Refer to an example [here][min-vimrc.vim]):
set nocompatible
set hidden

set runtimepath+=~/.local/share/nvim/bundle/vim-fugitive
set runtimepath+=~/.local/share/nvim/bundle/LanguageClient-neovim

let g:LanguageClient_serverCommands = {
    \ 'python': ['pyls'],
    \ }
let g:LanguageClient_autoStart = 1

runtime plugin/LanguageClient.vim

  • Language server link and version: doesn't matter, pyls for example

To Reproduce

  1. start vim on a python file that triggers diagnostics and has some git history
  2. :Glog
  3. :copen

Current behavior

The opened quickfix list is either empty or replaced with warnings from the file from history.

Expected behavior

Fugitive revisions are still available in the quickfix list.

Most helpful comment

Same happens to me when using ack.vim.

All 7 comments

Same happens to me when using ack.vim.

There is no straightforward way for this plugin to know quickfix is being used by other plugins or when it is safe to override quickfix list.

I'd argue operations like Glog and ack should use location list rather than quickfix. As the name difference suggests quickfix is to show list of compiling errors and location list is for displaying different locations.

Then they conflict with ALE ;) But git revisions are not local to a file. location list would be gone if I navigate to a different file using the git history. But I see that this is probably a fundamental design problem in vim. I don't know whether there's a good workaround though.

This might be relevant: https://github.com/w0rp/ale#5xi-how-can-i-use-the-quickfix-list-instead-of-the-loclist

And then ale conflicts with the language client?

As been stated previously, there is no straight forward way to avoid this confliction.

I'm adding a new function LanguageClient#setDiagnosticsList() to support dynamically set diagnostics output. With this, a workaround might look like

call LanguageClient#setDiagnosticsList('Disabled');
" do stuff with quickfix/location list
call LanguageClient#setDiagnosticsList('Quickfix');

Thanks, this makes this at least solvable.

Was this page helpful?
0 / 5 - 0 ratings