Skip to content

Commit

Permalink
No webview import in kernels. Part 1. (#10442)
Browse files Browse the repository at this point in the history
* No webview import in kernels. Part 1.

* 💄 organize imports
  • Loading branch information
rebornix authored Jun 14, 2022
1 parent cc4de1b commit d51447d
Show file tree
Hide file tree
Showing 61 changed files with 126 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { traceInfo, traceInfoIfCI, traceWarning } from '../../platform/logging';
import { IPlatformService } from '../../platform/common/platform/types';
import { IConfigurationService } from '../../platform/common/types';
import { DataScience } from '../../platform/common/utils/localize';
import { Identifiers, Telemetry } from '../../webviews/webview-side/common/constants';
import { Identifiers } from '../../webviews/webview-side/common/constants';
import { Telemetry } from '../../telemetry';
import { JupyterDebuggerNotInstalledError } from '../../platform/errors/jupyterDebuggerNotInstalledError';
import { getPlainTextOrStreamOutput } from '../../kernels/kernel.base';
import { IKernel, isLocalConnection } from '../../kernels/types';
Expand Down
2 changes: 1 addition & 1 deletion src/interactive-window/editor-integration/codeGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Uri
} from 'vscode';

import { splitMultilineString } from '../../webviews/webview-side/common';
import { splitMultilineString } from '../../platform/common/utils';
import { IDocumentManager } from '../../platform/common/application/types';
import { traceInfo } from '../../platform/logging';
import { IConfigurationService, IDisposableRegistry } from '../../platform/common/types';
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/common/baseJupyterSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import { IDisposable, Resource } from '../../platform/common/types';
import { createDeferred, sleep, waitForPromise } from '../../platform/common/utils/async';
import * as localize from '../../platform/common/utils/localize';
import { noop } from '../../platform/common/utils/misc';
import { sendTelemetryEvent } from '../../telemetry';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { JupyterInvalidKernelError } from '../../platform/errors/jupyterInvalidKernelError';
import { JupyterWaitForIdleError } from '../../platform/errors/jupyterWaitForIdleError';
import { KernelInterruptTimeoutError } from '../../platform/errors/kernelInterruptTimeoutError';
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/execution/cellExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import { traceError, traceInfoIfCI, traceWarning } from '../../platform/logging'
import { IDisposable } from '../../platform/common/types';
import { createDeferred } from '../../platform/common/utils/async';
import { StopWatch } from '../../platform/common/utils/stopWatch';
import { sendTelemetryEvent } from '../../telemetry';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { noop } from '../../platform/common/utils/misc';
import { getDisplayNameOrNameOfKernelConnection, isPythonKernelConnection } from '../../kernels/helpers';
import { isCancellationError } from '../../platform/common/cancellation';
Expand Down
4 changes: 2 additions & 2 deletions src/kernels/execution/cellExecutionMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ import { disposeAllDisposables } from '../../platform/common/helpers';
import { traceError, traceWarning } from '../../platform/logging';
import { RefBool } from '../../platform/common/refBool';
import { IDisposable, IExtensionContext } from '../../platform/common/types';
import { concatMultilineString, isJupyterNotebook } from '../../platform/common/utils';
import { traceCellMessage, cellOutputToVSCCellOutput, translateCellDisplayOutput } from './helpers';
import { formatStreamText, concatMultilineString } from '../../webviews/webview-side/common';
import { formatStreamText } from '../../webviews/webview-side/common';
import { swallowExceptions } from '../../platform/common/utils/decorators';
import { noop } from '../../platform/common/utils/misc';
import { ITracebackFormatter } from '../../kernels/types';
import { handleTensorBoardDisplayDataOutput } from './executionHelpers';
import { WIDGET_MIMETYPE } from '../../kernels/ipywidgets-message-coordination/constants';
import { isJupyterNotebook } from '../../platform/common/utils';

