EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.74k stars 293 forks source link

Table value types forgotten when defined in function call #426

Open galsjel opened 3 years ago

galsjel commented 3 years ago

Environment(环境)

name version
IDEA version GoLand 2021.1.1
EmmyLua version 1.3.6.215-IDEA211
OS Windows 10

What are the steps to reproduce this issue?(重现步骤?)

  1. Define
    
    ---@alias MyTable table<string, fun(arg1:number, arg2:string)>

---@param a MyTable function test(a) end


2. Write function call with table using autofill
```lua
test({
    ["test"] = function()  end -- does not auto fill here or know what type ["test"] is
})

What happens?(出现什么问题?)

Autofill is not aware of value type. image

What were you expecting to happen?(期望?)

image

Any logs, error output, etc?(有没有什么log, error输出?)

No

Any other comments?(其它说明)

This removes the capability of function parameter types when used as specified in the reproduction section.

adriweb commented 3 years ago

I hate to pull the "use the fork" card, but you might have more luck on https://github.com/Benjamin-Dobell/IntelliJ-Luanalysis until it's fixed here.