LuaLS / LuaLS/lua-language-server

[Feature Request] ---@final to mark class method as non-overridable

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

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

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

説明

In languages like Java, you have the keyword final to indicate that a function should NOT be overridden. There doesn't seem to be any annotation like that yet. It should give a warning (or error?) if you try to override the function. Additionally, completion for function MyClass: could avoid suggesting anything with @final? You'd still be able to call it anywhere, just not override it if its now final.

(Maybe @final could also work on variables? Pretty much working the same way, just "don't override/set this but still be able to read it")

(Unrelated but I was thinking about ---@override to mark something as "you should override this and not call this" but it wouldn't be able to warn since your internal code needs to call it, so I'm not sure. Might just be good to have anyway, not as a warning but a tooltip thing.)

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

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

はじめの一歩

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

調査の方向性

ソースファイル、テスト、エントリポイントのいずれも指定されていません。まず、@final がメソッド、変数、またはその両方に適用されるのか、また違反によって警告またはエラーが生成されるのかを明確にしてから、言語サーバーのアノテーション、オーバーライドチェック、補完の挙動を調査してください。選択したセマンティクスが一貫して実装され、診断または補完のテストでカバーされていれば完了です。

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

評価

技術スタック
lua
領域
devtools
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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