Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Jul 14, 2022
1 parent 3dfe772 commit 12d9f03
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 49 deletions.
2 changes: 0 additions & 2 deletions src/extension.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ import { registerTypes as registerKernelTypes } from './kernels/serviceRegistry.
import { registerTypes as registerNotebookTypes } from './notebooks/serviceRegistry.node';
import { registerTypes as registerInteractiveTypes } from './interactive-window/serviceRegistry.node';
import { registerTypes as registerStandaloneTypes } from './standalone/serviceRegistry.node';
import { registerTypes as registerTelemetryTypes } from './platform/telemetry/serviceRegistry.node';
import { registerTypes as registerWebviewTypes } from './webviews/extension-side/serviceRegistry.node';
import { IExtensionActivationManager } from './platform/activation/types';
import {
Expand Down Expand Up @@ -320,7 +319,6 @@ async function activateLegacy(

// Register the rest of the types (platform is first because it's needed by others)
registerPlatformTypes(serviceManager);
registerTelemetryTypes(serviceManager);
registerKernelTypes(serviceManager, isDevMode);
registerNotebookTypes(serviceManager);
registerInteractiveTypes(serviceManager);
Expand Down
2 changes: 0 additions & 2 deletions src/extension.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import { IServiceContainer, IServiceManager } from './platform/ioc/types';
import { sendErrorTelemetry, sendStartupTelemetry } from './platform/telemetry/startupTelemetry';
import { noop } from './platform/common/utils/misc';
import { registerTypes as registerPlatformTypes } from './platform/serviceRegistry.web';
import { registerTypes as registerTelemetryTypes } from './platform/telemetry/serviceRegistry.web';
import { registerTypes as registerKernelTypes } from './kernels/serviceRegistry.web';
import { registerTypes as registerNotebookTypes } from './notebooks/serviceRegistry.web';
import { registerTypes as registerInteractiveTypes } from './interactive-window/serviceRegistry.web';
Expand Down Expand Up @@ -287,7 +286,6 @@ async function activateLegacy(

// Register the rest of the types (platform is first because it's needed by others)
registerPlatformTypes(serviceManager);
registerTelemetryTypes(serviceManager);
registerNotebookTypes(serviceManager);
registerKernelTypes(serviceManager, isDevMode);
registerInteractiveTypes(serviceManager);
Expand Down
4 changes: 2 additions & 2 deletions src/kernels/telemetry/helper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Resource } from '../../platform/common/types';
import { WorkspaceInterpreterTracker } from '../../platform/telemetry/workspaceInterpreterTracker';
import { WorkspaceInterpreterTracker } from '../../platform/interpreter/workspaceInterpreterTracker';
import { PYTHON_LANGUAGE } from '../../platform/common/constants';
import { InterpreterCountTracker } from '../../platform/telemetry/interpreterCountTracker';
import { InterpreterCountTracker } from '../../platform/interpreter/interpreterCountTracker';
import { getTelemetrySafeHashedString, getTelemetrySafeLanguage } from '../../platform/telemetry/helpers';
import { getNormalizedInterpreterPath } from '../../platform/pythonEnvironments/info/interpreter';
import { getResourceType } from '../../platform/common/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { IExtensionSingleActivationService } from '../activation/types';
import { inject, injectable } from 'inversify';
import { IInterpreterService } from '../interpreter/contracts';
import { IInterpreterService } from './contracts';
import { IPythonApiProvider, IPythonExtensionChecker } from '../api/types';
import { noop } from '../common/utils/misc';
import { IDisposableRegistry } from '../common/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PythonEnvironment } from '../pythonEnvironments/info';
import { IExtensionSyncActivationService } from '../activation/types';
import { IWorkspaceService } from '../common/application/types';
import { inject, injectable } from 'inversify';
import { IInterpreterService } from '../interpreter/contracts';
import { IInterpreterService } from './contracts';
import { IPythonExtensionChecker } from '../api/types';
import { areInterpreterPathsSame } from '../pythonEnvironments/info/interpreter';

Expand Down
10 changes: 10 additions & 0 deletions src/platform/serviceRegistry.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { WebviewPanelProvider } from './webviews/webviewPanelProvider';
import { IInterpreterPackages, IReservedPythonNamedProvider } from './interpreter/types';
import { ReservedNamedProvider } from './interpreter/reservedNamedProvider.node';
import { InterpreterPackages } from './interpreter/interpreterPackages.node';
import { WorkspaceInterpreterTracker } from './interpreter/workspaceInterpreterTracker';
import { InterpreterCountTracker } from './interpreter/interpreterCountTracker';

export function registerTypes(serviceManager: IServiceManager) {
serviceManager.addSingleton<FileSystem>(FileSystem, FileSystem);
Expand Down Expand Up @@ -67,4 +69,12 @@ export function registerTypes(serviceManager: IServiceManager) {
serviceManager.add<IWebviewPanelProvider>(IWebviewPanelProvider, WebviewPanelProvider);
serviceManager.addSingleton<IReservedPythonNamedProvider>(IReservedPythonNamedProvider, ReservedNamedProvider);
serviceManager.addSingleton<IInterpreterPackages>(IInterpreterPackages, InterpreterPackages);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
WorkspaceInterpreterTracker
);
serviceManager.addSingleton<IExtensionSingleActivationService>(
IExtensionSingleActivationService,
InterpreterCountTracker
);
}
12 changes: 11 additions & 1 deletion src/platform/serviceRegistry.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ProgressReporter } from './progress/progressReporter';
import { StatusProvider } from './progress/statusProvider';
import { IStatusProvider } from './progress/types';
import { WorkspaceService } from './common/application/workspace.web';
import { IExtensionSyncActivationService } from './activation/types';
import { IExtensionSingleActivationService, IExtensionSyncActivationService } from './activation/types';
import { OutputCommandListener } from './logging/outputCommandListener';

import { IFileSystem } from './common/platform/types';
Expand All @@ -32,6 +32,8 @@ import { WebviewPanelProvider } from './webviews/webviewPanelProvider';
import { WebviewViewProvider } from './webviews/webviewViewProvider';
import { InterpreterPackages } from './interpreter/interpreterPackages.web';
import { IInterpreterPackages } from './interpreter/types';
import { WorkspaceInterpreterTracker } from './interpreter/workspaceInterpreterTracker';
import { InterpreterCountTracker } from './interpreter/interpreterCountTracker';

export function registerTypes(serviceManager: IServiceManager) {
serviceManager.addSingleton<IFileSystem>(IFileSystem, FileSystem);
Expand All @@ -53,6 +55,14 @@ export function registerTypes(serviceManager: IServiceManager) {
);

serviceManager.addSingleton<IInterpreterPackages>(IInterpreterPackages, InterpreterPackages);
serviceManager.addSingleton<IExtensionSyncActivationService>(
IExtensionSyncActivationService,
WorkspaceInterpreterTracker
);
serviceManager.addSingleton<IExtensionSingleActivationService>(
IExtensionSingleActivationService,
InterpreterCountTracker
);
// Webview Provider
serviceManager.add<IWebviewViewProvider>(IWebviewViewProvider, WebviewViewProvider);
serviceManager.add<IWebviewPanelProvider>(IWebviewPanelProvider, WebviewPanelProvider);
Expand Down
20 changes: 0 additions & 20 deletions src/platform/telemetry/serviceRegistry.node.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/platform/telemetry/serviceRegistry.web.ts

This file was deleted.

0 comments on commit 12d9f03

Please sign in to comment.