LSP not starting?

My neovim seemingly refuses to start LSP clients :confused:

I should note that I just started my config from kickstart.nvim (GitHub - nvim-lua/kickstart.nvim: A launch point for your personal nvim configuration).

Steps to reproduce:

  1. Build neovim from 462f7aaa8ea683114726d5f189f238911eb4819b (v0.11.0 does not work: runs into some seemingly unrelated error in vim.lsp)

  2. Clone my config from GitHub - anlsh/nvim: A launch point for your personal nvim configuration, commit 9ff89b7965fd737ed6577731d1da56c53067821c

  3. vi ~/.config/nvim/init.lua (or perhaps another file like /tmp/foo.c: but if you try to repro this make sure you have clangd installed, as I stopped Mason from trying to install it)

  4. Run :LspInfo

Expected Behavior: There are active LSP clients

Actual Behavior:

 /t/foo.c  h//                                                                                                                                                                     X
    1                                                                                                                                                                               
    2 ==============================================================================                                                                                                
    3 vim.lsp:                                                                  2 ⚠️                                                                                                 
    4                                                                                                                                                                               
    5 - LSP log level : WARN                                                                                                                                                        
    6 - Log path: /home/anish/.local/state/nvim/lsp.log                                                                                                                             
    7 - Log size: 12890 KB                                                                                                                                                          
    8                                                                                                                                                                               
    9 vim.lsp: Active Clients                                                                                                                                                       
   10 - No active clients                                                                                                                                                           
   11                                                                                                                                                                               
   12 vim.lsp: Enabled Configurations                                                                                                                                               
   13 - ⚠️  WARNING 'lua_ls' config not found. Ensure that vim.lsp.config('lua_ls') was called.                                                                                      
   14 - lua_ls:                                                                                                                                                                     
   15                                                                                                                                                                               
   16 - ⚠️  WARNING 'rust_analyzer' config not found. Ensure that vim.lsp.config('rust_analyzer') was called.                                                                        
   17 - rust_analyzer:                                                                                                                                                              
   18                                                                                                                                                                               
   19                                                                                                                                                                               
   20 vim.lsp: File Watcher                                                                                                                                                         
   21 - file watching "(workspace/didChangeWatchedFiles)" disabled on all clients                                                                                                   
   22                                                                                                                                                                               
   23 vim.lsp: Position Encodings                                                                                                                                                   
   24 - No active clients

Looking at the log file reveals absolutely nothing. There are no recent messages in there, just some from years ago (presumably from another slightly more successful attempt to switch to neovim)

Ok well I’ve more or less solved this (or at least, my real issue is slightly different).

Get things working on x86 · anlsh/nvim@2c943f5 · GitHub fixes one issue, which is that mason not only installs the clangd server but is also clearly responsible for configuring nvim to use it: the missing clangd configuration in :LspInfo clued me in here

So now my config works on x86. Due to clangd on Ubuntu aarch64 is unsupported · Issue #1578 · mason-org/mason.nvim · GitHub it’s still broken on arm, but hopefully I can figure out the right incantation to use there…

Fixed. I was looking at adding an option to Mason not to install packages, but instead just bypassed it entirely see Get clangd working on aarch64 · anlsh/nvim@d74796c · GitHub