Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't assume all LSP clients provide "textDocument/semanticTokens/full" #17

Open
gekoke opened this issue Apr 24, 2022 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@gekoke
Copy link

gekoke commented Apr 24, 2022

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:
https://github.com/ShinKage/idris2-nvim/blob/fdc47ba6f0e9d15c2754ee98b6455acad0fa7c95/lua/idris2/semantic.lua#L5-L9

@ShinKage
Copy link
Collaborator

ShinKage commented May 2, 2022

I will work on it during the May IDM. I already have an idea on how to solve the issue, but I also want to do some refactoring.

@ShinKage ShinKage self-assigned this May 2, 2022
@ShinKage ShinKage added the bug Something isn't working label May 2, 2022
@ShinKage
Copy link
Collaborator

@gekoke Can you check if #18 solves the issue?

@gekoke
Copy link
Author

gekoke commented May 17, 2022

It doesn't seem like it - I'm still getting the same error running 46e69fa

LSP[idris2_lsp]: Error SERVER_REQUEST_HANDLER_ERROR: '/usr/share/nvim/runtime/lua/vim/lsp.lua:1018: not fo
und: "textDocument/semanticTokens/full" request handler for client "copilot".'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants