LuaLS / LuaLS/lua-language-server

泛型和alias联合使用的问题

Open
#3,196 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

Issue Description

Image

Additional Notes

使用泛型返回alias类型似乎没有办法正确的返回类型, 我希望在new中传入类名创建对象,并且强制调用init才能返回对象,不过没有找到正确的注释办法

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named; start by reproducing the generic-and-alias type result described in the issue and tracing the language server's handling of the new call and init. Done means the annotation expresses the intended class-name construction and the returned object type is inferred correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.