LuaLS / LuaLS/lua-language-server

Enhancement ---@fieldread, ---@fieldwrite or attribute modifiers on typing

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

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

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

説明

When using some c api's (In my case Factorio's modding api) when you retrieve a value you get one type, but you can set it with multiple different types.

---@class Surface
---@class Player
local Player = {}
---@fieldread surface Surface
---@fieldwrite surface Surface|string

local p = Player.surface --- p is Surface
p.surface = "Other Surface" --No warnings

Another thought I had was attribute types, which would more easily support more attributes in the future

---@field{read} surface Surface
---@field{write} surface Surface|string
---@field{read,write} surface -- the default if no attributes are supplied

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

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

はじめの一歩

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

調査の方向性

この issue では、ファイル、テスト、エントリポイントが指定されていません。まず language server における Lua のフィールドアノテーションと型チェックの処理箇所を特定し、次に提案されている @fieldread/@fieldwrite 構文および属性構文を既存のアノテーションの挙動と比較してください。読み取り型と書き込み型を別々にサポートし、期待される警告の挙動を生成する構文が決定されれば完了です。

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

評価

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

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

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