LuaLS / LuaLS/lua-language-server

Feature Request: Missing Field Diagnostic on Non-Class Table Types

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

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

主要言語
Lua
スター
4.4k
フォーク
442
PR マージ指標
30日以内にマージされた PR はありません

説明

(Split from: https://github.com/LuaLS/lua-language-server/issues/2279)
Currently the missing-field diagnostic only works for classes. I sometimes use tables directly instead of classes and it would be nice to still be able to get missing-field warnings:

Ex:
```
---@param audience { [0]: "SELECT", ["peer_ids"]: string | string[] } who to send event to
function Events.send_event(audience, event, ...)
end

Events.send_event({})
```
and
```
---@param audience { [0]: "SELECT", peer_ids: string | string[] } who to send event to
function Events.send_event(audience, event, ...)
end

Events.send_event({})
```
gives no errors

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

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

はじめの一歩

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

調査の方向性

Start by reproducing the two Events.send_event examples from the issue and inspect the existing missing-field diagnostic behavior for classes. Trace how the table parameter types in those examples are analyzed, then verify that calls passing {} report the required fields without changing the existing class behavior.

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

評価

技術スタック
lua
領域
devtools
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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