Closed RageKnify closed 3 years ago
Same issue here, on a freshly installed neovim --HEAD
instance
Can you paste your config?
I can try and create a more minimal reproducer as well a bit later. I'm using Ubuntu on WSL if that helps
Having the recommended setup and creating a new crate (with cargo new example
) seems to be enough, just having the cursor over the fn
of fn main() {
triggers the error, I'll try to write a minimal init.vim
.
Can you checkout the branch issue58
and tell me what it prints in :messages
. I don't have this error with a new rust repo.
Also what's the latest commit you see on master for vim-illuminate?
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.config/nvim/plugged')
Plug 'neovim/nvim-lspconfig'
Plug 'RRethy/vim-illuminate'
call plug#end()
lua require'lspconfig'.rust_analyzer.setup{ on_attach = require'illuminate'.on_attach }
This was enough, I created a new user to test it.
I'm on commit
238891e7b7e7d6c00289d1c52d230431a7a5e35e
I'll try the issue58
branch.
nil "textDocument/documentHighlight" nil 1 1 nil
nil "textDocument/documentHighlight" { {
range = {
end = {
character = 7,
line = 0
},
start = {
character = 3,
line = 0
}
}
} } 1 1 nil
There's also this:
nil "textDocument/documentHighlight" {} 1 1 nil
I think this is the output you wanted, neovim only gives me line by line, I need to press enter to get the next line.
Let me know if master fixes it.
Yeah, seems to have fixed it ty for the quick fix!
Awesome! Not sure why but for my testing I never got nil
as the third param which was the cause of the error. I had a mistake in lua syntax, been coding too much python recently.
Fixed for me as well, ty for the quick fix!
Can you explain what the commit
changed?
I haven't written lua
(only some LSP config), but it looks like the code changed from if not X == Y then Z
to if X != Y then Z
, which seems like the same to me.
if (not X) == Y
vs if not (X == Y)
(I think)
if (not X) == Y
vsif not (X == Y)
(I think)
Yeah, sounds right, ty. I ran it in the REPL and got:
> if not 0 == 1 then print('entered') end
> if not (0 == 1) then print('entered') end
entered
In my example something crucial is:
Only nil and false are falsy
https://www.lua.org/pil/3.5.html
Yea it's because not
has higher associativity precedence than ==
.
I'm getting the following error when the cursor is over something that isn't meant to be highlighted (for example a space or an opening parenthesis):
Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:1111: bad argument #1 to 'ipairs' (table expected, got nil)
When using the plugin without the LSP integration it works fine. Might be related to latest neovim
master
, I'm on https://github.com/neovim/neovim/commit/84d08358b7c4af1d92c7d47edc2c7ae9594ffae4, the latest nightly as of right now.(I'm on
master
forvim-illuminate
, updated along with neovim)