-
Notifications
You must be signed in to change notification settings - Fork 5
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
The LSP is not initialized #2
Comments
Do you get any messages @InfinytRam? I havent tried with the VSCode bundled rzls and instead have used the one built from source in the razor repo |
Thanks for the quick response @tris203, This time i provided the path to Steps I took to build
I provided the local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
require('rzls').setup {
on_attach = function()
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { buffer = 0 })
end,
capabilities = capabilities,
path = '/home/ram/Documents/projects/dotnet/razor/razor/artifacts/LanguageServer/Debug/net8.0/linux-x64/rzls',
}
and unfortunately i did not get any messages when i opened .cshtml file. I also checked the Happy to provide additional information. |
Can you try and a .razor file? Ps, this plugin is still very much under development Only a very small amount of methods work and a lot of debug info is still visible |
I've tried with both VSCode It then says "Razor LSP attached" and I can see "rzls" on the task bar, but it's a bit broken. Some warnings show off, but that's pretty much it. And as soon as I input something in the file, it get those two above errors back to back on every keystroke basically. Had to change the And here's my setup |
Do you see it open the projected virtual buffers? |
You will also need |
Getting the same error as @nomis51 when open a Creating virtual buffers for /........../projects/dotnet/IMS/IMS.WebApp/Components/App.razor
Error executing vim.schedule lua callback: ...hare/nvim/lazy/rzls.nvim/lua/rzls/documentstore/init.lua:59: attempt to index a nil value
stack traceback:
...hare/nvim/lazy/rzls.nvim/lua/rzls/documentstore/init.lua:59: in function 'update_html_vbuf'
...cal/share/nvim/lazy/rzls.nvim/lua/rzls/handlers/init.lua:38: in function 'handler'
/usr/local/share/nvim/runtime/lua/vim/lsp/client.lua:1005: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...hare/nvim/lazy/rzls.nvim/lua/rzls/documentstore/init.lua:21: attempt to index a nil value
stack traceback:
...hare/nvim/lazy/rzls.nvim/lua/rzls/documentstore/init.lua:21: in function 'update_csharp_vbuf'
...cal/share/nvim/lazy/rzls.nvim/lua/rzls/handlers/init.lua:34: in function 'handler'
/usr/local/share/nvim/runtime/lua/vim/lsp/client.lua:1005: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: ...hare/nvim/lazy/rzls.nvim/lua/rzls/documentstore/init.lua:59: attempt to index a nil value
my config setup: local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
local rzls_path = '.........../razor/artifacts/LanguageServer/Debug/net8.0/linux-x64/'
require('rzls').setup {
on_attach = function() end,
capabilities = capabilities,
path = rzls_path,
}
|
Can you guys try again. There have been a lot of updates to the workings of this |
I finally was able to make it work with your latest work (on native Windows). Can't say it's an easy ride yet, but it's getting there, great work! I installed roslyn manually (but I believe it would work with mason aswell) and installed rzls with mason. I had to path manually to the And finally it does work, both rzls and roslyn hook up when required. I didn't experience the problem of "open a .cs file first breaks rzls". For me no matter in what other I open files at first, it seems to work (razor then cs, cs then razor, cshtml then cs, etc.) Although I had one error spamming 5 times as I first open a razor file (but it didn't seem to break anything afaik)
Also, it might simply be WIP as of now, but I'm pointing it out : local @code blocks work, LSP provide completion, but not for code-behind But if I use an explicit code-behind class, it does work |
OS: Linux Ubuntu 24.04 LTS
NVIM: v0.10.0-dev-435dee7
After opening a .razor/.cshtml file, no LSP client get attached to the buffer.
Here is my
nvm-lspconfig
setup:The text was updated successfully, but these errors were encountered: