Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

VM.OnCompileFunctionParam does not work at all

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

Dieses Issue hat noch niemand übernommen.

Bewertung

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

Rechercherichtung

Beginne mit der Plugin-Reproduktion in plugin.lua und dem in script\plugin.lua:157 referenzierten Ladepfad und vergleiche anschließend den dokumentierten Einstiegspunkt VM.OnCompileFunctionParam mit dem funktionierenden OnSetText-Hook. Reproduziere den nil-VM-Fehler mit der gezeigten .vscode/settings.json-Konfiguration. Als abgeschlossen gilt die Aufgabe, wenn der Callback definiert und aufgerufen werden kann, ohne dass der globale VM-Fehler auftritt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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?

Plugins

Expected Behaviour

According to https://luals.github.io/wiki/plugins/#vmoncompilefunctionparam, VM.OnCompileFunctionParam() is supposed to work.

Actual Behaviour

It simply does not work, and throws this error instead:

2026-01-28 20:58:08.342 [info] C:\Path\plugin.lua:4: attempt to index a nil value (global 'VM')
stack traceback:
	C:\Path\plugin.lua:4: in main chunk
	[C]: in global 'xpcall'
	script\plugin.lua:157: in function <script\plugin.lua:95>

2026-01-28 20:58:08.348 [info] [Error - 8:58:08 PM] An error occurred in the plugin, please report it to the plugin author.
Please check the details in the output or log.
Plugin path: C:\Path\plugin.lua
Reproduction steps
  1. Write function VM.OnCompileFunctionParam(next, func, param) end in plugin.lua
  2. Add "Lua.runtime.plugin": "C:/Path/plugin.lua" to .vscode/settings.json or similar
  3. The error happens
Additional Notes

Please note that OnSetText() works as advertised, so the plugin system works; it is only this specific feature that does not seem to be working correctly.

For context, my library has JS-style event callbacks that work roughly like this:

addHook("PlayerUpdate", function(player)
end)

As you probably guessed already, I was hoping to use VM.OnCompileFunctionParam() to make it detect the parameter's type without requiring explicitly annotations, since generics do not seem to support this pattern at the moment?
I could also use OnSetText() instead, but it sounds like a less reliable method as it depends on the formatting, and it would also cause a warning about duplicate annotations if the user typed the ---@param explicitly.

Log File

No response

Vorherrschende Sprache
Lua
Sterne
4.4k
Forks
442
Ø Merge
8 T. 9 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus LuaLS/lua-language-server

Alle Issues in LuaLS/lua-language-server

Ähnliche Issues

Weitere Issues zu Lua

Neue Issues direkt in Ihr Postfach

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