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

Fix tests #4825

Merged
merged 3 commits into from
Feb 16, 2021
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
9 changes: 3 additions & 6 deletions src/client/activation/serviceRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { BANNER_NAME_DS_SURVEY, BANNER_NAME_INTERACTIVE_SHIFTENTER, IJupyterExtensionBanner } from '../common/types';
import { BANNER_NAME_INTERACTIVE_SHIFTENTER, IJupyterExtensionBanner, ISurveyBanner } from '../common/types';
import { DataScienceSurveyBanner } from '../datascience/dataScienceSurveyBanner';
import { RecommendPythonExtensionBanner } from '../datascience/recommendPythonExtensionBanner';
import { InteractiveShiftEnterBanner } from '../datascience/shiftEnterBanner';
Expand All @@ -18,11 +18,8 @@ export function registerTypes(serviceManager: IServiceManager) {
IExtensionActivationService,
MigrateDataScienceSettingsService
);
serviceManager.addSingleton<IExtensionSingleActivationService>(
IExtensionSingleActivationService,
DataScienceSurveyBanner,
BANNER_NAME_DS_SURVEY
);
serviceManager.addSingleton<ISurveyBanner>(ISurveyBanner, DataScienceSurveyBanner);
serviceManager.addBinding(ISurveyBanner, IExtensionSingleActivationService);
serviceManager.addSingleton<IJupyterExtensionBanner>(
IJupyterExtensionBanner,
InteractiveShiftEnterBanner,
Expand Down
5 changes: 4 additions & 1 deletion src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Uri,
WorkspaceEdit
} from 'vscode';
import { IExtensionSingleActivationService } from '../activation/types';
import { BannerType } from '../datascience/dataScienceSurveyBanner';
import { LogLevel } from '../logging/levels';
import { CommandsWithoutArgs } from './application/commands';
Expand Down Expand Up @@ -329,9 +330,11 @@ export interface IJupyterExtensionBanner {
isEnabled(type: BannerType): boolean;
showBanner(type: BannerType): Promise<void>;
}
export const BANNER_NAME_DS_SURVEY: string = 'DSSurveyBanner';
export const BANNER_NAME_INTERACTIVE_SHIFTENTER: string = 'InteractiveShiftEnterBanner';

export const ISurveyBanner = Symbol('ISurveyBanner');
export interface ISurveyBanner extends IExtensionSingleActivationService, IJupyterExtensionBanner {}

export type DeprecatedSettingAndValue = {
setting: string;
values?: {}[];
Expand Down
11 changes: 5 additions & 6 deletions src/client/datascience/dataScienceSurveyBanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

'use strict';

import { inject, injectable, named } from 'inversify';
import { inject, injectable } from 'inversify';
import { Event, EventEmitter, UIKind } from 'vscode';
import { IExtensionSingleActivationService } from '../activation/types';
import { IApplicationEnvironment, IApplicationShell, IVSCodeNotebook } from '../common/application/types';
Expand All @@ -12,13 +12,13 @@ import { Experiments } from '../common/experiments/groups';
import '../common/extensions';
import { traceError } from '../common/logger';
import {
BANNER_NAME_DS_SURVEY,
IBrowserService,
IDisposableRegistry,
IExperimentService,
IJupyterExtensionBanner,
IPersistentState,
IPersistentStateFactory
IPersistentStateFactory,
ISurveyBanner
} from '../common/types';
import * as localize from '../common/utils/localize';
import { noop } from '../common/utils/misc';
Expand Down Expand Up @@ -65,9 +65,8 @@ export class DataScienceSurveyBannerLogger implements IInteractiveWindowListener
private postEmitter = new EventEmitter<{ message: string; payload: any }>();
constructor(
@inject(IPersistentStateFactory) private persistentState: IPersistentStateFactory,
@inject(IJupyterExtensionBanner)
@named(BANNER_NAME_DS_SURVEY)
private readonly dataScienceSurveyBanner: IJupyterExtensionBanner
@inject(ISurveyBanner)
private readonly dataScienceSurveyBanner: ISurveyBanner
) {}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public get postMessage(): Event<{ message: string; payload: any }> {
Expand Down