LuaLS / LuaLS/lua-language-server
attempt to concatenate a nil value (field 'sep') [I have workaround]
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
Hello. I'm getting this bug but I've add one if in template.lua and it works for me but I dont know is it good. I hope someone can help me become smarter.
How are you using the lua-language-server?
Other
Which OS are you using?
Windows
What is the issue affecting?
Completion
Expected Behaviour
Lua syntax suggestions
Actual Behaviour
No suggestion
Reproduction steps
- Im using lua-language-server-3.12.0-win32-x64.zip at windows 11 with custom monaco editor in react app and proxy https://github.com/wylieconlon/jsonrpc-ws-proxy
- Im just refreshing page with monaco editor
- i'm getting error
[12:57:54.533][error][#0:script\config\template.lua:157]: script\config\template.lua:157: attempt to concatenate a nil value (field 'sep')
stack traceback:
script\config\template.lua:157: in method 'loader'
script\config\config.lua:66: in function 'config.config.setByScope'
script\config\config.lua:217: in local 'expand'
script\config\config.lua:229: in function 'config.config.update'
script\provider\provider.lua:59: in function 'provider.updateConfig'
script\provider\provider.lua:142: in function <script\provider\provider.lua:140>
[C]: in function 'xpcall'
script\proto\proto.lua:202: in function <script\proto\proto.lua:177>
[12:58:12.112][warn] [#0:script\proto\proto.lua:189]: Method [textDocument/codeAction] takes [17.689]sec. {
_closeMessage = "Request cancelled.",
_closeReason = -32800,
id = 4,
jsonrpc = "2.0",
method = "textDocument/codeAction",
params = {
context = {
diagnostics = {},
triggerKind = 2
},
range = {
end = {
character = 0,
line = 0
},
start = {
character = 0,
line = 0
}
},
textDocument = {
uri = "file:///MY_PATH"
}
}
}
and no syntax suggestion
Additional Notes
I have simply wrote it in script/config/template.lua :
log.info(self.sep)
log.info("----- value-----")
log.info(value)
if self.sep then
log.info("----- self.sep 2 -----")
log.info(self.sep)
for s in value:gmatch('[^' .. self.sep .. ']+') do
t[s] = true
end
end```
now it works perfect
value is always
`configuredByTheme`
### Log File
[logs_bug.txt](https://github.com/user-attachments/files/17679384/logs_bug.txt)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at script/config/template.lua:157 and follow the config flow through script/config/config.lua, using the supplied stack trace and logs_bug.txt. Reproduce the refresh in the Windows 11 setup if possible, then verify that completion returns without the nil 'sep' error and that the relevant config path is covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100