LuaLS / LuaLS/lua-language-server

函数参数设置为 alias[] or enum[] 类型, 在调用时无提示

Open
#2,571 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### 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?

Other

### Expected Behaviour

---@alias 测试类型 "1"|"2"

---@alias 测试类型[]
local function 测试(参数) end

测试({"这里提示值","1"})

---@type 测试类型[]
local a = {"这里提示值","2"}

### Actual Behaviour

---@alias 测试类型 "1"|"2"

---@alias 测试类型[]
local function 测试(参数) end

测试({"函数参数类型","在这里没有提示"})

---@type 测试类型[]
local a = {"标注type的没BUG","可以正常体质"}

### Reproduction steps

复制上面内容即可复现测试

### Additional Notes

_No response_

### Log File

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the Visual Studio Code extension using the alias[] example from the report, then trace parameter type inference and completion for the function call. Done means calls using an alias[] or enum[] parameter provide the same value suggestions that the explicit @type annotation provides.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.