LuaLS / LuaLS/lua-language-server

Proper Parameter Support for Class Inheritance via "require" in "lua-language-server"

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

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

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

説明

Overview:
I'm using the "lua-language-server" plugin and encountering an issue with class inheritance notation. The inheritance is performed using the syntax class("DemoComp", require("BaseComp")).

Problem Description:
The issue lies in the way "lua-language-server" handles the require function within the class inheritance context. Despite configuring the "Lua.runtime.special" settings, the plugin does not provide accurate hints for classes defined this way. This is because require requires the script path as its first parameter to function properly, making the standard configuration ineffective.

Desired Solution:
I'd like to suggest enhancing the "lua-language-server" plugin's ability to correctly parse and provide class name hints even in cases where class inheritance is written in the form of class("DemoComp", require("BaseComp")).

Suggested Approach:
To achieve this, the plugin could be designed to recognize and parse the parameters of the require function, allowing it to accurately determine the base class in class inheritance scenarios involving require.

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

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

はじめの一歩

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

調査の方向性

ソースファイルもテストも指定されていません。まず、Lua.runtime.special が require パラメーターをどのように処理するか、また class("DemoComp", require("BaseComp")) に対するクラス継承のヒントがどのように導出されるかを追跡します。言語サーバーが要求されたモジュールを基底クラスとして識別し、正確なクラス名のヒントを提供できれば完了です。

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

評価

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

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

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