@@ -74,11 +74,13 @@ export async function listScanResults(
7474 for ( const [ key , issues ] of codeScanIssueMap . entries ( ) ) {
7575 // Project path example: /Users/username/project
7676 // Key example: project/src/main/java/com/example/App.java
77+ const mappedProjectPaths : Set < string > = new Set ( )
7778 for ( const projectPath of projectPaths ) {
7879 // We need to remove the project path from the key to get the absolute path to the file
7980 // Do not use .. in between because there could be multiple project paths in the same parent dir.
8081 const filePath = path . join ( projectPath , key . split ( '/' ) . slice ( 1 ) . join ( '/' ) )
8182 if ( existsSync ( filePath ) && statSync ( filePath ) . isFile ( ) ) {
83+ mappedProjectPaths . add ( filePath )
8284 const document = await vscode . workspace . openTextDocument ( filePath )
8385 const aggregatedCodeScanIssue : AggregatedCodeScanIssue = {
8486 filePath : filePath ,
@@ -88,7 +90,11 @@ export async function listScanResults(
8890 }
8991 }
9092 const maybeAbsolutePath = `/${ key } `
91- if ( existsSync ( maybeAbsolutePath ) && statSync ( maybeAbsolutePath ) . isFile ( ) ) {
93+ if (
94+ ! mappedProjectPaths . has ( maybeAbsolutePath ) &&
95+ existsSync ( maybeAbsolutePath ) &&
96+ statSync ( maybeAbsolutePath ) . isFile ( )
97+ ) {
9298 const document = await vscode . workspace . openTextDocument ( maybeAbsolutePath )
9399 const aggregatedCodeScanIssue : AggregatedCodeScanIssue = {
94100 filePath : maybeAbsolutePath ,
0 commit comments