From 7d7e3c0d91f4e328d6748360218962a1a3eda6d8 Mon Sep 17 00:00:00 2001 From: Abdelrahman Shawki Hassan Date: Tue, 11 Jun 2024 15:29:53 +0200 Subject: [PATCH] fix: use fspath to get correct path [IDE-398] (#469) * fix: use fspath to get correct path * chore: update changelog --- CHANGELOG.md | 3 +++ .../views/suggestion/codeSuggestionWebviewProvider.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 996729ed3..a32fffd00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Snyk Security Changelog +## [2.12.1] +- Fix Code Suggestion rendering issue on Windows. + ## [2.12.0] - Renders the AI Fix panel and adds more custom styling for VSCode. - Adds position line interaction. diff --git a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts index 82e57bd0a..d834b6dd3 100644 --- a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts +++ b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts @@ -127,7 +127,7 @@ export class CodeSuggestionWebviewProvider 'suggestion', 'suggestionLS.css', ); - const ideStyle = readFileSync(ideStylePath.path, 'utf8'); + const ideStyle = readFileSync(ideStylePath.fsPath, 'utf8'); const ideScriptPath = vscode.Uri.joinPath( vscode.Uri.file(this.context.extensionPath), 'out', @@ -137,7 +137,7 @@ export class CodeSuggestionWebviewProvider 'suggestion', 'codeSuggestionWebviewScriptLS.js', ); - const ideScript = readFileSync(ideScriptPath.path, 'utf8'); + const ideScript = readFileSync(ideScriptPath.fsPath, 'utf8'); html = html.replace('${ideStyle}', ''); html = html.replace('${ideScript}', ''); const nonce = getNonce();