From 1e7238328d61326533f7942670debfbbdc370c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Scha=CC=88fer?= <101886095+PeterSchafer@users.noreply.github.com> Date: Tue, 24 Oct 2023 10:14:29 +0200 Subject: [PATCH] chore: introduce feature flag for OSS via LS --- src/snyk/common/experiment/services/experimentService.ts | 1 + src/snyk/extension.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/snyk/common/experiment/services/experimentService.ts b/src/snyk/common/experiment/services/experimentService.ts index 0edceb5e4..28f11a355 100644 --- a/src/snyk/common/experiment/services/experimentService.ts +++ b/src/snyk/common/experiment/services/experimentService.ts @@ -7,6 +7,7 @@ import { User } from '../../user'; export enum ExperimentKey { // to be populated with running experiment keys TestExperiment = 'vscode-test-experiment', + OssViaLanguageServer = 'snyk-oss-via-ls-in-vs-code-integration', } export class ExperimentService { diff --git a/src/snyk/extension.ts b/src/snyk/extension.ts index 722069a13..26689eb4c 100644 --- a/src/snyk/extension.ts +++ b/src/snyk/extension.ts @@ -41,7 +41,7 @@ import { } from './common/constants/views'; import { ErrorHandler } from './common/error/errorHandler'; import { ErrorReporter } from './common/error/errorReporter'; -import { ExperimentService } from './common/experiment/services/experimentService'; +import { ExperimentKey, ExperimentService } from './common/experiment/services/experimentService'; import { LanguageServer } from './common/languageServer/languageServer'; import { StaticLsApi } from './common/languageServer/staticLsApi'; import { Logger } from './common/logger/logger'; @@ -363,6 +363,11 @@ class SnykExtension extends SnykLib implements IExtension { this.analytics.load(); this.experimentService.load(); + const ossViaLanguageServer = await this.experimentService.isUserPartOfExperiment( + ExperimentKey.OssViaLanguageServer, + true, + ); + console.log(`Snyk "Open Source Security" via Language Server: ${ossViaLanguageServer}`); this.logPluginIsInstalled();