// Helper interface for the set_next_input execute reply payload
interface ISetNextInputPayload {
Expand Down
5 changes: 2 additions & 3 deletions src/kernels/execution/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ import fastDeepEqual = require('fast-deep-equal');
import * as path from '../../platform/vscode-path/path';
import * as uriPath from '../../platform/vscode-path/resources';
import { PYTHON_LANGUAGE } from '../../platform/common/constants';
import { concatMultilineString, splitMultilineString } from '../../platform/common/utils';
import { traceInfoIfCI, traceError, traceWarning } from '../../platform/logging';
import { getInterpreterHash } from '../../platform/pythonEnvironments/info/interpreter';
import { sendTelemetryEvent } from '../../telemetry';
import { splitMultilineString, concatMultilineString } from '../../webviews/webview-side/common';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { getOSType, OSType } from '../../platform/common/utils/platform';
import { createOutputWithErrorMessageForDisplay } from '../../platform/errors/errorUtils';
import { CellExecutionCreator } from './cellExecutionCreator';
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/execution/kernelExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import { createDeferred, waitForPromise } from '../../platform/common/utils/asyn
import { StopWatch } from '../../platform/common/utils/stopWatch';
import { sendKernelTelemetryEvent } from '../telemetry/sendKernelTelemetryEvent';
import { trackKernelResourceInformation } from '../telemetry/helper';
import { captureTelemetry } from '../../telemetry';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { captureTelemetry, Telemetry } from '../../telemetry';
import { CellOutputDisplayIdTracker } from './cellDisplayIdTracker';
import {
IJupyterSession,
Expand Down
5 changes: 2 additions & 3 deletions src/kernels/helpers.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import { traceError, traceVerbose } from '../platform/logging';
import { getDisplayPath } from '../platform/common/platform/fs-paths';
import { IPythonExecutionFactory } from '../platform/common/process/types.node';
import { Resource } from '../platform/common/types';
import { concatMultilineString } from '../platform/common/utils';
import { trackKernelResourceInformation } from './telemetry/helper';
import { areInterpreterPathsSame } from '../platform/pythonEnvironments/info/interpreter';
import { sendTelemetryEvent } from '../telemetry';
import { concatMultilineString } from '../webviews/webview-side/common';
import { Telemetry } from '../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../telemetry';
import { executeSilently, isPythonKernelConnection } from './helpers';

export async function sendTelemetryForPythonKernelExecutable(
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/installer/productInstaller.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ import {
} from '../../platform/common/types';
import { noop } from '../../platform/common/utils/misc';
import { IServiceContainer } from '../../platform/ioc/types';
import { sendTelemetryEvent } from '../../telemetry';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { InterpreterPackages } from '../../telemetry/interpreterPackages.node';
import { getInterpreterHash } from '../../platform/pythonEnvironments/info/interpreter';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { STANDARD_OUTPUT_CHANNEL } from '../../platform/common/constants';
import { sleep } from '../../platform/common/utils/async';
import { trackPackageInstalledIntoInterpreter } from './productInstaller';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import { noop } from '../../platform/common/utils/misc';
import { stripAnsi } from '../../platform/common/utils/regexp';
import { InteractiveWindowMessages, IPyWidgetMessages } from '../../platform/messageTypes';
import { IServiceContainer } from '../../platform/ioc/types';
import { sendTelemetryEvent } from '../../telemetry';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { getTelemetrySafeHashedString } from '../../telemetry/helpers';
import { Telemetry, Commands } from '../../webviews/webview-side/common/constants';
import { Commands } from '../../webviews/webview-side/common/constants';
import {
LoadIPyWidgetClassLoadAction,
ILoadIPyWidgetClassFailureAction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { Deferred, createDeferred } from '../../platform/common/utils/async';
import { noop } from '../../platform/common/utils/misc';
import { deserializeDataViews, serializeDataViews } from '../../platform/common/utils/serializers';
import { IPyWidgetMessages, IInteractiveWindowMapping } from '../../platform/messageTypes';
import { sendTelemetryEvent } from '../../telemetry';
import { Identifiers, Telemetry } from '../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { Identifiers } from '../../webviews/webview-side/common/constants';
import { IKernel, IKernelProvider, KernelSocketInformation } from '../types';
import { WIDGET_MIMETYPE } from './constants';
import { IIPyWidgetMessageDispatcher, IPyWidgetMessage } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import {
IDisposable
} from '../../platform/common/types';
import { InteractiveWindowMessages, IPyWidgetMessages } from '../../platform/messageTypes';
import { sendTelemetryEvent } from '../../telemetry';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { IKernel, IKernelProvider } from '../types';
import { IPyWidgetScriptSourceProvider } from './ipyWidgetScriptSourceProvider';
import { ILocalResourceUriConverter, IWidgetScriptSourceProviderFactory, WidgetScriptSource } from './types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import {
import { Deferred, createDeferred } from '../../platform/common/utils/async';
import { DataScience, Common } from '../../platform/common/utils/localize';
import { noop } from '../../platform/common/utils/misc';
import { sendTelemetryEvent } from '../../telemetry';
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
import { getTelemetrySafeHashedString } from '../../telemetry/helpers';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { IKernel } from '../types';
import {
ILocalResourceUriConverter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { traceError } from '../../platform/logging';
import { IFileSystemNode } from '../../platform/common/platform/types.node';
import { IPythonExecutionFactory } from '../../platform/common/process/types.node';
import { IInterpreterService } from '../../platform/interpreter/contracts';
import { captureTelemetry } from '../../telemetry';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { captureTelemetry, Telemetry } from '../../telemetry';
import {
getInterpreterFromKernelConnectionMetadata,
isPythonKernelConnection,
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/jupyter/import-export/jupyterExporter.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import { traceError } from '../../../platform/logging';
import { IPlatformService } from '../../../platform/common/platform/types';
import { IFileSystemNode } from '../../../platform/common/platform/types.node';
import { ICell, IConfigurationService } from '../../../platform/common/types';
import { pruneCell } from '../../../platform/common/utils';
import { concatMultilineString, pruneCell } from '../../../platform/common/utils';
import { DataScience } from '../../../platform/common/utils/localize';
import { IDataScienceErrorHandler } from '../../../platform/errors/types';
import { concatMultilineString } from '../../../webviews/webview-side/common';
import { defaultNotebookFormat, CodeSnippets } from '../../../webviews/webview-side/common/constants';
import { INotebookExporter, IJupyterExecution } from '../types';
import { openAndShowNotebook } from '../../../platform/common/utils/notebooks';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { traceError } from '../../../platform/logging';
import { DataScience, Common } from '../../../platform/common/utils/localize';
import { noop } from '../../../platform/common/utils/misc';
import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info';
import { sendTelemetryEvent } from '../../../telemetry';
import { Telemetry, JupyterCommands } from '../../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../../telemetry';
import { JupyterCommands } from '../../../webviews/webview-side/common/constants';
import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError';
import { ProductNames } from '../../installer/productNames';
import { Product, IInstaller, InstallerResponse } from '../../installer/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { inject, injectable } from 'inversify';
import { IExtensionSingleActivationService } from '../../../platform/activation/types';
import { ICommandManager } from '../../../platform/common/application/types';
import { IDisposableRegistry } from '../../../platform/common/types';
import { sendTelemetryEvent } from '../../../telemetry';
import { Telemetry } from '../../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../../telemetry';
import { JupyterInterpreterService } from './jupyterInterpreterService.node';

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import '../../../platform/common/extensions';
import { noop } from '../../../platform/common/utils/misc';
import { IInterpreterService } from '../../../platform/interpreter/contracts';
import { PythonEnvironment } from '../../../platform/pythonEnvironments/info';
import { sendTelemetryEvent } from '../../../telemetry';
import { Telemetry } from '../../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../../telemetry';
import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError';
import { JupyterInterpreterDependencyService } from './jupyterInterpreterDependencyService.node';
import { JupyterInterpreterOldCacheStateStore } from './jupyterInterpreterOldCacheStateStore.node';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ import { EXTENSION_ROOT_DIR } from '../../../platform/constants.node';
import { IEnvironmentActivationService } from '../../../platform/interpreter/activation/types';
import { IInterpreterService } from '../../../platform/interpreter/contracts';
import { PythonEnvironment } from '../../../platform/pythonEnvironments/info';
import { sendTelemetryEvent } from '../../../telemetry';
import {
JupyterDaemonModule,
JUPYTER_OUTPUT_CHANNEL,
Telemetry
} from '../../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, Telemetry } from '../../../telemetry';
import { JupyterDaemonModule, JUPYTER_OUTPUT_CHANNEL } from '../../../webviews/webview-side/common/constants';
import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError';
import { Product } from '../../installer/types';
import { JupyterPaths } from '../../raw/finder/jupyterPaths.node';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CancellationToken } from 'vscode';
import { parseSemVer } from '../../../platform/common/utils.node';
import { PythonEnvironment } from '../../../platform/pythonEnvironments/info';
import { ResourceSet } from '../../../platform/vscode-path/map';
import { JupyterCommands } from '../../../webviews/webview-side/common/constants';
import { JupyterCommands } from '../../../telemetry';
import { IInstaller, Product } from '../../installer/types';
import { INbConvertInterpreterDependencyChecker } from '../types';
import { IJupyterCommandFactory } from '../types.node';
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import { IVSCodeNotebook } from '../../platform/common/application/types';
import { disposeAllDisposables } from '../../platform/common/helpers';
import { IDisposableRegistry } from '../../platform/common/types';
import { isJupyterNotebook } from '../../platform/common/utils';
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
import { captureTelemetry, sendTelemetryEvent, Telemetry } from '../../telemetry';
import { getTelemetrySafeHashedString } from '../../telemetry/helpers';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { createJupyterCellFromVSCNotebookCell } from '../execution/helpers';
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
const flatten = require('lodash/flatten') as typeof import('lodash/flatten');
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/jupyter/jupyterKernelService.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import { noop } from '../../platform/common/utils/misc';
import { IEnvironmentVariablesService } from '../../platform/common/variables/types';
import { IEnvironmentActivationService } from '../../platform/interpreter/activation/types';
import { PythonEnvironment } from '../../platform/pythonEnvironments/info';
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
import { Telemetry } from '../../webviews/webview-side/common/constants';
import { captureTelemetry, sendTelemetryEvent, Telemetry } from '../../telemetry';
import { JupyterKernelDependencyError } from '../../platform/errors/jupyterKernelDependencyError';
import { getKernelRegistrationInfo, cleanEnvironment } from '../helpers';
import { JupyterPaths } from '../raw/finder/jupyterPaths.node';
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/jupyter/launcher/commandLineSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import {
InputStep,
IQuickPickParameters
} from '../../../platform/common/utils/multiStepInput';
import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry';
import { Telemetry } from '../../../webviews/webview-side/common/constants';
import { captureTelemetry, sendTelemetryEvent, Telemetry } from '../../../telemetry';

@injectable()
export class JupyterCommandLineSelector {
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/jupyter/launcher/jupyterExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import { JupyterSelfCertsError } from '../../../platform/errors/jupyterSelfCerts
import { JupyterWaitForIdleError } from '../../../platform/errors/jupyterWaitForIdleError';
import { IInterpreterService } from '../../../platform/interpreter/contracts';
import { PythonEnvironment } from '../../../platform/pythonEnvironments/info';
import { sendTelemetryEvent, captureTelemetry } from '../../../telemetry';
import { Telemetry } from '../../../webviews/webview-side/common/constants';
import { sendTelemetryEvent, captureTelemetry, Telemetry } from '../../../telemetry';
import { expandWorkingDir } from '../jupyterUtils';
import { IJupyterConnection } from '../../types';
import {
Expand Down
3 changes: 1 addition & 2 deletions src/kernels/jupyter/launcher/jupyterPasswordConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { IApplicationShell } from '../../../platform/common/application/types';
import { IAsyncDisposableRegistry, IConfigurationService, IDisposableRegistry } from '../../../platform/common/types';
import { DataScience } from '../../../platform/common/utils/localize';
import { IMultiStepInputFactory, IMultiStepInput } from '../../../platform/common/utils/multiStepInput';
import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry';
import { Telemetry } from '../../../webviews/webview-side/common/constants';
import { captureTelemetry, sendTelemetryEvent, Telemetry } from '../../../telemetry';
import {
IJupyterPasswordConnect,
IJupyterPasswordConnectInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { DataScience } from '../../../../platform/common/utils/localize';
import { StopWatch } from '../../../../platform/common/utils/stopWatch';
import { SessionDisposedError } from '../../../../platform/errors/sessionDisposedError';
import { sendKernelTelemetryEvent } from '../../../telemetry/sendKernelTelemetryEvent';
import { Telemetry } from '../../../../webviews/webview-side/common/constants';
import { Telemetry } from '../../../../telemetry';
import {
KernelConnectionMetadata,
isLocalConnection,
Expand Down
2 changes: 1 addition & 1 deletion src/kernels/jupyter/launcher/notebookProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { inject, injectable, optional } from 'inversify';
import { IPythonExtensionChecker } from '../../../platform/api/types';
import { trackKernelResourceInformation } from '../../telemetry/helper';
import { Telemetry } from '../../../webviews/webview-side/common/constants';
import { Telemetry } from '../../../telemetry';
import {
ConnectNotebookProviderOptions,
GetServerOptions,
Expand Down
Loading

0 comments on commit d51447d

Please sign in to comment.