LuaLS / LuaLS/lua-language-server
does not warn when insert an element with a wrong type into a string array
オープン
まだ誰も着手していません。
enhancement
feat/type check
- 主要言語
- Lua
- スター
- 4.4k
- フォーク
- 442
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Visual Studio Code拡張機能で、示されているtable.insertの例を使ってLuaファイル内の診断問題を再現します。table.insertの型チェックのエントリポイントを追跡し、123をstring[]に挿入すると警告が生成されることを確認してから、同じ再現を再度実行して診断を確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- lua
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 48/100