Skip to content

Commit

Permalink
Remove more dead code/files from web (#13822)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Aug 1, 2023
1 parent f51907c commit 438c5b7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 176 deletions.
5 changes: 3 additions & 2 deletions src/interactive-window/commands/commandRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class CommandRegistry implements IDisposable, IExtensionSyncActivationSer
constructor(
@inject(IDisposableRegistry) private readonly disposables: IDisposableRegistry,
@inject(INotebookExporter) @optional() private jupyterExporter: INotebookExporter | undefined,
@inject(IJupyterServerHelper) private jupyterServerHelper: IJupyterServerHelper,
@inject(IJupyterServerHelper) @optional() private jupyterServerHelper: IJupyterServerHelper | undefined,
@inject(IDocumentManager) private documentManager: IDocumentManager,
@inject(IApplicationShell) private applicationShell: IApplicationShell,
@inject(IFileSystem) private fileSystem: IFileSystem,
Expand Down Expand Up @@ -664,6 +664,7 @@ export class CommandRegistry implements IDisposable, IExtensionSyncActivationSer
filePath &&
filePath.length > 0 &&
this.jupyterExporter &&
this.jupyterServerHelper &&
(await this.jupyterServerHelper.isJupyterServerSupported())
) {
// If the current file is the active editor, then generate cells from the document.
Expand Down Expand Up @@ -701,7 +702,7 @@ export class CommandRegistry implements IDisposable, IExtensionSyncActivationSer
return uri;
}
}
} else {
} else if (this.jupyterServerHelper) {
await this.dataScienceErrorHandler.handleError(
new JupyterInstallError(
DataScience.jupyterNotSupported(await this.jupyterServerHelper.getJupyterServerError())
Expand Down
48 changes: 0 additions & 48 deletions src/kernels/jupyter/launcher/jupyterServerHelper.web.ts

This file was deleted.

5 changes: 1 addition & 4 deletions src/kernels/jupyter/serviceRegistry.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { JupyterConnection } from './connection/jupyterConnection';
import { JupyterKernelService } from './session/jupyterKernelService.web';
import { JupyterRemoteCachedKernelValidator } from './connection/jupyterRemoteCachedKernelValidator';
import { JupyterUriProviderRegistration } from './connection/jupyterUriProviderRegistration';
import { JupyterServerHelper } from './launcher/jupyterServerHelper.web';
import { JupyterServerProvider } from './launcher/jupyterServerProvider.web';
import { JupyterServerUriStorage } from './connection/serverUriStorage';
import { LiveRemoteKernelConnectionUsageTracker } from './connection/liveRemoteKernelConnectionTracker';
Expand All @@ -27,16 +26,14 @@ import {
IJupyterServerProvider,
IJupyterRequestCreator,
ILiveRemoteKernelConnectionUsageTracker,
IJupyterRemoteCachedKernelValidator,
IJupyterServerHelper
IJupyterRemoteCachedKernelValidator
} from './types';
import { RemoteKernelFinderController } from './finder/remoteKernelFinderController';
import { KernelSessionFactory } from '../common/kernelSessionFactory';
import { OldJupyterKernelSessionFactory } from './session/oldJupyterKernelSessionFactory';
import { JupyterKernelSessionFactory } from './session/jupyterKernelSessionFactory';

export function registerTypes(serviceManager: IServiceManager, _isDevMode: boolean) {
serviceManager.addSingleton<IJupyterServerHelper>(IJupyterServerHelper, JupyterServerHelper);
serviceManager.addSingleton<IOldJupyterSessionManagerFactory>(
IOldJupyterSessionManagerFactory,
JupyterSessionManagerFactory
Expand Down
7 changes: 5 additions & 2 deletions src/standalone/import-export/jupyterExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import type * as nbformat from '@jupyterlab/nbformat';
import { inject, injectable } from 'inversify';
import { inject, injectable, optional } from 'inversify';

import { Uri } from 'vscode';
import { CellMatcher } from '../../interactive-window/editor-integration/cellMatcher';
Expand All @@ -24,7 +24,7 @@ import { IDataScienceErrorHandler } from '../../kernels/errors/types';
@injectable()
export class JupyterExporter implements INotebookExporter {
constructor(
@inject(IJupyterServerHelper) private jupyterServerHelper: IJupyterServerHelper,
@inject(IJupyterServerHelper) @optional() private jupyterServerHelper: IJupyterServerHelper | undefined,
@inject(IConfigurationService) private configService: IConfigurationService,
@inject(IFileSystem) private fileSystem: IFileSystem,
@inject(IApplicationShell) private readonly applicationShell: IApplicationShell,
Expand Down Expand Up @@ -143,6 +143,9 @@ export class JupyterExporter implements INotebookExporter {
};

private extractPythonMainVersion = async (): Promise<number> => {
if (!this.jupyterServerHelper) {
return 3;
}
// Use the active interpreter
const usableInterpreter = await this.jupyterServerHelper.getUsableJupyterPython();
return usableInterpreter && usableInterpreter.version ? usableInterpreter.version.major : 3;
Expand Down
110 changes: 0 additions & 110 deletions src/test/datascience/interactiveWindowTestHelpers.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions src/test/datascience/nativeEditorTestHelpers.tsx

This file was deleted.

0 comments on commit 438c5b7

Please sign in to comment.