LuaPanda icon indicating copy to clipboard operation
LuaPanda copied to clipboard

使用了distinguishSameNameFile=true,truncatedOPath过滤公共串后,同名文件正则识别错误(没有处理"["、"]")

Open weng7654 opened this issue 1 year ago • 2 comments

使用testBreakpoint,能显示匹配串,但是文件名包含[ ]这样的正则表达式,没有转义: 消息如下: "

  • BreakPoint Test: User set lua extension: . Auto get lua extension: .lua User set truncatedOPath: test1/0 GetInfo: @E:/test1.0/spec/[xxxx]test.lua Normalized: /spec/[xxxx]test.lua Formated: [xxxx]test.lua Breakpoint: e:/test1.0/spec/[xxxx]test.lua 说明:自动路径(autoPathMode)模式已开启。同名文件中的断点识别(distinguishSameNameFile) 已开启。本文件中断点可被正常命中"

但是代码luaPanda命中短点逻辑this.isHitBreakpoint函数中 if (not distinguishSameNameFile) or (string.match(fullpath, oPathFormated ) and this.checkRealHitBreakpoint(opath, curLine)) then .....

string.match(fullpath, oPathFormated ) 这里会永久返回nil,测试发现是文件名包含正则表达式[ ] 导致的,导致断点无法命中

weng7654 avatar Oct 09 '23 07:10 weng7654