Nvim-treesitter: TS highlight is overriding LSP diagnostics highlight

Created on 29 Oct 2020  路  2Comments  路  Source: nvim-treesitter/nvim-treesitter

Describe the bug
With TS highlight on, LspDiagnosticsUnderline{Error,Warning,Hint,Information} are overridden by the treesitter highlight. Here are two examples, the first one with TS highlight on and the other one with TS highlight off:

TS highlight on
image

TS highlight off
image

To Reproduce
Steps to reproduce the behavior:

  1. Make a LSP warning/error appear
  2. Have TS highlight on
  3. Check colors
  4. Disable TS highlight and check colors again

Expected behavior
The LSP diagnostics color should be applied over the TS highlight

Output of :checkhealth nvim_treesitter


health#nvim_treesitter#check

Installation

  • OK: git executable found.
  • OK: cc executable found.

elm parser healthcheck

c parser healthcheck

teal parser healthcheck

java parser healthcheck

python parser healthcheck

dart parser healthcheck

lua parser healthcheck

  • OK: lua parser found.
  • OK: highlights.scm found.
  • OK: locals.scm found.
  • OK: folds.scm found.
  • OK: indents.scm found.

ocaml parser healthcheck

go parser healthcheck

nix parser healthcheck

yaml parser healthcheck

json parser healthcheck

jsdoc parser healthcheck

php parser healthcheck

julia parser healthcheck

html parser healthcheck

typescript parser healthcheck

fennel parser healthcheck

swift parser healthcheck

query parser healthcheck

cpp parser healthcheck

regex parser healthcheck

verilog parser healthcheck

ruby parser healthcheck

vue parser healthcheck

ocamllex parser healthcheck

scala parser healthcheck

ql parser healthcheck

rust parser healthcheck

toml parser healthcheck

bash parser healthcheck

rst parser healthcheck

css parser healthcheck

ocaml_interface parser healthcheck

javascript parser healthcheck

c_sharp parser healthcheck

haskell parser healthcheck

tsx parser healthcheck


Output of nvim --version

NVIM v0.5.0-dev
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/builddir/neovim-0.5.0/build/config -I/builddir/neovim-0.5.0/src -I/usr/include -I/builddir/neovim-0.5.0/build/src/nvim/auto -I/builddir/neovim-0.5.0/build/include
Compiled by gbrlsnchs@asgard

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

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

Run :checkhealth for more info

Additional context
N/A.

bug

All 2 comments

I don't think so. #539 was about tree-sitter overwriting the decorations and thus really deleting virtual text while this looks like Lua highlighter and nvim_buf_add_highlight fighting for priority. #539 would even caused changing of the highlights depending on cursor position and even complete remove the highlights completely from the whole line while this looks more like both highlights are just drawn one over another.

Was this page helpful?
0 / 5 - 0 ratings