lua-language-server
lua-language-server copied to clipboard
Cannot inherit from class alias
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Annotations
Expected Behaviour
If I have an @alias
for a class, I expect it to be usable in inheritance for other classes, ex. @class MyNewClass : MyAlias
Actual Behaviour
The inheritance triggers undefined-doc-class
diagnostic although the alias can still be ctrl+clicked to go to its source.
Reproduction steps
Snippet that reproduces the issue:
---@class MyClass
---@alias MyAlias MyClass
-- Will trigger undefined-doc-class, though MyAlias can be ctrl+clicked to go to source.
---@class MyNewClass : MyAlias
Additional Notes
No response
Log File
Since ---@alias
annotations can stand for more than just ---@class
annotations, I vote for not implementing this feature and closing as won't fix.
What is the alias being used for? Why not just use the class's name?
What is the alias being used for? Why not just use the class's name?
---@alias MyAlias MyClass | AnotherClass