Skip to content

Commit

Permalink
Merge branch 'feat/display-ai-fix' of https://github.com/snyk/vscode-…
Browse files Browse the repository at this point in the history
…extension into feat/display-ai-fix
  • Loading branch information
andygongea committed Mar 15, 2024
2 parents bdbf03a + b086043 commit 0a81323
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 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 = ""

Check failure on line 167 in src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

Replace `""` with `'';`
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 Expand Up @@ -229,7 +227,6 @@ export class CodeSuggestionWebviewProvider
}
case 'getAutofixDiffs': {
const suggestion = args.suggestion as Suggestion
// const vscodeUri = vscode.Uri.file(uri);
console.log('getAutofixDiffs', suggestion.folderPath, suggestion.uri, this.openIssueId); // TODO remove
const diffs: AutofixUnifiedDiffSuggestion = await vscode.commands.executeCommand(
SNYK_CODE_FIX_DIFFS_COMMAND,
Expand All @@ -238,7 +235,7 @@ export class CodeSuggestionWebviewProvider
this.openIssueId,
);
console.log('posting diffs', diffs); // TODO remove
void this.panel?.webview.postMessage({ type: 'setAutofixDiff', args: diffs });
void this.panel?.webview.postMessage({ type: 'setAutofixDiffs', args: diffs });
break;
}
default: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ declare const acquireVsCodeApi: any;
}
sendMessage(message)
toggleLoading("hide");
}, 1500);
}, 15000);
}

function sendMessage(message: {
Expand Down

0 comments on commit 0a81323

Please sign in to comment.