Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot inherit from class alias #2623

Open
PinewoodPip opened this issue Apr 20, 2024 · 2 comments
Open

Cannot inherit from class alias #2623

PinewoodPip opened this issue Apr 20, 2024 · 2 comments

Comments

@PinewoodPip
Copy link

PinewoodPip commented Apr 20, 2024

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

service.log

@C3pa
Copy link
Contributor

C3pa commented Apr 22, 2024

Since ---@alias annotations can stand for more than just ---@class annotations, I vote for not implementing this feature and closing as won't fix.

@Krunklehorn
Copy link

What is the alias being used for? Why not just use the class's name?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants