Fix: deal with dashes in the path
This commit is contained in:
parent
e8e4ae1f47
commit
5127609120
1 changed files with 4 additions and 4 deletions
|
@ -1524,7 +1524,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
const error = new Error("No error")
|
||||
const stack = error.stack.split("\n")
|
||||
stack.shift() // Remove "Error: No error"
|
||||
const regex = /at (.*) \(([a-zA-Z0-9/.]+):([0-9]+):([0-9]+)\)/
|
||||
const regex = /at (.*) \(([a-zA-Z0-9-/.]+):([0-9]+):([0-9]+)\)/
|
||||
const stackItem = stack[Math.abs(offset) + 1]
|
||||
|
||||
let functionName: string
|
||||
|
@ -1534,10 +1534,10 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
let _: string
|
||||
const matchWithFuncName = stackItem.match(regex)
|
||||
if (matchWithFuncName) {
|
||||
;[_, functionName, path, line, column] = matchWithFuncName
|
||||
[_, functionName, path, line, column] = matchWithFuncName
|
||||
} else {
|
||||
const regexNoFuncName: RegExp = new RegExp("at ([a-zA-Z0-9/.]+):([0-9]+):([0-9]+)")
|
||||
;[_, path, line, column] = stackItem.match(regexNoFuncName)
|
||||
const regexNoFuncName: RegExp = new RegExp("at ([a-zA-Z0-9-/.]+):([0-9]+):([0-9]+)");
|
||||
[_, path, line, column] = stackItem.match(regexNoFuncName)
|
||||
}
|
||||
|
||||
const markdownLocation = path.substring(path.indexOf("MapComplete/src") + 11) + "#L" + line
|
||||
|
|
Loading…
Reference in a new issue