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

DataViewer added to the webview serviceRegistry.web.ts #10495

Merged
merged 5 commits into from
Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/test/datascience/data-viewing/dataViewer.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { JupyterSettings } from '../../../platform/common/configSettings';
import { ConfigurationService } from '../../../platform/common/configuration/service.node';
import { IConfigurationService } from '../../../platform/common/types';
import { IDataScienceErrorHandler } from '../../../platform/errors/types';
import { DataViewer } from '../../../webviews/extension-side/dataviewer/dataViewer.node';
import { DataViewer } from '../../../webviews/extension-side/dataviewer/dataViewer';
import { JupyterVariableDataProvider } from '../../../webviews/extension-side/dataviewer/jupyterVariableDataProvider';
import { IDataViewer, IDataViewerDataProvider } from '../../../webviews/extension-side/dataviewer/types';
import { MockMemento } from '../../mocks/mementos';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { traceInfo } from '../../../platform/logging';
import { PythonEnvironment } from '../../../platform/pythonEnvironments/info';
import { IInterpreterService } from '../../../platform/interpreter/contracts';
import { Commands } from '../../../platform/common/constants';
import { DataViewer } from '../../../webviews/extension-side/dataviewer/dataViewer.node';
import { DataViewer } from '../../../webviews/extension-side/dataviewer/dataViewer';
import { IVariableViewProvider } from '../../../webviews/extension-side/variablesView/types';

