shinkage / idris2-nvim Goto Github PK
View Code? Open in Web Editor NEWSimple configuration and extra tools for NVIM + LSP + Idris2
License: MIT License
Simple configuration and extra tools for NVIM + LSP + Idris2
License: MIT License
When using https://github.com/zbirenbaum/copilot.lua, GitHub Copilot runs as an LSP client in the buffer alongside other LSP providers (e.g. idris2-lsp), and doesn't provide the functionality this plugin expects. Is there perhaps a way to handle such errors gracefully, or to not request functionality from the wrong LSP clients in the first place?
What happens whenever the plugin runs alongside any such clients:
Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp.lua:1018: not found: "textDocument/semanticTokens/full" request handler for client "copilot".
stack traceback:
[C]: in function 'error'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1018: in function 'request'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1485: in function 'fn'
/usr/share/nvim/runtime/lua/vim/lsp.lua:164: in function 'for_each_buffer_client'
/usr/share/nvim/runtime/lua/vim/lsp.lua:1484: in function 'buf_request'
...te/pack/packer/start/idris2-nvim/lua/idris2/semantic.lua:8: in function 'request'
...m/site/pack/packer/start/idris2-nvim/lua/idris2/init.lua:18: in function '_on_attach'
...ck/packer/start/nvim-lspconfig/lua/lspconfig/configs.lua:273: in function '_setup_buffer'
...ck/packer/start/nvim-lspconfig/lua/lspconfig/configs.lua:183: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
The relevant code:
idris2-nvim/lua/idris2/semantic.lua
Lines 5 to 9 in fdc47ba
When executing :lua require("idris2.metavars").request_all()
, the following error appears:
Error executing vim.schedule lua callback: vim/shared.lua:0: Expected table, got nil
stack traceback:
[C]: in function 'assert'
vim/shared.lua: in function 'tbl_isempty'
...te/pack/packer/start/idris2-nvim/lua/idris2/metavars.lua:77: in function 'handler'
/usr/share/nvim/runtime/lua/vim/lsp.lua:995: in function ''
vim.lua: in function <vim.lua:0>
I think this is a bug in this check:
idris2-nvim/lua/idris2/metavars.lua
Lines 76 to 77 in be1cd74
The argument result
might be nil
(see :help lsp-handler
), so the call to tbl_isempty
fails.
Neovim:
$ nvim --version
NVIM v0.7.0-dev+848-gb4fbb9dcf2
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -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/build/neovim-git/src/build/config -I/build/neovim-git/src/neovim-git/src -I/usr/include -I/build/neovim-git/src/build/src/nvim/auto -I/build/neovim-git/src/build/include
Compiled by builduser
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
Hello, I have been trying to setup this plugin for my neovim.
I have installed idris2 and idris2-pack using this bash -c "$(curl -fsSL https://raw.githubusercontent.com/stefan-hoeck/idris2-pack/main/install.bash)"
shown on their github page. Then I proceed to install idris2-lsp by using their recommended method (pack). I added this plugin with packer for neovim and I inserted require('idris2').setup({})
into my config file. When I edit any idris file (a file that ends with .idr). I get syntax highlighting but no autocomplete, no error reporting and no interactive development. I am sorry if this is an invalid issue but I have exhausted all solutions I could think of.
Thanks for your time!
PS: here is my nvim config: https://github.com/RHL120/neovimcfg. The only files that matter are probably:
Running Neovim will always cause it to start with the following error message:
Error in packer_compiled: Vim:E475: Invalid value for argument cmd: 'idris2' is not executable
Please check your config for correctness
This error message occurs even if the filetype opened isn't Idris2.
Start neovim with idris2-nvim
setup, without idris2
in $PATH
. This issue doesn't occur with idris2-lsp
missing, unless opening an Idris2 file (which seems reasonable to me).
I use Packer as my plugin manager and could reproduce the issue with the startup command only being require('idris2').setup({})
, as per the README.
I think this error message should only pop up when opening Idris2 files.
I hate having to comment/uncomment this plugin on my system depending on whether or not I have access to idris2
on my system.
Also, there are certain use-cases like Nix/Guix where people might only install certain packages as a dependency of project through nix-shell
and Idris2 might be one of them.
Maybe this issue can also be circumvented by setting the plugin as optional on Packer or whatever, but I don't really know how to do that and I don't think all plugin managers would support that.
I only get syntax highlighting in nvim, i.e. no auto complete, no hover, etc. capabilities. Neovim 0.8.3, with require("idris2").setup({}) in the init.lua, and use({ "ShinKage/idris2-nvim", requires = { "neovim/nvim-lspconfig", "MunifTanjim/nui.nvim" } }) in the plugins-setup.lua file. I using packer as the packer manager.
Need some assistance trying to debug what is wrong.
I'm not getting any autocomplete when I use this plugin, but everything else seems to work (code actions, inline errors, etc.)
vscode has the same functionality but also have autocompletion working.
I see textDocument/completion responses coming through in my log when I type in nvim, so the LSP seems to be receiving requests and responding properly, they're just not showing up in neovim.
Running 0.8.3 nvim
I installed idris2-nvim and it seems to mostly work (e.g. if I have a syntax error it highlights the line and shows error).
However, if I do idris2.hover.open_split(), it opens the buffer but it is always empty. I also never have any popups appearing unless I do something like "evaluate" (seems like they should appear passively although I am not completely sure).
Due to this problem, I am not able to check types and usability is significantly limited.
I have neovim 0.9.0 on Manjaro Linux.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.