LuaLS / LuaLS/lua-language-server
does not warn when insert an element with a wrong type into a string array
Offen
Dieses Issue hat noch niemand übernommen.
enhancement
feat/type check
- Vorherrschende Sprache
- Lua
- Sterne
- 4.4k
- Forks
- 442
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
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?
Diagnostics/Syntax Checking
Expected Behaviour
the code:
---@type string[]
local test = {}
table.insert(test, 123) -- should warn me when i try to insert an element with a wrong type
Actual Behaviour
does not warn

Reproduction steps
- goto vscode
- install the latest version of the plugin
- new a lua file with the code below
---@type string[]
local test = {}
table.insert(test, 123) -- should warn me when i try to insert an element with a wrong type
- there is no warnings
Additional Notes
No response
Log File
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Diagnoseproblem in einer Lua-Datei mithilfe des gezeigten table.insert-Beispiels in der Visual Studio Code-Erweiterung. Verfolge den Einstiegspunkt der Typprüfung von table.insert und überprüfe, dass das Einfügen von 123 in ein string[] eine Warnung erzeugt. Führe anschließend dieselbe Reproduktion erneut aus, um die Diagnose zu bestätigen.
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
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100