Lua: Example config heavy on resources

Running LSP with the example config for the lua server, my entire plugin directory is pulled in, including heavy hitters like Telescope or plenary. That takes about 10 seconds to finish on my system.

I would expect something more conservative, or at least clear warning next to the workspace = { library = … }} line. I think checkThirdParty = false` would tamper this behavior?

Is there a question here? That config is an example to illustrate how you would bring in the “heavy hitters”.

My question is: is it a good idea to make the default example a heavy one without mentioning it. LSP brings some code intelligence, but I didn’t expect it to digest my entire plugin directory every time I edit a Lua file. It’s not clear that -- Make the server aware of Neovim runtime files is in any way optional.

it’s a default config
That means it’s something that can be changed by the user and this is just the default value.
In my opinion it is clear that this can be changed.

Fair enough. I guess this depends on the level of knowledge assumed. For me the default behavior came as a surprise. If I knew how to configure the server to my needs, I wouldn’t be copying defaults.

For me the default behavior came as a surprise.

The copy-pastable block is not the default behavior. The default config does not have the RTP values, the suggested config is the one that was most requested (providing completion/checking of imports for user plugins).

Lua-language-server will work just fine if you call require('lspconfig').sumneko_lua.setup{}.

I clarified the documentation around this: docs: clarify recommendations for lua-language-server by mjlbach · Pull Request #1845 · neovim/nvim-lspconfig · GitHub

2 Likes