Skip to content

Commit

Permalink
fix: make sure old fix panels are closed on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelAquilina committed Apr 11, 2024
1 parent 77497e3 commit a62afe6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { ICodeSuggestionWebviewProvider } from '../interfaces';
import { readFileSync } from 'fs';
import { TextDocument } from '../../../common/vscode/types';
import { Suggestion, SuggestionMessage } from './types';
import { WebviewPanelSerializer } from '../../../common/views/webviewPanelSerializer';
import { WebviewPanelSerializer } from '../../../snykCode/views/webviewPanelSerializer';

export class CodeSuggestionWebviewProvider
extends WebviewProvider<Issue<CodeIssueData>>
Expand Down
12 changes: 12 additions & 0 deletions src/snyk/snykCode/views/webviewPanelSerializer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as vscode from 'vscode';
import { WebviewProvider } from '../../../snyk/common/views/webviewProvider';
import { Logger } from '../../common/logger/logger';

export class WebviewPanelSerializer<Provider extends WebviewProvider<State>, State> implements vscode.WebviewPanelSerializer {

Check failure on line 5 in src/snyk/snykCode/views/webviewPanelSerializer.ts

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

Replace `·implements·vscode.WebviewPanelSerializer·` with `⏎··implements·vscode.WebviewPanelSerializer⏎`
constructor(private readonly provider: Provider) {}
async deserializeWebviewPanel(webviewPanel: vscode.WebviewPanel): Promise<void> {
// we want to make sure the panel is closed on startup
webviewPanel.dispose();
return Promise.resolve();
}
}

0 comments on commit a62afe6

Please sign in to comment.