diff --git a/debuggee/vscode-debuggee.lua b/debuggee/vscode-debuggee.lua index 61b47fb..d5ad228 100644 --- a/debuggee/vscode-debuggee.lua +++ b/debuggee/vscode-debuggee.lua @@ -18,6 +18,7 @@ local redirectedPrintFunction = nil local onError = nil local addUserdataVar = nil +local resolveChunkPath = nil local function defaultOnError(e) print('****************************************************') @@ -334,7 +335,9 @@ local function createPureBreaker() if cached then return cached end - + if string.sub(chunkname, 1, 1) ~= '@' then + chunkname = resolveChunkPath(chunkname) + end local splitedReqPath = splitChunkName(chunkname) local maxMatchCount = 0 local foundPath = nil @@ -493,6 +496,7 @@ function debuggee.start(jsonLib, config) local redirectPrint = config.redirectPrint or false dumpCommunication = config.dumpCommunication or false ignoreFirstFrameInC = config.ignoreFirstFrameInC or false + resolveChunkPath = config.resolveChunkPath or function(name) return name end if not config.luaStyleLog then valueToString = function(value) return json.encode(value) end end @@ -791,6 +795,8 @@ function handlers.stackTrace(req) local src = info.source if string.sub(src, 1, 1) == '@' then src = string.sub(src, 2) -- 앞의 '@' 떼어내기 + else + src = resolveChunkPath(src) end local name