EmmyLua / IntelliJ-EmmyLua

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

Rider中lua core同时存在于package和工程目录时,跳转定义识别错误 #492

Open EthanWang1108 opened 2 years ago

EthanWang1108 commented 2 years ago

Environment(环境)

name version
IDEA version Rider 2021.2.3 & 2022.2.1
EmmyLua version v1.3.6.251
OS Windows 10

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

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

  1. 把lua core文件打成package发布,package manager里下载package,下载成功后会自动把lua相关文件拷贝一份放到工程目录Assets/Scripts/Lua 和 Assets/Scripts/LuaCore中,在写lua的时候跳转定义跳转的是package里面的lua文件
  2. 同时如果package中没有的lua文件,比如业务逻辑脚本等,就无法跳转了,也没有代码补齐提示

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

正确跳转定义,显示代码提示

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

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Any other comments?(其它说明)

感谢大佬!

CppCXY commented 2 years ago

先确认自己在unity C# generation里面加了lua没有,如果没加就加上然后重新生成项目 sln

EthanWang1108 commented 2 years ago

操作之后可以跳转定义、显示代码提示了。但是对于package和工程里面都有的文件,他默认跳转的还是package里面的,这个有办法解决么?

CppCXY commented 2 years ago

跳转会以定义---@class的优先,

EthanWang1108 commented 2 years ago

我新建了测试脚本

local TestLua = {}

function TestLua:Init()
    ScrollGrid:Init()
end

return TestLua

把工程内的脚本加了---@class注释

---@class ScrollGrid
ScrollGrid = {}

但是跳转后还是跳到了package里面的脚本里,从任一的ScrollGrid脚本中点击跳转可以识别到工程里和pakcage里的引用,我是不是应该在rider里面想办法把生成的.csproj文件忽略一下?

CppCXY commented 2 years ago

或许可以在rider的编辑器设置里面忽略一部分lua文件

EthanWang1108 commented 2 years ago

rider设置中忽略文件夹完美解决了问题,现在也不需要在每个上面标注---@class了,十分感谢!