Skip to content

Commit

Permalink
fix: use fspath instead of path [IDE-410] (#477)
Browse files Browse the repository at this point in the history
* fix: use fspath instead of path

* chore: update changelog
  • Loading branch information
ShawkyZ authored Jun 20, 2024
1 parent ae111dd commit 86ba9cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Snyk Security Changelog

## [2.12.3]
- Fix a bug in AI Applyfix on Windows.

## [2.12.2]
- Refactors the feature flag logic into its own service.
- Fix multi-file links in the DataFlow HTML panel.
Expand Down
2 changes: 1 addition & 1 deletion src/snyk/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class SnykExtension extends SnykLib implements IExtension {
vscode.workspace.onDidChangeWorkspaceFolders(e => {
this.workspaceTrust.resetTrustedFoldersCache();
e.removed.forEach(folder => {
this.snykCode.resetResult(folder.uri.path);
this.snykCode.resetResult(folder.uri.fsPath);
});
this.runScan(false);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export class CodeSuggestionWebviewProvider

private setupCloseOnSave(filePath: string) {
vscode.workspace.onDidSaveTextDocument((e: TextDocument) => {
if (e.uri.path == filePath) {
if (e.uri.fsPath == filePath) {
this.panel?.dispose();
}
});
Expand All @@ -329,7 +329,7 @@ export class CodeSuggestionWebviewProvider
backgroundColor: 'rgba(0,255,0,0.3)',
});

const editor = vscode.window.visibleTextEditors.find(editor => editor.document.uri.path === filePath);
const editor = vscode.window.visibleTextEditors.find(editor => editor.document.uri.fsPath === filePath);
if (!editor) {
return; // No open editor found with the target file
}
Expand Down Expand Up @@ -362,7 +362,7 @@ export class CodeSuggestionWebviewProvider
};

const documentEventHandler = (document: TextDocument) => {
if (document.uri.path == filePath) {
if (document.uri.fsPath == filePath) {
removeHighlights();
}
};
Expand Down

0 comments on commit 86ba9cf

Please sign in to comment.