Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Automatic definition of globals always updates .vscode/settings.json instead of the config LuaLS uses #132

Open
emmericp opened this issue Mar 9, 2024 · 1 comment
Labels
bug Something isn't working LuaLS Lua Language Server extension

Comments

@emmericp
Copy link
Contributor

emmericp commented Mar 9, 2024

The recommended way to setup a config for LuaLS is to use the file .luarc.json because it is not specific to VS Code, see https://luals.github.io/wiki/configuration/

Your code to automatically add known globals will always write to .vscode/settings.json: https://github.com/Ketho/vscode-wow-api/blob/master/src/extension.ts#L129 -- which is ignored by LuaLS if .luarc.json is present.

LuaLS has a "lua.setConfig" command which updates the correct config file, it's for example used for the "define global" quick fix. I think you should be able to just call this function, but I have no idea about vs code extensions: https://github.com/LuaLS/vscode-lua/blob/master/client/src/languageserver.ts#L334

@Ketho
Copy link
Owner

Ketho commented Aug 12, 2024

It looks like we need to directly configure .luarc.json with the JSON library instead of via the LuaLS configuration.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working LuaLS Lua Language Server extension
Projects
None yet
Development

No branches or pull requests

2 participants