Skip to content

Commit

Permalink
fix: generate correct folderPath and filePath
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelAquilina committed Mar 15, 2024
1 parent 7061cb3 commit b086043
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,21 @@ export class CodeSuggestionWebviewProvider
// get the workspace folders
// look at the filepath and identify the folder that contains the filepath
let workspaceFolder = ""
for (let i = 0; i < this.workspace.getWorkspaceFolders.length; i++) {
const element = this.workspace.getWorkspaceFolders[i];
for (const element of this.workspace.getWorkspaceFolders()) {
if (issue.filePath.startsWith(element)){
workspaceFolder = element;
break
}
}
this.workspace.getWorkspaceFolders
return {
id: issue.id,
title: issue.title,
uri: issue.filePath,
uri: issue.filePath.replace(workspaceFolder + "/", ""),
severity: _.capitalize(issue.severity),
...issue.additionalData,
text: parsedDetails,
hasAIFix: issue.additionalData.hasAIFix,
folderPath: workspaceFolder
folderPath: workspaceFolder,
};
}

Expand Down

0 comments on commit b086043

Please sign in to comment.