Languageclient-neovim: Plugin should not override ALE settings unless requested

Created on 15 Aug 2018  路  5Comments  路  Source: autozimu/LanguageClient-neovim

  • Did you upgrade to latest plugin version? Yes
  • Did you upgrade to/compile latest binary? Yes
  • (Neovim users only) Did you check output of :checkhealth LanguageClient? Yes
  • Did you check [troubleshooting]? Yes

Describe the bug

I have my own very specific settings for how ALE displays symbols in the sign column but once I enable LanguageClient, it is partially overridden by your defaults. This plugin should have an option to disable such behavior.

Environment

  • neovim/vim version (nvim --version or vim --version):
NVIM v0.2.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-VavapE/neovim-0.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=2 -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/neovim-VavapE/neovim-0.2.2/build/config -I/build/neovim-VavapE/neovim-0.2.2/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/build/neovim-VavapE/neovim-0.2.2/build/src/nvim/auto -I/build/neovim-VavapE/neovim-0.2.2/build/include
Compiled by [email protected]

Features: +acl +iconv +jemalloc +tui 
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
  • This plugin version (git rev-parse --short HEAD): 605c07e
  • This plugin's binary version (bin/languageclient --version): 0.1.110
  • Minimal vimrc content (A minimal vimrc is the smallest vimrc that could
    reproduce the issue. Refer to an example [here][min-vimrc.vim]):
call plug#begin('~/.config/nvim/plugged')
Plug 'w0rp/ale'
" Language server
Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }
call plug#end()

" Ale configuration
let g:ale_linters = {
  \   'rust': ['rls'],
  \}
let g:ale_set_highlights = 0
let g:ale_sign_error = 'x'
let g:ale_sign_warning = 'w'
let g:ale_lint_on_enter = 0
" rust specific options for ALE
let g:ale_rust_rls_executable = $HOME . '/.cargo/bin/rls'
let g:ale_rust_rls_toolchain = 'nightly'


" language server configuration
set hidden

let g:LanguageClient_serverCommands = {
    \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
    \ }

let g:LanguageClient_diagnosticsSignsMax = 0

To Reproduce

Steps to reproduce the behavior:

  1. Create a new cargo project
  2. Make a change so the linter shows an error
  3. Now disable LanguageClient from init.vim and open the file with the same error produced above
  4. Notice how the sign column is formatted differently

Current behavior

With LanguageClient enabled, ALE settings for the sign column is partially overridden.

Expected behavior

I expect that my ALE settings to be left untouched unless I specifically asked for it.

Screenshots

With LanguageClient disabled:
image

With LanguageClient enabled:
image

help wanted

Most helpful comment

You should be able to work around this with:

let g:LanguageClient_diagnosticsEnable=0

assuming you want to use ALE for linting instead.

All 5 comments

This plugin never override ALE settings as far as I remember.

It defines its own sign types at
https://github.com/autozimu/LanguageClient-neovim/blob/232774c012aa56d495a29dcae3fbe112f8d6c309/src/languageclient.rs#L234

With definitions from
https://github.com/autozimu/LanguageClient-neovim/blob/232774c012aa56d495a29dcae3fbe112f8d6c309/doc/LanguageClient.txt#L79-L109

Since you're disable sign drawing from this plugin, there shouldn't be any sign instances of this defined type shown anyway.

You should be able to work around this with:

let g:LanguageClient_diagnosticsEnable=0

assuming you want to use ALE for linting instead.

This depends on the color scheme that is used.
If ALEErrorSign / ALEWarningSign / ALEInfoSign is set in the color scheme everything works fine, but if its not, this plugin clears the vaules.

:hi ALEErrorSign
ALEErrorSign   xxx cleared

Without this plugin it links to Error

:hi ALEErrorSign
ALEErrorSign   xxx links to Error

One solution is to just define the highlight groups
the other is to map LanguageClient_diagnosticsDisplay to other highlight groups

let g:LanguageClient_diagnosticsDisplay = {
\   1: { 'signTexthl': 'Error' },
\   2: { 'signTexthl': 'Todo' },
\   3: { 'signTexthl': 'Todo' },
\   4: { 'signTexthl': 'Todo' },
\}

Is it possible to output LanguageClient-neovim errors through ALE?

Edit: I think it's not, so I opened #800 to track that. That should fix this issue too, as diagnostics would be unified.

As of #1144 LCN does no longer use ale's highlight groups, it instead defines it's own groups and uses that as a default, so this shouldn't be a problem anymore. If the problem persists thought, feel free to re-open.

Was this page helpful?
0 / 5 - 0 ratings