LuaLS / LuaLS/lua-language-server

fun类型问题

Open
#3,179 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

在---@overload fun(data:T):T 这种注释的情况下貌似没有办法使用泛型, 我需要

![Image](https://github.com/user-attachments/assets/54d151d3-0e02-4e48-b511-1fde1722464c)
在cast_shot中识别到自己定义的字段类型,有使用泛型以外其他的办法吗

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

The report names the @overload fun(data:T):T annotation and the cast_shot entry point, but no source files or tests. Start by reproducing the generic-type behavior at cast_shot and trace how the language server resolves the custom field type there. Done means either generic overloads recognize that field type or a documented alternative is provided.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.