LuaLS / LuaLS/lua-language-server

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

Đang mở
#2,944 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Lua
Star
4.4k
Fork
442
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu từ script/config/template.lua:157 và lần theo luồng cấu hình qua script/config/config.lua, sử dụng stack trace được cung cấp và logs_bug.txt. Nếu có thể, hãy tái hiện việc làm mới trong thiết lập Windows 11, sau đó xác minh rằng tính năng hoàn tất trả về mà không gặp lỗi nil 'sep' và rằng đường dẫn cấu hình liên quan được bao phủ bởi một bài kiểm thử phù hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
lua
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.