mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
eng: fix off-by-1 error in selfhost test error messages (#213081)
Fixes #212808
This commit is contained in:
parent
c00f2792a4
commit
7828baaa8e
|
@ -204,7 +204,7 @@ export async function scanTestOutput(
|
|||
return;
|
||||
}
|
||||
|
||||
const logLocation = store.getSourceLocation(match[2], Number(match[3]));
|
||||
const logLocation = store.getSourceLocation(match[2], Number(match[3]) - 1);
|
||||
const logContents = replaceAllLocations(store, match[1]);
|
||||
const test = currentTest;
|
||||
|
||||
|
@ -459,7 +459,8 @@ export class SourceMapStore {
|
|||
};
|
||||
}
|
||||
|
||||
async getSourceLocation(fileUri: string, line: number, col = 1) {
|
||||
/** Gets an original location from a base 0 line and column */
|
||||
async getSourceLocation(fileUri: string, line: number, col = 0) {
|
||||
return this.getSourceLocationMapper(fileUri).then(m => m(line, col));
|
||||
}
|
||||
|
||||
|
@ -599,5 +600,5 @@ async function tryDeriveStackLocation(
|
|||
|
||||
async function deriveSourceLocation(store: SourceMapStore, parts: RegExpMatchArray) {
|
||||
const [, fileUri, line, col] = parts;
|
||||
return store.getSourceLocation(fileUri, Number(line), Number(col));
|
||||
return store.getSourceLocation(fileUri, Number(line) - 1, Number(col));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue