LuaLS / LuaLS/lua-language-server

`Lua.runtime.nonstandardSymbol` value not being properly copied from addon `config.json` to workspace `.vscode/settings.json`.

Open
#2,281 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### 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?

Libraries

### Expected Behaviour

`Lua.runtime.nonstandardSymbol` from addon's `config.json` should be correctly copied to `.vscode/settings.json`.

### Actual Behaviour

Only the LAST element of the addon's `Lua.runtime.nonstandardSymbol` array is being copied to `.vscode/settings.json` `Lua.runtime.nonstandardSymbol` array.

**Example**:

Input `addon/library/config.json`:

```
{
"name": "BWLua",
"words": ["--bwlua"],
"settings": {
"Lua.runtime.version": "Lua 5.1",
"Lua.runtime.special": {},
"Lua.runtime.builtin": {
"os": "disable",
"package": "disable",
"io": "disable",
"utf8": "disable",
"jit": "disable",
"debug": "disable",
"coroutine": "disable"
},
"Lua.runtime.nonstandardSymbol": ["`", "+=", "-=", "*=", "/=", "^=", "continue"]
}
}
```

Output `.vscode/settings.json`

```
{
"Lua.runtime.nonstandardSymbol": [
"continue"
],
"Lua.runtime.builtin": {
"io": "disable",
"utf8": "disable",
"debug": "disable",
"coroutine": "disable",
"package": "disable",
"os": "disable",
"jit": "disable"
},
"Lua.runtime.version": "Lua 5.1",
"Lua.workspace.library": [
".../LuaAddons/bwlua-language-addon/library"
]
}
````

Expected `"Lua.runtime.nonstandardSymbol"` value is: ```["`", "+=", "-=", "*=", "/=", "^=", "continue"]```

### Reproduction steps

1. Create an addon config at `addon/library/config.json` where `"Lua.runtime.nonstandardSymbol"` has an array with `>1` entries.
2. Enable addon in new workspace.
3. Observe `.vscode/settings.json`.

### Additional Notes

_No response_

### Log File

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the addon/library/config.json input and compare it with the generated .vscode/settings.json. Trace the addon settings transfer for Lua.runtime.nonstandardSymbol, then verify that all array entries are preserved in the workspace settings output.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.