IntelliJ-EmmyLua icon indicating copy to clipboard operation
IntelliJ-EmmyLua copied to clipboard

Alias: No usages found in Project and Libraries

Open nfet opened this issue 2 years ago • 1 comments

Environment(环境)

name version
IDEA version 2023.1.2
EmmyLua version 1.4.3-IDEA231
OS MacOS Ventura 13.4

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

  1. See Given Example Alias Class Structure Below
--- @class A
local A = {
    methodA = function()  end
}

--- @class B
local B = {
    methodB = function()  end
}
--- @alias AB A|B

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

--- @type AB
local o = {}

o.methodA()
o.methodB()

Main Bug:

  1. Mouse or cursor on o.methodA() and use Go to Declaration or Usages (CMD + Click or CMD+B) on the o.methodA()
    • Result: Works as Expected
  2. Mouse or cursor on o.methodB() and use Go to Declaration or Usages (CMD + Click or CMD+B) on the o.methodB()
    • Result: Renders "No usages found in Project and Libraries"

Alternate Event:

Switch alias to B occurring first before A

--- @alias AB B|A

Then Go to Declaration on o.methodA() no longer works and o.methodB() works because it's declared first on the alias. It seems that the "Go to Declaration or Usages" is only honoring the first alias and ignores all others.

  1. Mouse or cursor on o.methodA() and use Go to Declaration or Usages (CMD + Click or CMD+B) on the o.methodA()
    • Result: Renders "No usages found in Project and Libraries"
  2. Mouse or cursor on o.methodB() and use Go to Declaration or Usages (CMD + Click or CMD+B) on the o.methodB()
    • Result: Works as Expected

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

  • none

Any other comments?(其它说明)

nfet avatar Jun 08 '23 16:06 nfet

Got the same problem, had to downgrade to IntelliJ-EmmyLua-1.3.11-IDEA231

Shinzuh avatar Jun 13 '23 08:06 Shinzuh