Neovim-from-scratch
Neovim-from-scratch copied to clipboard
High CPU Usage w/ Sumneko Lua
Been following along your great series over at youtube. I noticed when editing .lua files, the neovim gets very sluggish and my CPU fans start to whirl up. I checked the LSP logs and this showed up:
[WARN][2022-03-04 11:00:21] .../lua/vim/lsp.lua:751 "server_request: no handler found for" "workspace/semanticTokens/refresh"
Here's a look at the process, it stays at 99.5% as long as the .lua buffer is open:
Any ideas?
Unsure of if this will help you out, but I was suffering from workspaces never being able to fully load, and lua-language-server using 100%+ cpu as well as multiple gigabytes of ram as i left it running for longer. I delved a bit into the problem, and this post led me to looking through the default server configuration located at ~/.local/share/nvim/site/pack/packer/start/nvim-lspconfig/lua/lspconfig/server_configurations/sumneko_lua.lua
.
The tl;dr is that sumneko will recursively go to parent directories until it sees certain files which it uses to determine the scope of a project. If you're following along by hand and manually copying files (like I was) there's no .git folder that sumneko will find and as a result it will keep trying to pull in more and more code to parse. So I made a new git project in ~/.config/nvim/
and now the cpu and ram usage are much more reasonable. I hope this helps because this was giving me a lot of headaches over the last couple of days too!
Thank you so much for the write-up @sazro89 ! While it didn't solve my problem, you've definitely put me on the right trail.
Cheers :)