Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Debugger/LuaPanda.lua
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,14 @@ function this.printToConsole(str, printLevel)
print("[LuaPanda] ".. tostring(str));
end

function this.getBkSuffix(str)
-- 模式说明:
-- %.: 匹配第一个小数点(转义处理)
-- (.*): 捕获小数点后所有内容(包括后续的点和字符),支持.lua.txt这种格式
-- $: 锚定到字符串结尾
return str:match("%.(.*)$") or "";
end

-----------------------------------------------------------------------------
-- 提升兼容性方法
-----------------------------------------------------------------------------
Expand Down Expand Up @@ -1096,6 +1104,14 @@ function this.dataProcess( dataStr )
fakeBreakPointCache = {}
local bkPath = dataTable.info.path;
bkPath = this.genUnifiedPath(bkPath);

-- 断点所在的脚本文件的后缀名
local bkSuffix = this.getBkSuffix(bkPath)
if bkSuffix ~= "" and bkSuffix ~= luaFileExtension then
this.printToVSCode("[Warn] 断点所在的脚本文件与用户设置的luaFileExtension不一致!",1);
luaFileExtension = bkSuffix;
end

if testBreakpointFlag then
recordBreakPointPath = bkPath;
end
Expand Down