Skip to content

Commit

Permalink
chore: cleanup oss language server view constants
Browse files Browse the repository at this point in the history
  • Loading branch information
j-luong committed Nov 10, 2023
1 parent 7c37f16 commit a14af5c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
],
"activationEvents": [
"onWebviewPanel:snyk.views.suggestion.code",
"onWebviewPanel:snyk.views.suggestion.oss.languageServer",
"onWebviewPanel:snyk.views.suggestion.oss",
"*"
],
"main": "./out/extension.js",
Expand Down Expand Up @@ -236,8 +236,8 @@
"when": "!snyk:loggedIn || snyk:error || !snyk:workspaceFound"
},
{
"id": "snyk.views.analysis.oss.languageServer",
"name": "Open Source Security (LS)",
"id": "snyk.views.analysis.oss",
"name": "Open Source Security",
"when": "snyk:initialized && snyk:loggedIn && snyk:workspaceFound && !snyk:error"
},
{
Expand Down Expand Up @@ -301,12 +301,12 @@
"view/title": [
{
"command": "snyk.start",
"when": "view == 'snyk.views.analysis.code.security' || view == 'snyk.views.analysis.code.quality' || view == 'snyk.views.analysis.oss.languageServer' || view == 'snyk.views.analysis.configuration'",
"when": "view == 'snyk.views.analysis.code.security' || view == 'snyk.views.analysis.code.quality' || view == 'snyk.views.analysis.oss' || view == 'snyk.views.analysis.configuration'",
"group": "navigation"
},
{
"command": "snyk.settings",
"when": "view == 'snyk.views.analysis.code.security' || view == 'snyk.views.analysis.code.quality' || view == 'snyk.views.analysis.oss.languageServer' || view == 'snyk.views.welcome' || view == 'snyk.views.analysis.configuration'",
"when": "view == 'snyk.views.analysis.code.security' || view == 'snyk.views.analysis.code.quality' || view == 'snyk.views.analysis.oss' || view == 'snyk.views.welcome' || view == 'snyk.views.analysis.configuration'",
"group": "navigation"
}
],
Expand Down
2 changes: 0 additions & 2 deletions src/snyk/common/constants/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ export const SNYK_VIEW_ANALYSIS_CODE_ENABLEMENT = 'snyk.views.analysis.code.enab
export const SNYK_VIEW_ANALYSIS_CODE_SECURITY = 'snyk.views.analysis.code.security';
export const SNYK_VIEW_ANALYSIS_CODE_QUALITY = 'snyk.views.analysis.code.quality';
export const SNYK_VIEW_ANALYSIS_OSS = 'snyk.views.analysis.oss';
export const SNYK_VIEW_ANALYSIS_OSS_LANGUAGE_SERVER = 'snyk.views.analysis.oss.languageServer';
export const SNYK_VIEW_SUPPORT = 'snyk.views.support';
export const SNYK_VIEW_SUGGESTION_CODE = 'snyk.views.suggestion.code';
export const SNYK_VIEW_SUGGESTION_OSS = 'snyk.views.suggestion.oss';
export const SNYK_VIEW_SUGGESTION_OSS_LANGUAGE_SERVER = 'snyk.views.suggestion.oss.languageServer';
export const SNYK_VIEW_SUGGESTION_IAC = 'snyk.views.suggestion.iac';
export const SNYK_VIEW_ANALYSIS_IAC = 'snyk.views.analysis.configuration';

Expand Down
6 changes: 3 additions & 3 deletions src/snyk/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
SNYK_VIEW_ANALYSIS_CODE_QUALITY,
SNYK_VIEW_ANALYSIS_CODE_SECURITY,
SNYK_VIEW_ANALYSIS_IAC,
SNYK_VIEW_ANALYSIS_OSS_LANGUAGE_SERVER,
SNYK_VIEW_ANALYSIS_OSS,
SNYK_VIEW_SUPPORT,
SNYK_VIEW_WELCOME,
} from './common/constants/views';
Expand Down Expand Up @@ -319,12 +319,12 @@ class SnykExtension extends SnykLib implements IExtension {
vsCodeLanguages,
);

const ossSecurityTree = vscode.window.createTreeView(SNYK_VIEW_ANALYSIS_OSS_LANGUAGE_SERVER, {
const ossSecurityTree = vscode.window.createTreeView(SNYK_VIEW_ANALYSIS_OSS, {
treeDataProvider: ossIssueProvider,
});

vscodeContext.subscriptions.push(
vscode.window.registerTreeDataProvider(SNYK_VIEW_ANALYSIS_OSS_LANGUAGE_SERVER, ossIssueProvider),
vscode.window.registerTreeDataProvider(SNYK_VIEW_ANALYSIS_OSS, ossIssueProvider),
ossSecurityTree,
);

Expand Down
9 changes: 3 additions & 6 deletions src/snyk/snykOss/providers/ossDetailPanelProvider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as vscode from 'vscode';
import { SNYK_VIEW_SUGGESTION_OSS_LANGUAGE_SERVER } from '../../common/constants/views';
import { SNYK_VIEW_SUGGESTION_OSS } from '../../common/constants/views';
import { ErrorHandler } from '../../common/error/errorHandler';
import { Issue, OssIssueData } from '../../common/languageServer/types';
import { ILog } from '../../common/logger/interfaces';
Expand Down Expand Up @@ -36,10 +36,7 @@ export class OssDetailPanelProvider

activate(): void {
this.context.addDisposables(
this.window.registerWebviewPanelSerializer(
SNYK_VIEW_SUGGESTION_OSS_LANGUAGE_SERVER,
new WebviewPanelSerializer(this),
),
this.window.registerWebviewPanelSerializer(SNYK_VIEW_SUGGESTION_OSS, new WebviewPanelSerializer(this)),
);
}

Expand All @@ -55,7 +52,7 @@ export class OssDetailPanelProvider
this.panel.reveal(vscode.ViewColumn.Two, true);
} else {
this.panel = vscode.window.createWebviewPanel(
SNYK_VIEW_SUGGESTION_OSS_LANGUAGE_SERVER,
SNYK_VIEW_SUGGESTION_OSS,
'Snyk OSS Vulnerability',
{
viewColumn: vscode.ViewColumn.Two,
Expand Down

0 comments on commit a14af5c

Please sign in to comment.