nyoom.nvim icon indicating copy to clipboard operation
nyoom.nvim copied to clipboard

Errors after adding lsps

Open icyrogue opened this issue 3 years ago • 6 comments

I tried adding custom lsp servers in lsp.fnl (I just added them to the array after installing server itself)

For example in Svelte files I get

Error executing vim.schedule lua callback: ...ache/nvim/hotpot/Users/icy/.config/nvim/fnl/pack/lsp.lua:33: module 'telescope.builtin' not found:                                    
        no field package.preload['telescope.builtin']                                                                                                                               
        no file './telescope/builtin.lua'                                                                                                                                           
        no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/share/luajit-2.1.0-beta3/telescope/builtin.lua'                                                                    
        no file '/usr/local/share/lua/5.1/telescope/builtin.lua'                                                                                                                    
        no file '/usr/local/share/lua/5.1/telescope/builtin/init.lua'                                                                                                               
        no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/share/lua/5.1/telescope/builtin.lua'                                                                               
        no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/share/lua/5.1/telescope/builtin/init.lua'                                                                          
        no file '/Users/icy/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/telescope/builtin.lua'                                                                           
        no file '/Users/icy/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/telescope/builtin/init.lua'                                                                      
        no file '/Users/icy/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/telescope/builtin.lua'                                                                  
        no file '/Users/icy/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/telescope/builtin/init.lua'                                                             
        no file './telescope/builtin.so'                                                                                                                                            
        no file '/usr/local/lib/lua/5.1/telescope/builtin.so'                                                                                                                       
        no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/lib/lua/5.1/telescope/builtin.so'                                                                                  
        no file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                 
        no file '/Users/icy/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/telescope/builtin.so'                                                                              
        no file './telescope.so'                                                                                                                                                    
        no file '/usr/local/lib/lua/5.1/telescope.so'                                                                                                                               
        no file '/usr/local/Cellar/luajit-openresty/2.1-20220411/lib/lua/5.1/telescope.so'                                                                                          
        no file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                 
        no file '/Users/icy/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/telescope.so'                                                                                      
stack traceback:                                                                                                                                                                    
        [C]: in function 'require'                                                                                                                                                  
        ...ache/nvim/hotpot/Users/icy/.config/nvim/fnl/pack/lsp.lua:33: in function '_on_attach'                                                                                    
        ...pack/packer/opt/nvim-lspconfig/lua/lspconfig/configs.lua:280: in function '_setup_buffer'                                                                                
        ...pack/packer/opt/nvim-lspconfig/lua/lspconfig/configs.lua:183: in function ''                                                                                             
        vim/_editor.lua: in function <vim/_editor.lua:0>  

Although lsp and cmp works perfectly afterwards

I also get error [lspconfig] Cannot access configuration for rust-analyzer. Ensure this server is listed in `server_configurations.md` or added as a custom server. when editing any .rs file, I have rust-analazyer installed through Mason and brew

Am I missing something?

icyrogue avatar Aug 02 '22 00:08 icyrogue

Happens to me from time to time as well, and I'm not sure why. I reckon it's probably due to the weird way 'rust-tools.nvim' is loading the lsp_server, though I'm not sure how to fix it. I'll take a look again soon

shaunsingh avatar Aug 02 '22 02:08 shaunsingh

Ok then, I will be waiting

icyrogue avatar Aug 02 '22 14:08 icyrogue

Happens to me from time to time as well, and I'm not sure why. I reckon it's probably due to the weird way 'rust-tools.nvim' is loading the lsp_server, though I'm not sure how to fix it. I'll take a look again soon

This is possibly because the way you lazyload the plugins, sometimes Telescopes is loaded after LSP hence it's module was not found. My guess is you could try lazyload Telescope with sth like {:event :BufRead}so that Telescope is available after startup.

bangedorrunt avatar Aug 02 '22 21:08 bangedorrunt

@babygau rust-tools.nvim and/or lsp shouldn't be dependent on Telescope, I'm not really sure whats happening here.

shaunsingh avatar Aug 02 '22 21:08 shaunsingh

@babygau rust-tools.nvim and/or lsp shouldn't be dependent on Telescope, I'm not really sure whats happening here.

But this is what I see in your lsp config

https://github.com/shaunsingh/nyoom.nvim/blob/main/fnl/pack/lsp.fnl#L38-L42

Btw, just my guess 😀

bangedorrunt avatar Aug 02 '22 23:08 bangedorrunt

Oops, forgot about that piece . Thanks ill move that mapping over to be loaded on telescopes load :)

shaunsingh avatar Aug 03 '22 04:08 shaunsingh

Fixed in a seperate branch that contains some work I'm doing on modularizing the config a bit more. I'll back port the changes soon https://github.com/shaunsingh/nyoom.nvim/blob/ae23a9884f9d030aa66f667e17f6dd08a20e8b1e/fnl/modules/tools/lsp/config.fnl#L52-L58

shaunsingh avatar Aug 10 '22 19:08 shaunsingh

Fixed in a seperate branch that contains some work I'm doing on modularizing the config a bit more. I'll back port the changes soon https://github.com/shaunsingh/nyoom.nvim/blob/ae23a9884f9d030aa66f667e17f6dd08a20e8b1e/fnl/modules/tools/lsp/config.fnl#L52-L58

Does it fix Rust-analyzer problem?

icyrogue avatar Aug 11 '22 11:08 icyrogue

I haven't had the rust-analyzer problem in a while so I assume that fixed it as well

shaunsingh avatar Aug 11 '22 15:08 shaunsingh

Oh, ok, maybe a MacOs problem, I will have test on Arch, huge thanks anyway! Love your work

icyrogue avatar Aug 11 '22 17:08 icyrogue

I think it should be fixed now, on main

shaunsingh avatar Aug 11 '22 20:08 shaunsingh