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

提案:一个project中的多个modules如果定义了相同class将会混淆

Open onlonely opened this issue 5 years ago • 0 comments

Environment(环境) EmmyLua version | [e.g. v1.3.5.194-IDEA203] OS | [e.g. Windows 10]

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

1.假设我创建项目A,再添加模块B和C 2. 在模块B中有D.lua文件 ---@class D local M = {} function M.call() print('B') end return M 3.在模块C中有D.lua文件 ---@class D local M = {} function M.call() print('C') end return M

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

在模块C中有test.lua文件 local m = require("D") m.call() 此时ctrl+鼠标左键点击 call方法,跳转到的文件是模块B中的D.lua文件

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

一般情况下除了公共的lib都应该是归属模块级别的,就算一个project下多个module定义了相同class都不应该混淆

以上测试如果在java类型项目中就可以正常跳转到模块C中的D.lua文件

此问题会大量出现在某个lib在多个module中的时候,此时就要开启多个idea实例来编辑,才能不会跳转错误

onlonely avatar Jan 27 '21 07:01 onlonely