Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: load issue html on demand #544

Merged
merged 6 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/snyk/common/constants/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const SNYK_CODE_SUBMIT_FIX_FEEDBACK = 'snyk.code.submitFixFeedback';
export const SNYK_FEATURE_FLAG_COMMAND = 'snyk.getFeatureFlagStatus';
export const SNYK_CLEAR_CACHE_COMMAND = 'snyk.clearCache';
export const SNYK_CLEAR_PERSISTED_CACHE_COMMAND = 'snyk.clearPersistedCache';
export const SNYK_GENERATE_ISSUE_DESCRIPTION = 'snyk.generateIssueDescription';

// custom Snyk constants used in commands
export const SNYK_CONTEXT_PREFIX = 'snyk:';
2 changes: 0 additions & 2 deletions src/snyk/common/views/webviewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export abstract class WebviewProvider<ViewModel> implements IWebViewProvider<Vie
if (this.panel) this.panel.dispose();
this.panel = panel;
this.registerListeners();
this.panel.webview.html = this.getHtmlForWebview(this.panel.webview);
}

abstract showPanel(suggestion: ViewModel, ...args: unknown[]): Promise<void>;
Expand Down Expand Up @@ -76,6 +75,5 @@ export abstract class WebviewProvider<ViewModel> implements IWebViewProvider<Vie
}
}

protected abstract getHtmlForWebview(webview: vscode.Webview): string;
abstract activate(): void;
}
3 changes: 3 additions & 0 deletions src/snyk/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class SnykExtension extends SnykLib implements IExtension {
vsCodeLanguages,
vsCodeWorkspace,
this.learnService,
vsCodeCommands,
);

this.snykCode = new SnykCodeService(
Expand All @@ -233,6 +234,7 @@ class SnykExtension extends SnykLib implements IExtension {
Logger,
vsCodeLanguages,
vsCodeWorkspace,
vsCodeCommands,
);

this.ossService = new OssService(
Expand All @@ -256,6 +258,7 @@ class SnykExtension extends SnykLib implements IExtension {
Logger,
vsCodeLanguages,
vsCodeWorkspace,
vsCodeCommands,
);

this.iacService = new IacService(
Expand Down
266 changes: 32 additions & 234 deletions src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts

Large diffs are not rendered by default.

Loading
Loading