LuaLS/LuaLS.github.io

docs: workspace.checkThirdParty implies automatic behaviour

idbrii opened this issue · 1 comments

How are you using the lua-language-server?

Other

Which OS are you using?

Windows

What is the issue affecting?

Other

Expected Behaviour

workspace.checkThirdParty docs says "Whether addons can be automatically detected and applied" which sounds like it would automatically configure third party libraries for me.

Actual Behaviour

But the check3rdByWords looks like it never automatically changes configuration. It always prompts the user if it finds a relevant add-on:

https://github.com/LuaLS/lua-language-server/blob/63211177f8f3ad2a50dca3ab2ccaae737486813c/script/library.lua#L520-L593

I want "automatic configuration" behaviour, but I don't want "prompt me every time I open my project" behaviour.

Reproduction steps

  1. Use vim with vim-lsp-settings and :LspInstallServer sumneko-lua-language-server to setup vim with LuaLS
  2. Open a lua file
  3. Get prompted with "Do you need to configure your work environment as LÖVE?" (#679)
  4. try configuring luals to use 'runtime': { 'version': 'Lua 5.4'}, which is not love (love uses luajit)
  5. restart vim and Open a lua file
  6. Get prompted with "Do you need to configure your work environment as LÖVE?"

Additional Notes

I think the documentation is incorrect and instead should read:

Whether LuaLS should detect and request to enable addons automatically. Addons can set up the environment to be as close as possible to your target runtime environment. To manually configure addons, set their path with workspace.userThirdParty and select them with workspace.library.

I'm not sure that last sentence is correct.

Log File

No response

It was intended as meaning the configuration is applied automatically, but I see how this could be misleading. There is no fully automatic applying, that would likely end up in too many cases where an addon is enabled without users being aware. I'll look at changing the description 🙂