@@ -74,11 +74,13 @@ export async function listScanResults(
74
74
for ( const [ key , issues ] of codeScanIssueMap . entries ( ) ) {
75
75
// Project path example: /Users/username/project
76
76
// Key example: project/src/main/java/com/example/App.java
77
+ const mappedProjectPaths : Set < string > = new Set ( )
77
78
for ( const projectPath of projectPaths ) {
78
79
// We need to remove the project path from the key to get the absolute path to the file
79
80
// Do not use .. in between because there could be multiple project paths in the same parent dir.
80
81
const filePath = path . join ( projectPath , key . split ( '/' ) . slice ( 1 ) . join ( '/' ) )
81
82
if ( existsSync ( filePath ) && statSync ( filePath ) . isFile ( ) ) {
83
+ mappedProjectPaths . add ( filePath )
82
84
const document = await vscode . workspace . openTextDocument ( filePath )
83
85
const aggregatedCodeScanIssue : AggregatedCodeScanIssue = {
84
86
filePath : filePath ,
@@ -88,7 +90,11 @@ export async function listScanResults(
88
90
}
89
91
}
90
92
const maybeAbsolutePath = `/${ key } `
91
- if ( existsSync ( maybeAbsolutePath ) && statSync ( maybeAbsolutePath ) . isFile ( ) ) {
93
+ if (
94
+ ! mappedProjectPaths . has ( maybeAbsolutePath ) &&
95
+ existsSync ( maybeAbsolutePath ) &&
96
+ statSync ( maybeAbsolutePath ) . isFile ( )
97
+ ) {
92
98
const document = await vscode . workspace . openTextDocument ( maybeAbsolutePath )
93
99
const aggregatedCodeScanIssue : AggregatedCodeScanIssue = {
94
100
filePath : maybeAbsolutePath ,
0 commit comments