suite('DataScience - VariableView', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { EventEmitter, Memento, Uri, ViewColumn } from 'vscode';

import { sendTelemetryEvent } from '../../../telemetry';
import { JupyterDataRateLimitError } from '../../../platform/errors/jupyterDataRateLimitError';
import { DataViewerMessageListener } from './dataViewerMessageListener.node';
import { DataViewerMessageListener } from './dataViewerMessageListener';
import {
DataViewerMessages,
IDataFrameInfo,
Expand All @@ -19,10 +19,7 @@ import {
IGetSliceRequest,
IJupyterVariableDataProvider
} from './types';
import {
isValidSliceExpression,
preselectedSliceExpression
} from '../../../webviews/webview-side/data-explorer/helpers';
import { isValidSliceExpression, preselectedSliceExpression } from '../../webview-side/data-explorer/helpers';
import { CheckboxState } from '../../../telemetry/constants';
import { IKernel } from '../../../kernels/types';
import {
Expand All @@ -32,19 +29,24 @@ import {
} from '../../../platform/common/application/types';
import { HelpLinks } from '../../../platform/common/constants';
import { traceError, traceInfo } from '../../../platform/logging';
import { IConfigurationService, IMemento, GLOBAL_MEMENTO, Resource, IDisposable } from '../../../platform/common/types';
import {
IConfigurationService,
IMemento,
GLOBAL_MEMENTO,
Resource,
IDisposable,
IExtensionContext
} from '../../../platform/common/types';
import * as localize from '../../../platform/common/utils/localize';
import { StopWatch } from '../../../platform/common/utils/stopWatch';
import { EXTENSION_ROOT_DIR } from '../../../platform/constants.node';
import { IDataScienceErrorHandler } from '../../../platform/errors/types';
import { Telemetry } from '../../webview-side/common/constants';
import { WebViewViewChangeEventArgs } from '../types';
import { WebviewPanelHost } from '../webviewPanelHost.node';
import { WebviewPanelHost } from '../webviewPanelHost';
import { noop } from '../../../platform/common/utils/misc';
import { joinPath } from '../../../platform/vscode-path/resources';

const PREFERRED_VIEWGROUP = 'JupyterDataViewerPreferredViewColumn';
const dataExplorerDir = joinPath(Uri.file(EXTENSION_ROOT_DIR), 'out', 'webviews', 'webview-side', 'viewers');
@injectable()
export class DataViewer extends WebviewPanelHost<IDataViewerMapping> implements IDataViewer, IDisposable {
private dataProvider: IDataViewerDataProvider | IJupyterVariableDataProvider | undefined;
Expand Down Expand Up @@ -79,8 +81,10 @@ export class DataViewer extends WebviewPanelHost<IDataViewerMapping> implements
@inject(IWorkspaceService) workspaceService: IWorkspaceService,
@inject(IApplicationShell) private applicationShell: IApplicationShell,
@inject(IMemento) @named(GLOBAL_MEMENTO) readonly globalMemento: Memento,
@inject(IDataScienceErrorHandler) readonly errorHandler: IDataScienceErrorHandler
@inject(IDataScienceErrorHandler) readonly errorHandler: IDataScienceErrorHandler,
@inject(IExtensionContext) readonly context: IExtensionContext
) {
const dataExplorerDir = joinPath(context.extensionUri, 'out', 'webviews', 'webview-side', 'viewers');
super(
configuration,
provider,
Expand Down
2 changes: 1 addition & 1 deletion src/webviews/extension-side/plotting/plotViewer.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { IConfigurationService, IDisposable } from '../../../platform/common/typ
import { IFileSystemNode } from '../../../platform/common/platform/types.node';
import * as localize from '../../../platform/common/utils/localize';
import { EXTENSION_ROOT_DIR } from '../../../platform/constants.node';
import { WebviewPanelHost } from '../webviewPanelHost.node';
import { WebviewPanelHost } from '../webviewPanelHost';
import { joinPath } from '../../../platform/vscode-path/resources';
import { noop } from '../../../platform/common/utils/misc';

Expand Down
2 changes: 1 addition & 1 deletion src/webviews/extension-side/serviceRegistry.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { RendererCommunication } from './plotView/rendererCommunication.node';
import { PlotSaveHandler } from './plotView/plotSaveHandler.node';
import { PlotViewHandler } from './plotView/plotViewHandler.node';
import { DataViewerCommandRegistry } from './dataviewer/dataViewerCommandRegistry';
import { DataViewer } from './dataviewer/dataViewer.node';
import { DataViewer } from './dataviewer/dataViewer';
import { IPlotViewer, IPlotViewerProvider } from './plotting/types';
import { PlotViewer } from './plotting/plotViewer.node';
import { DataViewerDependencyService } from './dataviewer/dataViewerDependencyService.node';
Expand Down
3 changes: 3 additions & 0 deletions src/webviews/extension-side/serviceRegistry.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { VariableViewProvider } from './variablesView/variableViewProvider';
import { JupyterVariableDataProvider } from './dataviewer/jupyterVariableDataProvider';
import { JupyterVariableDataProviderFactory } from './dataviewer/jupyterVariableDataProviderFactory';
import {
IDataViewer,
IDataViewerFactory,
IJupyterVariableDataProvider,
IJupyterVariableDataProviderFactory
Expand All @@ -24,6 +25,7 @@ import { DataViewerFactory } from './dataviewer/dataViewerFactory';
import { ExtensionSideRenderer, IExtensionSideRenderer } from './renderer';
import { ActiveEditorContextService } from './activeEditorContext';
import { GlobalActivation } from './globalActivation';
import { DataViewer } from './dataviewer/dataViewer';
import { INotebookExporter } from '../../kernels/jupyter/types';
import { JupyterExporter } from './import-export/jupyterExporter';

Expand All @@ -38,6 +40,7 @@ export function registerTypes(serviceManager: IServiceManager, _isDevMode: boole
serviceManager.add<IWebviewPanelProvider>(IWebviewPanelProvider, WebviewPanelProvider);

// Data viewer
serviceManager.add<IDataViewer>(IDataViewer, DataViewer);
serviceManager.addSingleton<IDataViewerFactory>(IDataViewerFactory, DataViewerFactory);
serviceManager.addSingleton<IExtensionSingleActivationService>(
IExtensionSingleActivationService,
Expand Down