LuaLS / LuaLS/lua-language-server

attempt to concatenate a nil value (field 'sep') [I have workaround]

未关闭
#2,944 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Lua
星标
4.4k
派生
442
PR 合并指标
30 天内没有已合并 PR

描述

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
  1. 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
  2. Im just refreshing page with monaco editor
  3. 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)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 script/config/template.lua:157 开始,使用提供的堆栈跟踪和 logs_bug.txt,沿着 script/config/config.lua 追踪配置流程。如果可能,在 Windows 11 设置中重现刷新操作,然后验证补全能够返回且不会出现 nil 'sep' 错误,并确认相关配置路径已由适当的测试覆盖。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua
领域
devtools
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。