LuaLS / LuaLS/lua-language-server

does not warn when insert an element with a wrong type into a string array

オープン
#2,095 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

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
image

Reproduction steps
  1. goto vscode
  2. install the latest version of the plugin
  3. 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
  1. there is no warnings
Additional Notes

No response

Log File

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Visual Studio Code拡張機能で、示されているtable.insertの例を使ってLuaファイル内の診断問題を再現します。table.insertの型チェックのエントリポイントを追跡し、123をstring[]に挿入すると警告が生成されることを確認してから、同じ再現を再度実行して診断を確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
lua
領域
devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。