Skip to content

removed experiment code and extra setting #13900

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

Merged
merged 2 commits into from
Sep 14, 2020
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
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2272,12 +2272,6 @@
"description": "Automatically scroll the interactive window to show the output of the last statement executed. If false, the interactive window will only automatically scroll if the bottom of the prior cell is visible.",
"scope": "resource"
},
"python.dataScience.showKernelSelectionOnInteractiveWindow": {
"type": "boolean",
"default": false,
"description": "When set to true, enables the kernel selector in the Interactive Window. By default, the Interactive Window will use your Python Interpreters kernel.",
"scope": "resource"
},
"python.dataScience.enableScrollingForCellOutputs": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -3792,4 +3786,4 @@
"publisherDisplayName": "Microsoft",
"publisherId": "998b010b-e2af-44a5-a6cd-0b5fd3b9b6f8"
}
}
}
7 changes: 0 additions & 7 deletions src/client/common/experiments/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ export enum NotebookEditorSupport {
nativeNotebookExperiment = 'NativeNotebook - experiment'
}

// Experiment to remove the Kernel/Server Tooblar in the Interactive Window when running a local Jupyter Server.
// It doesn't make sense to have it there, the user can already change the kernel
// by changing the python interpreter on the status bar.
export enum RemoveKernelToolbarInInteractiveWindow {
experiment = 'RemoveKernelToolbarInInteractiveWindow'
}

// Experiment to offer switch to Pylance language server
export enum TryPylance {
experiment = 'tryPylance'
Expand Down
3 changes: 1 addition & 2 deletions src/client/common/startPage/startPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ export class StartPage extends WebviewPanelHost<IStartPageMapping>
localize.StartPage.getStarted(),
ViewColumn.One,
false,
false,
Promise.resolve(false)
false
);
this.timer = new StopWatch();
}
Expand Down
1 change: 0 additions & 1 deletion src/client/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ export interface IDataScienceSettings {
jupyterCommandLineArguments: string[];
widgetScriptSources: WidgetCDNs[];
alwaysScrollOnNewCell?: boolean;
showKernelSelectionOnInteractiveWindow?: boolean;
interactiveWindowMode: InteractiveWindowMode;
}

Expand Down
3 changes: 1 addition & 2 deletions src/client/datascience/data-viewing/dataViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ export class DataViewer extends WebviewPanelHost<IDataViewerMapping> implements
localize.DataScience.dataExplorerTitle(),
ViewColumn.One,
useCustomEditorApi,
false,
Promise.resolve(false)
false
);
}

Expand Down
13 changes: 3 additions & 10 deletions src/client/datascience/interactive-common/interactiveBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,11 @@ import {
} from '../../common/application/types';
import { CancellationError } from '../../common/cancellation';
import { EXTENSION_ROOT_DIR, isTestExecution, PYTHON_LANGUAGE } from '../../common/constants';
import { RemoveKernelToolbarInInteractiveWindow, RunByLine } from '../../common/experiments/groups';
import { RunByLine } from '../../common/experiments/groups';
import { traceError, traceInfo, traceWarning } from '../../common/logger';

