LuaLS / LuaLS/lua-language-server
Proper Parameter Support for Class Inheritance via "require" in "lua-language-server"
還沒有人認領這個 Issue。
- 主要語言
- 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.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
未指定來源檔案或測試。首先追蹤 Lua.runtime.special 如何處理 require 參數,以及如何為 class("DemoComp", require("BaseComp")) 推導類別繼承提示;當語言伺服器將所需模組識別為基底類別並提供準確的類別名稱提示時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- lua
- 領域
- tooling
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100