From f0ba2dac1c2b0c7a7649cf7ccd8bdba80aeaa818 Mon Sep 17 00:00:00 2001 From: Michael Aquilina Date: Wed, 27 Mar 2024 16:55:55 +0000 Subject: [PATCH] use path.relative --- .../views/suggestion/codeSuggestionWebviewProvider.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts index bfafb044d..d466b3e6d 100644 --- a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts +++ b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts @@ -1,4 +1,5 @@ -import _, { forEach } from 'lodash'; +import _ from 'lodash'; +import { relative } from "path" import { applyPatch } from 'diff'; import { marked } from 'marked'; import * as vscode from 'vscode'; @@ -22,7 +23,6 @@ import { ILog } from '../../../common/logger/interfaces'; import { messages as learnMessages } from '../../../common/messages/learn'; import { LearnService } from '../../../common/services/learnService'; import { getNonce } from '../../../common/views/nonce'; -import { WebviewPanelSerializer } from '../../../common/views/webviewPanelSerializer'; import { WebviewProvider } from '../../../common/views/webviewProvider'; import { ExtensionContext } from '../../../common/vscode/extensionContext'; import { IVSCodeLanguages } from '../../../common/vscode/languages'; @@ -173,7 +173,7 @@ export class CodeSuggestionWebviewProvider return { id: issue.id, title: issue.title, - uri: issue.filePath.replace(workspaceFolder + '/', ''), + uri: relative(workspaceFolder, issue.filePath), severity: _.capitalize(issue.severity), ...issue.additionalData, text: parsedDetails, @@ -439,7 +439,7 @@ export class CodeSuggestionWebviewProvider

⚡ Fix this issue by generating a solution using Snyk DeepCode AI

- +