import { isNil } from 'lodash';
import {
IConfigurationService,
IDisposableRegistry,
IExperimentService,
IExperimentsManager
} from '../../common/types';
import { IConfigurationService, IDisposableRegistry, IExperimentsManager } from '../../common/types';
import { createDeferred, Deferred } from '../../common/utils/async';
import * as localize from '../../common/utils/localize';
import { isUntitledFile, noop } from '../../common/utils/misc';
Expand Down Expand Up @@ -171,7 +166,6 @@ export abstract class InteractiveBase extends WebviewPanelHost<IInteractiveWindo
experimentsManager: IExperimentsManager,
private readonly notebookProvider: INotebookProvider,
useCustomEditorApi: boolean,
expService: IExperimentService,
private selector: KernelSelector
) {
super(
Expand All @@ -186,8 +180,7 @@ export abstract class InteractiveBase extends WebviewPanelHost<IInteractiveWindo
title,
viewColumn,
useCustomEditorApi,
experimentsManager.inExperiment(RunByLine.experiment),
expService.inExperiment(RemoveKernelToolbarInInteractiveWindow.experiment)
experimentsManager.inExperiment(RunByLine.experiment)
);

// Create our unique id. We use this to skip messages we send to other interactive windows
Expand Down
3 changes: 0 additions & 3 deletions src/client/datascience/interactive-ipynb/nativeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
IAsyncDisposableRegistry,
IConfigurationService,
IDisposableRegistry,
IExperimentService,
IExperimentsManager,
Resource
} from '../../common/types';
Expand Down Expand Up @@ -182,7 +181,6 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor {
notebookProvider: INotebookProvider,
useCustomEditorApi: boolean,
private trustService: ITrustService,
expService: IExperimentService,
private _model: INotebookModel,
webviewPanel: WebviewPanel | undefined,
selector: KernelSelector,
Expand Down Expand Up @@ -223,7 +221,6 @@ export class NativeEditor extends InteractiveBase implements INotebookEditor {
experimentsManager,
notebookProvider,
useCustomEditorApi,
expService,
selector
);
asyncRegistry.push(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
IAsyncDisposableRegistry,
IConfigurationService,
IDisposableRegistry,
IExperimentService,
IExperimentsManager
} from '../../common/types';
import * as localize from '../../common/utils/localize';
Expand Down Expand Up @@ -101,7 +100,6 @@ export class NativeEditorOldWebView extends NativeEditor {
useCustomEditorApi: boolean,
private readonly storage: INotebookStorageProvider,
trustService: ITrustService,
expService: IExperimentService,
model: INotebookModel,
webviewPanel: WebviewPanel | undefined,
selector: KernelSelector,
Expand Down Expand Up @@ -137,7 +135,6 @@ export class NativeEditorOldWebView extends NativeEditor {
notebookProvider,
useCustomEditorApi,
trustService,
expService,
model,
webviewPanel,
selector,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
IAsyncDisposableRegistry,
IConfigurationService,
IDisposableRegistry,
IExperimentService,
IExperimentsManager,
IMemento,
WORKSPACE_MEMENTO
Expand Down Expand Up @@ -226,7 +225,6 @@ export class NativeEditorProviderOld extends NativeEditorProvider {
this.serviceContainer.get<boolean>(UseCustomEditorApi),
this.serviceContainer.get<INotebookStorageProvider>(INotebookStorageProvider),
this.serviceContainer.get<ITrustService>(ITrustService),
this.serviceContainer.get<IExperimentService>(IExperimentService),
model,
panel,
this.serviceContainer.get<KernelSelector>(KernelSelector),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { traceError } from '../../common/logger';
import {
IConfigurationService,
IDisposableRegistry,
IExperimentService,
IExperimentsManager,
InteractiveWindowMode,
IPersistentStateFactory,
Expand Down Expand Up @@ -125,7 +124,6 @@ export class InteractiveWindow extends InteractiveBase implements IInteractiveWi
experimentsManager: IExperimentsManager,
notebookProvider: INotebookProvider,
useCustomEditorApi: boolean,
expService: IExperimentService,
private exportUtil: ExportUtil,
owner: Resource,
mode: InteractiveWindowMode,
Expand Down Expand Up @@ -167,7 +165,6 @@ export class InteractiveWindow extends InteractiveBase implements IInteractiveWi
experimentsManager,
notebookProvider,
useCustomEditorApi,
expService,
selector
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
IAsyncDisposableRegistry,
IConfigurationService,
IDisposableRegistry,
IExperimentService,
IExperimentsManager,
IMemento,
InteractiveWindowMode,
Expand Down Expand Up @@ -192,7 +191,6 @@ export class InteractiveWindowProvider implements IInteractiveWindowProvider, IA
this.serviceContainer.get<IExperimentsManager>(IExperimentsManager),
this.serviceContainer.get<INotebookProvider>(INotebookProvider),
this.serviceContainer.get<boolean>(UseCustomEditorApi),
this.serviceContainer.get<IExperimentService>(IExperimentService),
this.serviceContainer.get<ExportUtil>(ExportUtil),
resource,
mode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
IAsyncDisposableRegistry,
IConfigurationService,
IDisposableRegistry,
IExperimentService,
IExperimentsManager,
IMemento,
WORKSPACE_MEMENTO
Expand Down Expand Up @@ -262,7 +261,6 @@ export class NativeEditorProvider implements INotebookEditorProvider, CustomEdit
this.serviceContainer.get<INotebookProvider>(INotebookProvider),
this.serviceContainer.get<boolean>(UseCustomEditorApi),
this.serviceContainer.get<ITrustService>(ITrustService),
this.serviceContainer.get<IExperimentService>(IExperimentService),
model,
panel,
this.serviceContainer.get<KernelSelector>(KernelSelector),
Expand Down
3 changes: 1 addition & 2 deletions src/client/datascience/plotting/plotViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export class PlotViewer extends WebviewPanelHost<IPlotViewerMapping> implements
localize.DataScience.plotViewerTitle(),
ViewColumn.One,
useCustomEditorApi,
false,
Promise.resolve(false)
false
);
// Load the web panel using our current directory as we don't expect to load any other files
super.loadWebPanel(process.cwd()).catch(traceError);
Expand Down
4 changes: 0 additions & 4 deletions src/client/datascience/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -837,10 +837,6 @@ export interface IDataScienceExtraSettings extends IDataScienceSettings {
enableDuringDebugger: boolean;
};

webviewExperiments: {
removeKernelToolbarInInteractiveWindow: boolean;
};

gatherIsInstalled: boolean;
}

Expand Down
21 changes: 11 additions & 10 deletions src/client/datascience/webviews/webviewHost.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

'use strict';

import '../../common/extensions';

import { injectable, unmanaged } from 'inversify';
Expand All @@ -19,20 +21,22 @@ import { ICodeCssGenerator, IDataScienceExtraSettings, IThemeFinder } from '../t
@injectable() // For some reason this is necessary to get the class hierarchy to work.
export abstract class WebviewHost<IMapping> implements IDisposable {
protected webview?: IWebview;
protected disposed: boolean = false;

protected disposed = false;

protected themeIsDarkPromise: Deferred<boolean> | undefined = createDeferred<boolean>();

protected webviewInit: Deferred<void> | undefined = createDeferred<void>();

protected readonly _disposables: IDisposable[] = [];

constructor(
@unmanaged() protected configService: IConfigurationService,
@unmanaged() private cssGenerator: ICodeCssGenerator,
@unmanaged() protected themeFinder: IThemeFinder,
@unmanaged() protected workspaceService: IWorkspaceService,
@unmanaged() protected readonly useCustomEditorApi: boolean,
@unmanaged() private readonly enableVariablesDuringDebugging: boolean,
@unmanaged() private readonly hideKernelToolbarInInteractiveWindow: Promise<boolean>
@unmanaged() private readonly enableVariablesDuringDebugging: boolean
) {
// Listen for settings changes from vscode.
this._disposables.push(this.workspaceService.onDidChangeConfiguration(this.onPossibleSettingsChange, this));
Expand Down Expand Up @@ -83,7 +87,7 @@ export abstract class WebviewHost<IMapping> implements IDisposable {
return this.postMessageInternal(type.toString(), payload);
}

//tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
protected onMessage(message: string, payload: any) {
switch (message) {
case CssMessages.GetCssRequest:
Expand Down Expand Up @@ -124,7 +128,7 @@ export abstract class WebviewHost<IMapping> implements IDisposable {
fontSize: this.getValue(editor, 'fontSize', 14),
fontFamily: this.getValue(editor, 'fontFamily', "Consolas, 'Courier New', monospace")
},
theme: theme,
theme,
useCustomEditorApi: this.useCustomEditorApi
},
intellisenseOptions: {
Expand All @@ -145,10 +149,7 @@ export abstract class WebviewHost<IMapping> implements IDisposable {
variableOptions: {
enableDuringDebugger: this.enableVariablesDuringDebugging
},
webviewExperiments: {
removeKernelToolbarInInteractiveWindow: await this.hideKernelToolbarInInteractiveWindow
},
gatherIsInstalled: ext ? true : false
gatherIsInstalled: !!ext
};
}

Expand All @@ -164,7 +165,7 @@ export abstract class WebviewHost<IMapping> implements IDisposable {
await this.webviewInit.promise;

// Then send it the message
this.webview?.postMessage({ type: type.toString(), payload: payload });
this.webview?.postMessage({ type: type.toString(), payload });
}
}

Expand Down
15 changes: 10 additions & 5 deletions src/client/datascience/webviews/webviewPanelHost.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

'use strict';

import '../../common/extensions';

import { injectable, unmanaged } from 'inversify';
Expand Down Expand Up @@ -28,9 +30,13 @@ export abstract class WebviewPanelHost<IMapping> extends WebviewHost<IMapping> i
protected get isDisposed(): boolean {
return this.disposed;
}

protected viewState: { visible: boolean; active: boolean } = { visible: false, active: false };

private webPanel: IWebviewPanel | undefined;

private messageListener: IWebviewPanelMessageListener;

private startupStopwatch = new StopWatch();

constructor(
Expand All @@ -50,17 +56,15 @@ export abstract class WebviewPanelHost<IMapping> extends WebviewHost<IMapping> i
@unmanaged() private _title: string,
@unmanaged() private viewColumn: ViewColumn,
@unmanaged() protected readonly useCustomEditorApi: boolean,
@unmanaged() enableVariablesDuringDebugging: boolean,
@unmanaged() hideKernelToolbarInInteractiveWindow: Promise<boolean>
@unmanaged() enableVariablesDuringDebugging: boolean
) {
super(
configService,
cssGenerator,
themeFinder,
workspaceService,
useCustomEditorApi,
enableVariablesDuringDebugging,
hideKernelToolbarInInteractiveWindow
enableVariablesDuringDebugging
);

// Create our message listener for our web panel.
Expand Down Expand Up @@ -97,6 +101,7 @@ export abstract class WebviewPanelHost<IMapping> extends WebviewHost<IMapping> i

super.dispose();
}

public get title() {
return this._title;
}
Expand All @@ -108,7 +113,7 @@ export abstract class WebviewPanelHost<IMapping> extends WebviewHost<IMapping> i
}
}

//tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
protected onMessage(message: string, payload: any) {
switch (message) {
case SharedMessages.Started:
Expand Down
Loading