LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.35k stars 320 forks source link

"Lua.runtime.version" setting continually overwritten in settings.json file in workspace #1870

Closed Gate88 closed 1 year ago

Gate88 commented 1 year ago

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Other

Expected Behaviour

When I edit files in Visual Studio Code, I expect lua-language-server to NOT overwrite my workspace's settings.json file.

Actual Behaviour

Every time I edit a file in my Lua project in Visual Studio Code, my workspace .vscode/settings.json is modified from "Lua.runtime.version": "LuaJIT", to "Lua.runtime.version": "Lua 5.4",

Reproduction steps

  1. Launch VSCode with Lua Language Server as only enabled extension
  2. Create a new Lua project in VSCode
  3. Create a .vscode/settings.json file with the following contents:
    {
    "Lua.runtime.version": "LuaJIT",
    "Lua.workspace.library": ["${3rd}/love2d/library"],
    "Lua.workspace.checkThirdParty": false
    }
  4. Create and edit some lua files in the project.
  5. Observe that the settings.json file has been automatically modified to the runtime version Lua 5.4

Additional Notes

Only seems to happen in 3.6.8. If I revert to 3.6.7 it will not overwrite my settings.

Even happens if I update both user and workspace settings to use LuaJIT NOT Lua 5.4.

Log File

testLanguageServerProject.log

carsakiller commented 1 year ago

Duplicate of #1864