Skip to content

Commit eeb3a1d

Browse files
committed
Merge branch 'topic/gnatcov' into 'master'
Fix exclusion of object dir when loading coverage reports See merge request eng/ide/ada_language_server!1996
2 parents 0bd72df + 47971a5 commit eeb3a1d

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

integration/vscode/ada/src/gnatcov.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -385,22 +385,25 @@ export async function addCoverageData(run: vscode.TestRun, covDir: string) {
385385
}
386386

387387
if (srcUri === undefined) {
388+
/**
389+
* Avoid searching in the object dir because we
390+
* might land on gnatcov-instrumented versions
391+
* of the sources.
392+
*/
393+
const exclude = `${await adaExtState
394+
.getObjectDir()
395+
.then(vscode.workspace.asRelativePath)
396+
.then((objDir) => `${objDir}/**/*`)
397+
.catch(() => null)}`;
398+
388399
/**
389400
* If the prefixes haven't been found yet, or
390401
* the last prefixes used were not successful,
391402
* try a workspace lookup of the basename.
392403
*/
393404
const found = await vscode.workspace.findFiles(
394405
`**/${path.posix.basename(posixForeignPath)}`,
395-
/**
396-
* Avoid searching in the object dir because we
397-
* might land on gnatcov-instrumented versions
398-
* of the sources.
399-
*/
400-
`${await adaExtState
401-
.getObjectDir()
402-
.then((objDir) => `${objDir}/**/*`)
403-
.catch(() => null)}`,
406+
exclude,
404407
1,
405408
token,
406409
);

0 commit comments

Comments
 (0)