Skip to content

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

@xzzwandi

Description

@xzzwandi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUser has a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions