nvim-treesitter / nvim-treesitter-refactor

Refactor module for nvim-treesitter
Apache License 2.0
407 stars 25 forks source link

Highlight Definitions not working at all #49

Closed lucadomene closed 1 year ago

lucadomene commented 1 year ago

When enabling highlight_definitions and trying to hover with cursor over a symbol, no other symbols are highlighted.

To Reproduce 1) Enable nvim-treesitter-refactor highlight_definitions as provided on the documentation 2) Try to create a simple program (C in my case) which contains a symbol definition and usage 3) Try to hover with cursor over the symbol usage 4) The original definition is not highlighted

Expected behavior The original definition of such symbol should be highlighted

Output of :checkhealth nvim_treesitter

nvim-treesitter: require("nvim-treesitter.health").check() ======================================================================== ## Installation - OK: `tree-sitter` found 0.20.7 (parser generator, only needed for :TSInstallFromGrammar) - OK: `node` found v18.7.0 (only needed for :TSInstallFromGrammar) - OK: `git` executable found. - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" } Version: cc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4) - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI. ## OS Info: { machine = "x86_64", release = "6.2.8-200.fc37.x86_64", sysname = "Linux", version = "#1 SMP PREEMPT_DYNAMIC Wed Mar 22 19:11:02 UTC 2023" } ## Parser/Features H L F I J - c ✓ ✓ ✓ ✓ ✓ - java ✓ ✓ . ✓ ✓ - lua ✓ ✓ ✓ ✓ ✓ - vim ✓ ✓ ✓ . ✓ Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections +) multiple parsers found, only one will be used x) errors found in the query, try to run :TSUpdate {lang}

Output of nvim --version

NVIM v0.8.3
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wal
l -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redh
at-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_
TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=g
nu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-proto
types -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/build/BUILD/neovim-0.8.3/redhat-linux-build/cmake.config -I/builddir/build/BUILD/neovim-0.8.3/
src -I/usr/include -I/usr/include/luajit-2.1 -I/builddir/build/BUILD/neovim-0.8.3/redhat-linux-build/src/nv
im/auto -I/builddir/build/BUILD/neovim-0.8.3/redhat-linux-build/include
Compiled by mockbuild@koji

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 Running :checkhealth against nvim only returns that I do not have pynvim installed. Unsure whether that could be the issue.

lucadomene commented 1 year ago

Updating Node.js, installing pynvim and generally reinstalling treesitter and treesitter-refactor solved the issue