LuaLS / LuaLS/lua-language-server

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

Offen
#2,944 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Lua
Sterne
4.4k
Forks
442
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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)

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei script/config/template.lua:157 und verfolge den Konfigurationsfluss durch script/config/config.lua anhand des bereitgestellten Stacktraces und von logs_bug.txt. Reproduziere die Aktualisierung nach Möglichkeit in der Windows-11-Umgebung und überprüfe anschließend, dass die Vervollständigung ohne den nil-'sep'-Fehler zurückkehrt und dass der relevante Konfigurationspfad durch einen geeigneten Test abgedeckt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.