REditorSupport / languageserver

An implementation of the Language Server Protocol for R
Other
564 stars 91 forks source link

callback error in Neovim: “attempt to compare string with number” #636

Closed srearl closed 9 months ago

srearl commented 9 months ago

Seeming related or identical to #609, I am seeing the same error reported in that closed issue when using Neovim + Nvim-R. The error is occurring only with one, particular .R file, i.e., am not seeing any such errors with any other file types or with any other R files that I can tell so it seems to be an issue specific to languageserver. I have included below as many details as I can think of save the offending R file. What else would be helpful to troubleshoot? Thanks in advance for suggestions.

Error message:

Error executing vim.schedule lua callback: .../nvim/2809/usr/share/nvim/runtime/lua/vim/diagnostic.lua:406: attempt to compare string with number
stack traceback:
.../nvim/2809/usr/share/nvim/runtime/lua/vim/diagnostic.lua:406: in function 'add'
.../nvim/2809/usr/share/nvim/runtime/lua/vim/diagnostic.lua:422: in function 'add_all_diags'
.../nvim/2809/usr/share/nvim/runtime/lua/vim/diagnostic.lua:443: in function 'get_diagnostics'
.../nvim/2809/usr/share/nvim/runtime/lua/vim/diagnostic.lua:1191: in function 'show'
.../nvim/2809/usr/share/nvim/runtime/lua/vim/diagnostic.lua:703: in function 'set'
...m/2809/usr/share/nvim/runtime/lua/vim/lsp/diagnostic.lua:236: in function 'handler'
/snap/nvim/2809/usr/share/nvim/runtime/lua/vim/lsp.lua:1057: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>

R details:

R version 4.3.1 (2023-06-16)
Platform: x86_64c-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
[7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
[9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Phoenix
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] nvimcom_0.9-147

loaded via a namespace (and not attached):
[1] compiler_4.3.1 tools_4.3.1 

languageserver:

packageVersion("languageserver")
[1] ‘0.3.16’

Neovim:

NVIM v0.9.1
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra edantic -Wno<leader>unusedarameter -Wstrictrototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdoubleromotion -Wmissing-noreturn -Wmissingormat-at tribute -Wmissingrototypes Desktop/no-common -Wno<leader>unused-result -Wimplicitallthrough Desktop/diagnostics-color=always Desktop/stackrotector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/b uild/nvim/parts/nvim/build/.deps/usr/include/luajit-2.1 -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build /build/include -I/build/nvim/parts/nvim/build/build/cmake.config -I/build/nvim/parts/nvim/build/src -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/ usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/i nclude
srearl commented 9 months ago

Closing this issue as I have also installed cmp_nvim-r and I am not sure which library is generating the error.