Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调试器没有找到文件 lua.lua 。 请检查launch.json文件中lua后缀是否配置正确, 以及VSCode打开的工程是否正确 #150

Open
Zheng-Hongyi opened this issue Jun 2, 2022 · 4 comments

Comments

@Zheng-Hongyi
Copy link

No description provided.

@Zheng-Hongyi
Copy link
Author

“调试器没有找到文件 lua.lua 。 请检查launch.json文件中lua后缀是否配置正确, 以及VSCode打开的工程是否正确”,然后在打断点的地方不会停住

@stuartwang
Copy link
Collaborator

看起来是因为调试器获取到的文件名是lua, 这个名称应该是错误的。
加载lua文件时,接口会要求传入一个文件名,这个名称最终被调试器hook捕获,作为断点判断的依据。可以看一下框架这里传入的文件名是否有错误
image

@sweezt
Copy link

sweezt commented Aug 29, 2022

我也遇到了同样的问题,后来发觉是LuaConst.cs文件下面的openLuaDebugger = false没有打开,把这个变量设为true就行了,但是我在我另一台电脑上这样操作以后又出现了新的问题,调试的时候提示无法加载源len.lua,并会报一个“Lua文件名不匹配Lua/libpdebug.lua"的错

@lixiandea
Copy link

我找到了这个问题的bug修复,一般情况下是你的luaFileExtention配置没有带上文件的分隔符,导致

function this.changePotToSep(filePath, ext)
    local idx = filePath:find(ext, (-1) * ext:len() , true)
    if idx then 
        local tmp = filePath:sub(1, idx - 1):gsub("%.", "/");
        filePath = tmp .. ext;
    end
    return filePath;
end

这个方法解析出来的路径是类似于dir/lua的形式。进而变成了文件名为lua.lua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants