From 46f103d0f853653aca934cf02d4bd93313a4ceca Mon Sep 17 00:00:00 2001 From: Rich Chiodo Date: Tue, 22 Mar 2022 15:01:30 -0700 Subject: [PATCH] Create platform directory structure (#9439) * Rename client to platform * Move telemetry and fix registration issues * Move telemetry too * Fix root dir and missing registrations * Add news entry * Finish updating client from paths * Put launch.json back * Update telemetry file * Update linter * Package lock needs an update? * More linting * More linting * Put package-lock.json back * More linter fixes * Insiders? change to add extra line to document text * Review feedback * Fix problem with python extension upgrade. Fix pipInstaller ctor * Fix typo --- .eslintrc.js | 485 +---- .github/workflows/build-test.yml | 2 +- .prettierignore | 2 +- .sonarcloud.properties | 4 +- .vscodeignore | 2 +- CONTRIBUTING.md | 3 +- TELEMETRY.md | 1642 ++++++++++------- build/existingFiles.json | 644 +++---- .../messagesMustBeLocalizedRule.js | 3 +- build/unlocalizedFiles.json | 48 +- build/webpack/common.js | 2 +- build/webpack/webpack.extension.config.js | 6 +- .../webpack.extension.dependencies.config.js | 2 +- news/3 Code Health/8981.md | 1 + package.json | 2 +- src/client/constants.ts | 16 - src/client/datascience/serviceRegistry.ts | 269 --- src/client/extension.ts | 167 -- src/client/extensionActivation.ts | 186 -- src/client/extensionInit.ts | 35 - src/client/telemetry/types.ts | 10 - src/datascience-ui/common/cellFactory.ts | 11 +- src/datascience-ui/common/index.ts | 6 +- .../data-explorer/cellFormatter.tsx | 2 +- .../data-explorer/mainPanel.tsx | 6 +- .../data-explorer/reactSlickGrid.tsx | 4 +- .../data-explorer/sliceControl.tsx | 4 +- .../interactive-common/buildSettingsCss.ts | 2 +- .../interactive-common/mainState.ts | 2 +- .../interactive-common/redux/helpers.ts | 4 +- .../interactive-common/redux/postOffice.ts | 2 +- .../redux/reducers/commonEffects.ts | 4 +- .../redux/reducers/helpers.ts | 2 +- .../redux/reducers/transfer.ts | 4 +- .../redux/reducers/types.ts | 9 +- .../redux/reducers/variables.ts | 4 +- .../interactive-common/redux/store.ts | 2 +- .../interactive-common/variableExplorer.tsx | 2 +- .../variableExplorerButtonCellFormatter.tsx | 2 +- .../interactive-common/variablePanel.tsx | 2 +- .../ipywidgets/common/kernel.ts | 8 +- .../ipywidgets/common/manager.ts | 6 +- .../ipywidgets/common/scriptManager.ts | 10 +- src/datascience-ui/ipywidgets/common/types.ts | 2 +- src/datascience-ui/ipywidgets/kernel/index.ts | 4 +- .../ipywidgets/webViews/container.tsx | 6 +- src/datascience-ui/plot/mainPanel.tsx | 10 +- src/datascience-ui/react-common/constants.ts | 2 +- src/datascience-ui/react-common/postOffice.ts | 4 +- .../react-common/settingsReactSide.ts | 2 +- .../react-common/styleInjector.tsx | 4 +- .../variable-view/redux/actions.ts | 4 +- .../variable-view/redux/mapping.ts | 2 +- .../variable-view/redux/reducers/index.ts | 4 +- src/extension.ts | 351 ++++ src/extension/serviceRegistry.ts | 10 - src/intellisense/cellLanguageService.ts | 18 +- src/intellisense/conversion.ts | 2 +- src/intellisense/diagnosticsProvider.ts | 12 +- .../emptyNotebookCellLanguageService.ts | 14 +- src/intellisense/intellisenseProvider.ts | 16 +- src/intellisense/languageServer.ts | 12 +- src/intellisense/logReplayService.ts | 16 +- .../pythonKernelCompletionProvider.ts | 20 +- ...honKernelCompletionProviderRegistration.ts | 6 +- src/intellisense/serviceRegistry.ts | 19 + .../commands/activeEditorContext.ts | 16 +- .../commands/commandRegistry.ts | 34 +- .../commands/exportCommands.ts | 26 +- .../cellHashProviderFactory.ts | 10 +- .../editor-integration/cellhashprovider.ts | 30 +- .../editor-integration/codeLensFactory.ts | 14 +- .../editor-integration/codelensprovider.ts | 26 +- .../editor-integration/codewatcher.ts | 32 +- .../editor-integration/decorator.ts | 12 +- .../editor-integration/hoverProvider.ts | 24 +- src/interactive-window/helpers.ts | 4 +- src/interactive-window/identity.ts | 4 +- src/interactive-window/interactiveWindow.ts | 44 +- .../interactiveWindowCommandListener.ts | 28 +- .../interactiveWindowProvider.ts | 22 +- src/interactive-window/serviceRegistry.ts | 6 +- src/kernels/common/baseJupyterSession.ts | 30 +- src/kernels/common/delayedFutureExecute.ts | 6 +- src/kernels/common/kernelSocketWrapper.ts | 4 +- .../debugging/interactiveWindowDebugger.ts | 16 +- src/kernels/debugging/jupyterDebugService.ts | 14 +- src/kernels/helpers.ts | 40 +- src/kernels/installer/channelManager.ts | 10 +- src/kernels/installer/condaInstaller.ts | 6 +- src/kernels/installer/moduleInstaller.ts | 27 +- src/kernels/installer/pipEnvInstaller.ts | 14 +- src/kernels/installer/pipInstaller.ts | 16 +- src/kernels/installer/pipenv.ts | 6 +- src/kernels/installer/poetry.ts | 13 +- src/kernels/installer/poetryInstaller.ts | 10 +- src/kernels/installer/productInstaller.ts | 28 +- src/kernels/installer/productPath.ts | 9 +- src/kernels/installer/pyenv.ts | 4 +- src/kernels/installer/serviceRegistry.ts | 2 +- src/kernels/installer/types.ts | 4 +- .../cdnWidgetScriptSourceProvider.ts | 12 +- .../commonMessageCoordinator.ts | 32 +- .../ipyWidgetMessageDispatcher.ts | 16 +- .../ipyWidgetMessageDispatcherFactory.ts | 4 +- .../ipyWidgetScriptSource.ts | 24 +- .../ipyWidgetScriptSourceProvider.ts | 26 +- .../localWidgetScriptSourceProvider.ts | 12 +- .../notebookIPyWidgetCoordinator.ts | 22 +- .../remoteWidgetScriptSourceProvider.ts | 4 +- .../ipywidgets-message-coordination/types.ts | 4 +- .../jupyter/import-export/jupyterExporter.ts | 16 +- .../jupyter/import-export/jupyterImporter.ts | 18 +- .../jupyter/interpreter/jupyterCommand.ts | 10 +- .../jupyterInterpreterDependencyService.ts | 24 +- .../jupyterInterpreterOldCacheStateStore.ts | 4 +- .../jupyterInterpreterSelectionCommand.ts | 8 +- .../interpreter/jupyterInterpreterSelector.ts | 12 +- .../interpreter/jupyterInterpreterService.ts | 14 +- .../jupyterInterpreterStateStore.ts | 8 +- ...erInterpreterSubCommandExecutionService.ts | 24 +- .../nbconvertExportToPythonService.ts | 10 +- .../nbconvertInterpreterDependencyChecker.ts | 6 +- .../jupyterCellOutputMimeTypeTracker.ts | 12 +- src/kernels/jupyter/jupyterKernelService.ts | 30 +- src/kernels/jupyter/jupyterKernelSpec.ts | 4 +- .../jupyter/jupyterUriProviderRegistration.ts | 6 +- .../jupyter/jupyterUriProviderWrapper.ts | 4 +- src/kernels/jupyter/jupyterUtils.ts | 12 +- .../jupyter/launcher/commandLineSelector.ts | 10 +- .../jupyter/launcher/jupyterConnection.ts | 22 +- .../jupyter/launcher/jupyterExecution.ts | 28 +- .../jupyter/launcher/jupyterNotebook.ts | 2 +- .../launcher/jupyterNotebookProvider.ts | 6 +- .../launcher/jupyterPasswordConnect.ts | 12 +- .../liveshare/hostJupyterExecution.ts | 22 +- .../launcher/liveshare/hostJupyterServer.ts | 28 +- .../jupyter/launcher/liveshare/serverCache.ts | 18 +- .../jupyter/launcher/notebookProvider.ts | 17 +- .../launcher/notebookServerProvider.ts | 22 +- .../jupyter/launcher/notebookStarter.ts | 30 +- src/kernels/jupyter/launcher/serverPreload.ts | 19 +- .../jupyter/launcher/serverUriStorage.ts | 8 +- src/kernels/jupyter/serverSelector.ts | 16 +- src/kernels/jupyter/session/jupyterSession.ts | 24 +- .../jupyter/session/jupyterSessionManager.ts | 14 +- .../session/jupyterSessionManagerFactory.ts | 6 +- .../jupyter/session/jupyterWebSocket.ts | 6 +- src/kernels/kernel.ts | 43 +- src/kernels/kernelCommandListener.ts | 18 +- src/kernels/kernelConnectionWrapper.ts | 2 +- src/kernels/kernelDependencyService.ts | 32 +- src/kernels/kernelProvider.ts | 16 +- src/kernels/raw/finder/jupyterPaths.ts | 10 +- src/kernels/raw/finder/localKernelFinder.ts | 32 +- .../raw/finder/localKernelSpecFinderBase.ts | 34 +- .../finder/localKnownPathKernelSpecFinder.ts | 16 +- ...thonAndRelatedNonPythonKernelSpecFinder.ts | 24 +- .../finder/preferredRemoteKernelIdProvider.ts | 8 +- .../raw/finder/pythonKernelInterruptDaemon.ts | 10 +- src/kernels/raw/finder/remoteKernelFinder.ts | 22 +- .../raw/launcher/kernelEnvVarsService.ts | 18 +- src/kernels/raw/launcher/kernelLauncher.ts | 26 +- src/kernels/raw/launcher/kernelProcess.ts | 36 +- .../raw/session/hostRawNotebookProvider.ts | 28 +- src/kernels/raw/session/rawJupyterSession.ts | 30 +- src/kernels/raw/session/rawKernel.ts | 10 +- .../session/rawNotebookSupportedService.ts | 8 +- src/kernels/raw/session/rawSession.ts | 18 +- src/kernels/raw/session/rawSocket.ts | 6 +- src/kernels/raw/types.ts | 4 +- src/kernels/serviceRegistry.ts | 278 +++ src/kernels/types.ts | 6 +- .../variables/debuggerVariableRegistration.ts | 12 +- src/kernels/variables/debuggerVariables.ts | 16 +- src/kernels/variables/jupyterVariables.ts | 6 +- src/kernels/variables/kernelVariables.ts | 10 +- src/kernels/variables/preWarmVariables.ts | 18 +- .../variables/pythonVariableRequester.ts | 14 +- src/kernels/variables/variableScriptLoader.ts | 6 +- .../kernelFilter/kernelFilterService.ts | 8 +- .../kernelFilter/kernelFilterUI.ts | 12 +- src/notebooks/controllers/kernelSelector.ts | 12 +- .../controllers/liveKernelSwitcher.ts | 8 +- .../noPythonKernelsNotebookController.ts | 14 +- .../controllers/notebookControllerManager.ts | 44 +- src/notebooks/controllers/remoteSwitcher.ts | 12 +- .../controllers/vscodeNotebookController.ts | 48 +- .../execution/cellDisplayIdTracker.ts | 2 +- src/notebooks/execution/cellExecution.ts | 28 +- src/notebooks/execution/cellExecutionQueue.ts | 6 +- src/notebooks/execution/kernelExecution.ts | 18 +- src/notebooks/execution/notebookUpdater.ts | 2 +- src/notebooks/helpers.ts | 18 +- src/notebooks/notebookCommandListener.ts | 10 +- src/notebooks/notebookEditorProvider.ts | 10 +- src/notebooks/notebookUsageTracker.ts | 8 +- src/notebooks/outputs/errorRendererComms.ts | 12 +- src/notebooks/outputs/plotSaveHandler.ts | 12 +- src/notebooks/outputs/plotViewHandler.ts | 6 +- .../outputs/rendererCommunication.ts | 8 +- src/notebooks/serviceRegistry.ts | 23 +- src/notebooks/types.ts | 2 +- src/{client => platform}/.gitignore | 0 src/{client => platform}/.vscodeignore | 0 .../activation/activationManager.ts | 2 +- .../migrateDataScienceSettingsService.ts | 0 .../activation/serviceRegistry.ts | 0 src/{client => platform}/activation/types.ts | 0 src/{client => platform}/api.ts | 0 .../api/apiAccessService.ts | 2 +- src/{client => platform}/api/extension.d.ts | 0 src/{client => platform}/api/kernelApi.ts | 2 +- src/{client => platform}/api/pythonApi.ts | 29 +- .../api/serviceRegistry.ts | 0 src/{client => platform}/api/types.ts | 2 +- .../commands/commandLineSelector.ts | 6 +- .../commands/commandRegistry.ts | 4 +- .../commands/serverSelector.ts | 8 +- src/{client => platform}/common/amlContext.ts | 2 +- .../common/application/activeResource.ts | 0 .../application/applicationEnvironment.ts | 0 .../common/application/applicationShell.ts | 2 +- .../common/application/clipboard.ts | 0 .../common/application/commandManager.ts | 2 +- .../common/application/commands.ts | 2 +- .../application/commands/reloadCommand.ts | 0 .../common/application/debugService.ts | 0 .../common/application/documentManager.ts | 0 .../common/application/encryptedStorage.ts | 6 +- .../common/application/extensions.ts | 0 .../common/application/languageService.ts | 0 .../common/application/notebook.ts | 0 .../common/application/types.ts | 0 .../application/webviewPanels/webviewPanel.ts | 0 .../webviewPanels/webviewPanelProvider.ts | 0 .../application/webviewViews/webviewView.ts | 0 .../webviewViews/webviewViewProvider.ts | 0 .../common/application/webviews/webview.ts | 0 .../common/application/workspace.ts | 0 .../common/asyncDisposableRegistry.ts | 0 .../common/cancellation.ts | 2 +- .../common/configSettings.ts | 0 .../common/configuration/service.ts | 0 src/{client => platform}/common/constants.ts | 0 src/{client => platform}/common/contextKey.ts | 0 src/{client => platform}/common/crypto.ts | 0 .../common/experiments/groups.ts | 0 .../common/experiments/service.ts | 4 +- .../common/experiments/telemetry.ts | 2 +- src/{client => platform}/common/extensions.ts | 0 .../common/featureDeprecationManager.ts | 0 src/{client => platform}/common/helpers.ts | 2 +- .../common/helpers.unit.test.ts | 0 src/{client => platform}/common/logger.ts | 0 .../common/net/browser.ts | 2 +- .../common/net/fileDownloader.ts | 0 .../common/net/httpClient.ts | 0 .../common/net/portAttributeProvider.ts | 0 .../common/net/socket/SocketStream.ts | 0 .../net/socket/socketCallbackHandler.ts | 0 .../common/net/socket/socketServer.ts | 2 - .../common/persistentState.ts | 0 .../common/platform/constants.ts | 0 .../common/platform/errors.ts | 0 .../common/platform/fileSystem.ts | 0 .../common/platform/fileSystemUtils.ts | 0 .../common/platform/fileUtils.ts | 0 .../common/platform/fs-paths.ts | 0 .../common/platform/fs-temp.ts | 0 .../common/platform/pathUtils.ts | 0 .../common/platform/platformService.ts | 4 +- .../common/platform/serviceRegistry.ts | 0 .../common/platform/types.ts | 0 .../common/process/baseDaemon.ts | 2 +- .../common/process/condaService.ts | 0 .../common/process/constants.ts | 0 .../common/process/currentProcess.ts | 0 .../common/process/decoder.ts | 0 .../process/environmentActivationService.ts | 4 +- .../common/process/internal/python.ts | 0 .../common/process/internal/scripts/index.ts | 0 .../process/internal/scripts/testing_tools.ts | 0 .../scripts/vscode_datascience_helpers.ts | 0 .../common/process/logger.ts | 0 .../common/process/proc.ts | 0 .../common/process/processFactory.ts | 0 .../common/process/pythonDaemon.ts | 0 .../common/process/pythonDaemonFactory.ts | 0 .../common/process/pythonDaemonPool.ts | 0 .../common/process/pythonEnvironment.ts | 0 .../common/process/pythonExecutionFactory.ts | 4 +- .../common/process/pythonProcess.ts | 4 +- .../common/process/serviceRegistry.ts | 0 .../common/process/types.ts | 2 +- src/{client => platform}/common/refBool.ts | 0 .../common/serviceRegistry.ts | 13 +- src/{client => platform}/common/types.ts | 0 .../common/utils/async.ts | 2 +- .../common/utils/cacheUtils.ts | 0 .../common/utils/decorators.ts | 0 .../common/utils/icons.ts | 0 .../common/utils/localize.ts | 0 .../common/utils/logging.ts | 0 src/{client => platform}/common/utils/misc.ts | 0 .../common/utils/multiStepInput.ts | 0 .../common/utils/platform.ts | 0 .../common/utils/regexp.ts | 0 .../common/utils/serializers.ts | 0 .../common/utils/stopWatch.ts | 0 .../common/utils/sysTypes.ts | 0 src/{client => platform}/common/utils/text.ts | 0 .../common/utils/version.ts | 0 .../common/variables/environment.ts | 4 +- .../variables/environmentVariablesProvider.ts | 2 +- .../common/variables/serviceRegistry.ts | 0 .../common/variables/sysTypes.ts | 0 .../common/variables/systemVariables.ts | 0 .../common/variables/types.ts | 0 src/platform/constants.ts | 14 + .../datascience/activation.ts | 2 +- .../datascience/cellFactory.ts | 2 +- .../datascience/cellMatcher.ts | 0 .../datascience/codeCssGenerator.ts | 0 .../datascience/common.ts | 4 +- .../datascience/constants.ts | 0 .../datascience/data-viewing/dataViewer.ts | 6 +- .../dataViewerDependencyService.ts | 2 +- .../data-viewing/dataViewerFactory.ts | 2 +- .../data-viewing/dataViewerMessageListener.ts | 0 .../jupyterVariableDataProvider.ts | 0 .../jupyterVariableDataProviderFactory.ts | 0 .../datascience/data-viewing/types.ts | 2 +- .../datascience/dataScienceSurveyBanner.ts | 0 .../datascience/datascience.ts | 2 +- .../datascience/debugLocationTracker.ts | 2 - .../debugLocationTrackerFactory.ts | 0 .../datascience/displayOptions.ts | 0 .../datascience/export/README.md | 0 .../datascience/export/exportBase.ts | 0 .../datascience/export/exportDialog.ts | 0 .../datascience/export/exportFileOpener.ts | 4 +- .../export/exportInterpreterFinder.ts | 0 .../datascience/export/exportToHTML.ts | 0 .../datascience/export/exportToPDF.ts | 0 .../datascience/export/exportToPython.ts | 0 .../datascience/export/exportToPythonPlain.ts | 4 +- .../datascience/export/exportUtil.ts | 0 .../datascience/export/fileConverter.ts | 2 +- .../datascience/export/types.ts | 0 .../datascience/extensionRecommendation.ts | 2 +- .../datascience/messages.ts | 0 .../datascience/multiplexingDebugService.ts | 0 .../datascience/plotting/plotViewer.ts | 4 +- .../plotting/plotViewerMessageListener.ts | 0 .../plotting/plotViewerProvider.ts | 2 +- .../datascience/plotting/types.ts | 0 .../datascience/prereleaseChecker.ts | 0 .../datascience/progress/decorator.ts | 0 .../progress/kernelProgressReporter.ts | 0 .../datascience/progress/messages.ts | 0 .../datascience/progress/progressReporter.ts | 0 .../datascience/progress/types.ts | 0 src/platform/datascience/serviceRegistry.ts | 87 + .../datascience/shiftEnterBanner.ts | 2 +- .../datascience/statusProvider.ts | 0 .../datascience/telemetry/types.ts | 0 .../datascience/themeFinder.ts | 0 src/{client => platform}/datascience/types.ts | 2 +- src/{client => platform}/datascience/utils.ts | 0 .../variablesView/notebookWatcher.ts | 0 .../datascience/variablesView/types.ts | 2 +- .../datascience/variablesView/variableView.ts | 32 +- .../variableViewActivationService.ts | 0 .../variableViewMessageListener.ts | 0 .../variablesView/variableViewProvider.ts | 0 .../datascience/webviews/webviewHost.ts | 18 +- .../datascience/webviews/webviewPanelHost.ts | 21 +- .../datascience/webviews/webviewViewHost.ts | 17 +- .../debugger/constants.ts | 0 .../extension/helpers/protocolParser.ts | 0 .../debugger/extension/types.ts | 0 .../debugger/jupyter/debugControllers.ts | 2 +- .../debugger/jupyter/debugger.ts | 0 .../debugger/jupyter/debuggingManager.ts | 2 +- .../debugger/jupyter/helper.ts | 0 .../debugger/jupyter/kernelDebugAdapter.ts | 2 +- src/{client => platform}/debugger/types.ts | 0 .../devTools/README.md | 0 .../devTools/clearCache.ts | 2 +- .../devTools/jupyterOutputChannel.ts | 4 +- src/platform/devTools/serviceRegistry.ts | 11 + .../errors/errorHandler.ts | 18 +- .../errors/errorUtils.ts | 4 +- src/{extension => platform}/errors/errors.ts | 0 src/{extension => platform}/errors/index.ts | 2 +- .../errors/interactiveCellResultError.ts | 0 .../errors/jupyterConnectError.ts | 0 .../errors/jupyterDataRateLimitError.ts | 2 +- .../jupyterDebuggerNotInstalledError.ts | 2 +- .../jupyterDebuggerRemoteNotSupportedError.ts | 2 +- .../errors/jupyterInstallError.ts | 0 .../errors/jupyterInvalidKernelError.ts | 4 +- .../errors/jupyterKernelDependencyError.ts | 4 +- .../errors/jupyterSelfCertsError.ts | 0 .../errors/jupyterWaitForIdleError.ts | 4 +- .../errors/kernelConnectionTimeoutError.ts | 2 +- .../errors/kernelDeadError.ts | 2 +- .../errors/kernelDiedError.ts | 0 .../errors/kernelInterruptTimeoutError.ts | 2 +- .../errors/kernelPortNotUsedTimeoutError.ts | 2 +- .../errors/kernelProcessExitedError.ts | 2 +- .../errors/moduleNotInstalledError.ts | 0 .../errors/sessionDisposedError.ts | 2 +- src/{extension => platform}/errors/types.ts | 0 .../interpreter/activation/types.ts | 0 .../interpreter/configuration/types.ts | 0 .../interpreter/contracts.ts | 0 .../interpreter/display/visibilityFilter.ts | 0 src/{client => platform}/ioc/container.ts | 0 src/{client => platform}/ioc/index.ts | 0 .../ioc/serviceManager.ts | 7 +- src/{client => platform}/ioc/types.ts | 3 +- .../language/languageConfiguration.ts | 0 src/{client => platform}/logging/_global.ts | 0 .../logging/formatters.ts | 0 .../logging/gitHubIssueCodeLensProvider.ts | 0 .../logging/gitHubIssueCommandListener.ts | 0 src/{client => platform}/logging/index.ts | 0 src/{client => platform}/logging/levels.ts | 4 +- src/{client => platform}/logging/logger.ts | 6 +- .../logging/serviceRegistry.ts | 0 src/{client => platform}/logging/trace.ts | 2 +- .../logging/transports.ts | 4 +- src/{client => platform}/logging/util.ts | 0 src/{extension => platform}/messageTypes.ts | 4 +- .../pythonEnvironments/exec.ts | 0 .../pythonEnvironments/info/executable.ts | 0 .../pythonEnvironments/info/index.ts | 0 .../pythonEnvironments/info/interpreter.ts | 0 .../pythonEnvironments/info/pythonVersion.ts | 0 src/platform/serviceRegistry.ts | 23 + src/{client => platform}/startupTelemetry.ts | 6 +- .../terminals/codeExecution/helper.ts | 0 .../terminals/serviceRegistry.ts | 0 src/{client => platform}/terminals/types.ts | 0 .../testing/common/constants.ts | 0 src/{client => }/telemetry/constants.ts | 0 .../telemetry/envFileTelemetry.ts | 8 +- .../telemetry/extensionInstallTelemetry.ts | 4 +- src/{client => }/telemetry/helpers.ts | 4 +- src/{client => }/telemetry/importTracker.ts | 18 +- src/{client => }/telemetry/index.ts | 28 +- .../telemetry/interpreterCountTracker.ts | 10 +- .../telemetry/interpreterPackageTracker.ts | 16 +- .../telemetry/interpreterPackages.ts | 16 +- .../telemetry/kernelTelemetry.ts | 10 +- .../telemetry/languageInitializer.ts | 6 +- .../telemetry/serviceRegistry.ts | 6 +- .../datascience => }/telemetry/telemetry.ts | 33 +- src/telemetry/types.ts | 92 + .../telemetry/workspaceInterpreterTracker.ts | 14 +- ...ateDataScienceSettingsService.unit.test.ts | 14 +- src/test/client/api.vscode.test.ts | 6 +- src/test/common.ts | 16 +- .../commands/reloadCommand.unit.test.ts | 10 +- .../common/configuration/service.unit.test.ts | 10 +- .../configuration/service.vscode.test.ts | 6 +- src/test/common/crypto.unit.test.ts | 2 +- .../common/experiments/service.unit.test.ts | 16 +- .../common/experiments/telemetry.unit.test.ts | 4 +- src/test/common/extensions.unit.test.ts | 2 +- src/test/common/helpers.vscode.test.ts | 2 +- src/test/common/misc.vscode.test.ts | 2 +- .../common/net/fileDownloader.unit.test.ts | 20 +- src/test/common/net/httpClient.unit.test.ts | 6 +- src/test/common/platform/errors.unit.test.ts | 2 +- .../common/platform/filesystem.unit.test.ts | 4 +- .../platform/fs-paths.functional.test.ts | 2 +- .../common/platform/fs-paths.unit.test.ts | 4 +- .../platform/fs-temp.functional.test.ts | 4 +- src/test/common/platform/fs-temp.unit.test.ts | 2 +- .../platform/pathUtils.functional.test.ts | 4 +- .../platform/platformService.vscode.test.ts | 4 +- .../common/process/decoder.vscode.test.ts | 2 +- src/test/common/process/logger.unit.test.ts | 8 +- src/test/common/process/proc.unit.test.ts | 4 +- .../process/processFactory.unit.test.ts | 18 +- .../process/pythonDaemon.functional.test.ts | 14 +- .../pythonDaemonPool.functional.test.ts | 22 +- .../process/pythonDaemonPool.unit.test.ts | 16 +- .../process/pythonEnvironment.unit.test.ts | 8 +- .../common/process/pythonProcess.unit.test.ts | 10 +- .../process/serviceRegistry.unit.test.ts | 18 +- .../socketCallbackHandler.vscode.test.ts | 8 +- src/test/common/socketStream.vscode.test.ts | 2 +- src/test/common/utils/async.unit.test.ts | 2 +- src/test/common/utils/cacheUtils.unit.test.ts | 2 +- src/test/common/utils/decorators.unit.test.ts | 4 +- .../common/utils/localize.functional.test.ts | 4 +- src/test/common/utils/regexp.unit.test.ts | 2 +- src/test/common/utils/text.unit.test.ts | 2 +- .../envVarsService.functional.test.ts | 6 +- .../variables/envVarsService.unit.test.ts | 4 +- .../variables/envVarsService.vscode.test.ts | 6 +- .../kernelEnvVarsService.unit.test.ts | 14 +- .../variables/serviceRegistry.unit.test.ts | 12 +- src/test/coverage.ts | 2 +- src/test/datascience/activation.unit.test.ts | 24 +- src/test/datascience/cellFactory.unit.test.ts | 2 +- src/test/datascience/cellMatcher.unit.test.ts | 4 +- .../commands/serverSelector.unit.test.ts | 8 +- .../data-viewing/dataViewer.unit.test.ts | 30 +- .../dataViewerDependencyService.unit.test.ts | 16 +- src/test/datascience/datascience.unit.test.ts | 20 +- .../datascienceSurveyBanner.vscode.test.ts | 14 +- .../dataviewer.functional.test.tsx | 14 +- .../debugLocationTracker.unit.test.ts | 4 +- src/test/datascience/debugger.vscode.test.ts | 12 +- .../cellhashprovider.unit.test.ts | 10 +- .../codelensprovider.unit.test.ts | 10 +- .../codewatcher.unit.test.ts | 20 +- .../gotocell.functional.test.ts | 18 +- .../hoverProvider.vscode.test.ts | 14 +- .../errorHandler.functional.test.tsx | 8 +- .../datascience/errorHandler.unit.test.ts | 24 +- src/test/datascience/execution.unit.test.ts | 43 +- src/test/datascience/executionServiceMock.ts | 14 +- .../export/exportFileOpener.unit.test.ts | 12 +- .../export/exportToHTML.vscode.test.ts | 6 +- .../export/exportToPython.vscode.test.ts | 8 +- .../export/exportUtil.vscode.test.ts | 4 +- .../export/fileConverter.vscode.test.ts | 18 +- .../extensionRecommendation.unit.test.ts | 14 +- .../group1.nonConda.functional.test.tsx | 2 +- src/test/datascience/helpers.ts | 12 +- .../intellisense.functional.test.tsx | 12 +- .../notebookProvider.unit.test.ts | 14 +- .../notebookServerProvider.unit.test.ts | 12 +- .../interactiveDebugging.vscode.test.ts | 10 +- .../interactiveWindow.functional.test.tsx | 32 +- .../interactiveWindow.vscode.test.ts | 12 +- ...eractiveWindowCommandListener.unit.test.ts | 36 +- .../interactiveWindowRemote.vscode.test.ts | 4 +- .../interactiveWindowTestHelpers.tsx | 8 +- ...nvironmentActivationService.vscode.test.ts | 32 +- ...cdnWidgetScriptSourceProvider.unit.test.ts | 16 +- ...ipyWidgetScriptSourceProvider.unit.test.ts | 26 +- ...calWidgetScriptSourceProvider.unit.test.ts | 14 +- ...rInterpreterDependencyService.unit.test.ts | 10 +- ...erInterpreterSelectionCommand.unit.test.ts | 8 +- .../jupyterInterpreterSelector.unit.test.ts | 12 +- .../jupyterInterpreterService.unit.test.ts | 4 +- .../jupyterInterpreterStateStore.unit.test.ts | 2 +- ...terSubCommandExecutionService.unit.test.ts | 18 +- ...yterCellOutputMimeTypeTracker.unit.test.ts | 14 +- .../jupyter/jupyterConnection.unit.test.ts | 22 +- .../jupyter/jupyterSession.unit.test.ts | 16 +- .../installationPrompts.vscode.test.ts | 28 +- .../kernels/jupyterKernelService.unit.test.ts | 22 +- .../kernelDependencyService.unit.test.ts | 20 +- .../jupyter/serverSelector.unit.test.ts | 22 +- .../jupyterPasswordConnect.unit.test.ts | 8 +- src/test/datascience/jupyterServer.ts | 10 +- ...UriProviderRegistration.functional.test.ts | 8 +- ...upyterUriProviderRegistration.unit.test.ts | 6 +- .../kernelFinder.vscode.test.ts | 12 +- .../localKernelFinder.unit.test.ts | 40 +- .../remoteKernelFinder.unit.test.ts | 10 +- .../datascience/kernelLauncher.vscode.test.ts | 12 +- .../datascience/kernelProcess.unit.test.ts | 12 +- .../datascience/kernelProcess.vscode.test.ts | 14 +- src/test/datascience/mockCommandManager.ts | 4 +- src/test/datascience/mockDebugService.ts | 96 - src/test/datascience/mockDocumentManager.ts | 4 +- src/test/datascience/mockEncryptedStorage.ts | 4 +- src/test/datascience/mockFileSystem.ts | 104 +- src/test/datascience/mockJupyterNotebook.ts | 6 +- src/test/datascience/mockJupyterRequest.ts | 6 +- src/test/datascience/mockJupyterServer.ts | 4 +- src/test/datascience/mockJupyterSession.ts | 14 +- src/test/datascience/mockJupyterSettings.ts | 4 +- src/test/datascience/mockLanguageServer.ts | 6 +- src/test/datascience/mockProcessService.ts | 4 +- src/test/datascience/mockPythonService.ts | 6 +- src/test/datascience/mockStatusProvider.ts | 2 +- src/test/datascience/mockTextEditor.ts | 2 +- src/test/datascience/mountedWebView.ts | 269 --- src/test/datascience/mountedWebViewFactory.ts | 44 - .../nativeEditor.functional.test.tsx | 24 +- .../nativeEditor.toolbar.functional.test.tsx | 2 +- .../nativeEditorViewTracker.unit.test.ts | 8 +- .../datascience/notebook.functional.test.ts | 44 +- .../diagnosticProvider.vscode.test.ts | 10 +- .../executionService.mock.vscode.test.ts | 14 +- .../notebook/executionService.vscode.test.ts | 14 +- .../notebook/exportFull.vscode.test.ts | 32 +- src/test/datascience/notebook/helper.ts | 24 +- .../intellisense/completion.vscode.test.ts | 8 +- .../completionProvider.vscode.test.ts | 6 +- .../intellisense/diagnostics.vscode.test.ts | 6 +- .../intellisense/gotodef.vscode.test.ts | 4 +- .../intellisense/hover.vscode.test.ts | 6 +- .../interpreterSwitch.vscode.test.ts | 12 +- .../semanticTokens.vscode.test.ts | 6 +- .../notebook/interruptRestart.vscode.test.ts | 12 +- .../notebook/ipywidget.vscode.test.ts | 8 +- .../notebook/kernelCrashes.vscode.test.ts | 18 +- .../notebook/kernelRefresh.vscode.test.ts | 6 +- .../notebook/kernelSelection.vscode.test.ts | 19 +- .../notebook/kernelSysPath.vscode.test.ts | 16 +- .../notebook/memory.vscode.test.ts | 6 +- .../notebook/nonPythonKernels.vscode.test.ts | 12 +- .../notebookControllerManager.unit.test.ts | 6 +- .../outputDisplayOrder.vscode.test.ts | 2 +- .../remoteNotebookEditor.vscode.test.ts | 12 +- .../notebook/saving.vscode.test.ts | 8 +- .../notebook/thirdPartyKernels.vscode.test.ts | 12 +- .../notebookServerProvider.vscode.test.ts | 18 +- .../plotViewer.functional.test.tsx | 4 +- .../plotViewer/plotViewer.vscode.test.ts | 6 +- .../datascience/preWarmVariables.unit.test.ts | 20 +- .../progress/decorators.unit.test.ts | 8 +- .../progress/progressReporter.unit.test.ts | 10 +- .../raw-kernel/rawKernel.functional.test.ts | 20 +- .../raw-kernel/rawKernelTestHelpers.ts | 2 +- src/test/datascience/reactHelpers.ts | 2 +- .../datascience/shiftEnterBanner.unit.test.ts | 13 +- .../testInteractiveWindowProvider.ts | 18 +- .../datascience/testNativeEditorProvider.ts | 16 +- .../datascience/testPersistentStateFactory.ts | 4 +- src/test/datascience/variableTestHelpers.ts | 10 +- .../variableView/variableView.vscode.test.ts | 16 +- .../variableViewTestInterfaces.ts | 4 +- .../variableexplorer.functional.test.tsx | 6 +- src/test/datascience/vscodeTestHelpers.ts | 2 +- src/test/datascience/widgets/commUtils.ts | 10 +- .../widgets/ipywidget.ui.functional.test.ts | 6 +- .../widgets/standard.vscode.test.ts | 8 +- .../common/protocolparser.vscode.test.ts | 4 +- .../debugger/jupyter/helpers.unit.test.ts | 2 +- src/test/extension-version.functional.test.ts | 2 +- .../extension.serviceRegistry.vscode.test.ts | 192 ++ src/test/fixtures.ts | 2 +- .../format/extension.format.vscode.test.ts | 10 +- src/test/functionalTests.ts | 2 +- src/test/initialize.ts | 10 +- src/test/interpreters/condaHelper.ts | 2 +- src/test/interpreters/condaService.ts | 8 +- src/test/interpreters/envActivation.ts | 6 +- src/test/interpreters/index.ts | 14 +- src/test/interpreters/interpreterService.ts | 8 +- src/test/interpreters/selector.ts | 6 +- .../channelManager.channels.unit.test.ts | 10 +- .../channelManager.messages.unit.test.ts | 14 +- .../installer/channelManager.unit.test.ts | 10 +- .../installer/condaInstaller.unit.test.ts | 14 +- .../installer/pipEnvInstaller.unit.test.ts | 8 +- .../installer/pipInstaller.unit.test.ts | 6 +- .../kernels/installer/pipenv.unit.test.ts | 4 +- .../kernels/installer/poetry.unit.test.ts | 6 +- .../installer/poetryInstaller.unit.test.ts | 18 +- .../installer/productInstaller.unit.test.ts | 8 +- .../installer/productPath.unit.test.ts | 8 +- src/test/kernels/installer/pyenv.unit.test.ts | 4 +- src/test/mocks/mementos.ts | 2 - src/test/mocks/proc.ts | 2 +- src/test/performance/load.perf.vscode.test.ts | 4 +- src/test/performanceTest.ts | 2 +- src/test/proc.ts | 2 +- src/test/serviceRegistry.ts | 165 -- src/test/smoke/datascience.smoke.test.ts | 6 +- src/test/standardTest.ts | 2 +- src/test/telemetry/importTracker.unit.test.ts | 12 +- src/test/telemetry/index.unit.test.ts | 8 +- src/test/testHashPerf.ts | 2 +- src/test/testLogger.ts | 8 +- src/test/testing/serviceRegistry.ts | 38 - src/test/utils/interpreters.ts | 2 +- src/test/vscode-mock.ts | 4 +- src/tools/telemetryGenerator.ts | 2 +- src/webviews/dataviewer/dataViewerChecker.ts | 8 +- src/webviews/serviceRegistry.ts | 9 + tsconfig.json | 4 +- 684 files changed, 5133 insertions(+), 5291 deletions(-) create mode 100644 news/3 Code Health/8981.md delete mode 100644 src/client/constants.ts delete mode 100644 src/client/datascience/serviceRegistry.ts delete mode 100644 src/client/extension.ts delete mode 100644 src/client/extensionActivation.ts delete mode 100644 src/client/extensionInit.ts delete mode 100644 src/client/telemetry/types.ts create mode 100644 src/extension.ts delete mode 100644 src/extension/serviceRegistry.ts create mode 100644 src/intellisense/serviceRegistry.ts create mode 100644 src/kernels/serviceRegistry.ts rename src/{client => platform}/.gitignore (100%) rename src/{client => platform}/.vscodeignore (100%) rename src/{client => platform}/activation/activationManager.ts (98%) rename src/{client => platform}/activation/migrateDataScienceSettingsService.ts (100%) rename src/{client => platform}/activation/serviceRegistry.ts (100%) rename src/{client => platform}/activation/types.ts (100%) rename src/{client => platform}/api.ts (100%) rename src/{client => platform}/api/apiAccessService.ts (99%) rename src/{client => platform}/api/extension.d.ts (100%) rename src/{client => platform}/api/kernelApi.ts (99%) rename src/{client => platform}/api/pythonApi.ts (92%) rename src/{client => platform}/api/serviceRegistry.ts (100%) rename src/{client => platform}/api/types.ts (99%) rename src/{extension => platform}/commands/commandLineSelector.ts (83%) rename src/{extension => platform}/commands/commandRegistry.ts (89%) rename src/{extension => platform}/commands/serverSelector.ts (85%) rename src/{client => platform}/common/amlContext.ts (92%) rename src/{client => platform}/common/application/activeResource.ts (100%) rename src/{client => platform}/common/application/applicationEnvironment.ts (100%) rename src/{client => platform}/common/application/applicationShell.ts (99%) rename src/{client => platform}/common/application/clipboard.ts (100%) rename src/{client => platform}/common/application/commandManager.ts (98%) rename src/{client => platform}/common/application/commands.ts (99%) rename src/{client => platform}/common/application/commands/reloadCommand.ts (100%) rename src/{client => platform}/common/application/debugService.ts (100%) rename src/{client => platform}/common/application/documentManager.ts (100%) rename src/{client => platform}/common/application/encryptedStorage.ts (87%) rename src/{client => platform}/common/application/extensions.ts (100%) rename src/{client => platform}/common/application/languageService.ts (100%) rename src/{client => platform}/common/application/notebook.ts (100%) rename src/{client => platform}/common/application/types.ts (100%) rename src/{client => platform}/common/application/webviewPanels/webviewPanel.ts (100%) rename src/{client => platform}/common/application/webviewPanels/webviewPanelProvider.ts (100%) rename src/{client => platform}/common/application/webviewViews/webviewView.ts (100%) rename src/{client => platform}/common/application/webviewViews/webviewViewProvider.ts (100%) rename src/{client => platform}/common/application/webviews/webview.ts (100%) rename src/{client => platform}/common/application/workspace.ts (100%) rename src/{client => platform}/common/asyncDisposableRegistry.ts (100%) rename src/{client => platform}/common/cancellation.ts (98%) rename src/{client => platform}/common/configSettings.ts (100%) rename src/{client => platform}/common/configuration/service.ts (100%) rename src/{client => platform}/common/constants.ts (100%) rename src/{client => platform}/common/contextKey.ts (100%) rename src/{client => platform}/common/crypto.ts (100%) rename src/{client => platform}/common/experiments/groups.ts (100%) rename src/{client => platform}/common/experiments/service.ts (98%) rename src/{client => platform}/common/experiments/telemetry.ts (93%) rename src/{client => platform}/common/extensions.ts (100%) rename src/{client => platform}/common/featureDeprecationManager.ts (100%) rename src/{client => platform}/common/helpers.ts (91%) rename src/{client => platform}/common/helpers.unit.test.ts (100%) rename src/{client => platform}/common/logger.ts (100%) rename src/{client => platform}/common/net/browser.ts (91%) rename src/{client => platform}/common/net/fileDownloader.ts (100%) rename src/{client => platform}/common/net/httpClient.ts (100%) rename src/{client => platform}/common/net/portAttributeProvider.ts (100%) rename src/{client => platform}/common/net/socket/SocketStream.ts (100%) rename src/{client => platform}/common/net/socket/socketCallbackHandler.ts (100%) rename src/{client => platform}/common/net/socket/socketServer.ts (97%) rename src/{client => platform}/common/persistentState.ts (100%) rename src/{client => platform}/common/platform/constants.ts (100%) rename src/{client => platform}/common/platform/errors.ts (100%) rename src/{client => platform}/common/platform/fileSystem.ts (100%) rename src/{client => platform}/common/platform/fileSystemUtils.ts (100%) rename src/{client => platform}/common/platform/fileUtils.ts (100%) rename src/{client => platform}/common/platform/fs-paths.ts (100%) rename src/{client => platform}/common/platform/fs-temp.ts (100%) rename src/{client => platform}/common/platform/pathUtils.ts (100%) rename src/{client => platform}/common/platform/platformService.ts (95%) rename src/{client => platform}/common/platform/serviceRegistry.ts (100%) rename src/{client => platform}/common/platform/types.ts (100%) rename src/{client => platform}/common/process/baseDaemon.ts (99%) rename src/{client => platform}/common/process/condaService.ts (100%) rename src/{client => platform}/common/process/constants.ts (100%) rename src/{client => platform}/common/process/currentProcess.ts (100%) rename src/{client => platform}/common/process/decoder.ts (100%) rename src/{client => platform}/common/process/environmentActivationService.ts (99%) rename src/{client => platform}/common/process/internal/python.ts (100%) rename src/{client => platform}/common/process/internal/scripts/index.ts (100%) rename src/{client => platform}/common/process/internal/scripts/testing_tools.ts (100%) rename src/{client => platform}/common/process/internal/scripts/vscode_datascience_helpers.ts (100%) rename src/{client => platform}/common/process/logger.ts (100%) rename src/{client => platform}/common/process/proc.ts (100%) rename src/{client => platform}/common/process/processFactory.ts (100%) rename src/{client => platform}/common/process/pythonDaemon.ts (100%) rename src/{client => platform}/common/process/pythonDaemonFactory.ts (100%) rename src/{client => platform}/common/process/pythonDaemonPool.ts (100%) rename src/{client => platform}/common/process/pythonEnvironment.ts (100%) rename src/{client => platform}/common/process/pythonExecutionFactory.ts (98%) rename src/{client => platform}/common/process/pythonProcess.ts (96%) rename src/{client => platform}/common/process/serviceRegistry.ts (100%) rename src/{client => platform}/common/process/types.ts (99%) rename src/{client => platform}/common/refBool.ts (100%) rename src/{client => platform}/common/serviceRegistry.ts (89%) rename src/{client => platform}/common/types.ts (100%) rename src/{client => platform}/common/utils/async.ts (99%) rename src/{client => platform}/common/utils/cacheUtils.ts (100%) rename src/{client => platform}/common/utils/decorators.ts (100%) rename src/{client => platform}/common/utils/icons.ts (100%) rename src/{client => platform}/common/utils/localize.ts (100%) rename src/{client => platform}/common/utils/logging.ts (100%) rename src/{client => platform}/common/utils/misc.ts (100%) rename src/{client => platform}/common/utils/multiStepInput.ts (100%) rename src/{client => platform}/common/utils/platform.ts (100%) rename src/{client => platform}/common/utils/regexp.ts (100%) rename src/{client => platform}/common/utils/serializers.ts (100%) rename src/{client => platform}/common/utils/stopWatch.ts (100%) rename src/{client => platform}/common/utils/sysTypes.ts (100%) rename src/{client => platform}/common/utils/text.ts (100%) rename src/{client => platform}/common/utils/version.ts (100%) rename src/{client => platform}/common/variables/environment.ts (98%) rename src/{client => platform}/common/variables/environmentVariablesProvider.ts (98%) rename src/{client => platform}/common/variables/serviceRegistry.ts (100%) rename src/{client => platform}/common/variables/sysTypes.ts (100%) rename src/{client => platform}/common/variables/systemVariables.ts (100%) rename src/{client => platform}/common/variables/types.ts (100%) create mode 100644 src/platform/constants.ts rename src/{client => platform}/datascience/activation.ts (98%) rename src/{client => platform}/datascience/cellFactory.ts (98%) rename src/{client => platform}/datascience/cellMatcher.ts (100%) rename src/{client => platform}/datascience/codeCssGenerator.ts (100%) rename src/{client => platform}/datascience/common.ts (98%) rename src/{client => platform}/datascience/constants.ts (100%) rename src/{client => platform}/datascience/data-viewing/dataViewer.ts (98%) rename src/{client => platform}/datascience/data-viewing/dataViewerDependencyService.ts (98%) rename src/{client => platform}/datascience/data-viewing/dataViewerFactory.ts (98%) rename src/{client => platform}/datascience/data-viewing/dataViewerMessageListener.ts (100%) rename src/{client => platform}/datascience/data-viewing/jupyterVariableDataProvider.ts (100%) rename src/{client => platform}/datascience/data-viewing/jupyterVariableDataProviderFactory.ts (100%) rename src/{client => platform}/datascience/data-viewing/types.ts (98%) rename src/{client => platform}/datascience/dataScienceSurveyBanner.ts (100%) rename src/{client => platform}/datascience/datascience.ts (99%) rename src/{client => platform}/datascience/debugLocationTracker.ts (99%) rename src/{client => platform}/datascience/debugLocationTrackerFactory.ts (100%) rename src/{client => platform}/datascience/displayOptions.ts (100%) rename src/{client => platform}/datascience/export/README.md (100%) rename src/{client => platform}/datascience/export/exportBase.ts (100%) rename src/{client => platform}/datascience/export/exportDialog.ts (100%) rename src/{client => platform}/datascience/export/exportFileOpener.ts (96%) rename src/{client => platform}/datascience/export/exportInterpreterFinder.ts (100%) rename src/{client => platform}/datascience/export/exportToHTML.ts (100%) rename src/{client => platform}/datascience/export/exportToPDF.ts (100%) rename src/{client => platform}/datascience/export/exportToPython.ts (100%) rename src/{client => platform}/datascience/export/exportToPythonPlain.ts (95%) rename src/{client => platform}/datascience/export/exportUtil.ts (100%) rename src/{client => platform}/datascience/export/fileConverter.ts (99%) rename src/{client => platform}/datascience/export/types.ts (100%) rename src/{client => platform}/datascience/extensionRecommendation.ts (99%) rename src/{client => platform}/datascience/messages.ts (100%) rename src/{client => platform}/datascience/multiplexingDebugService.ts (100%) rename src/{client => platform}/datascience/plotting/plotViewer.ts (98%) rename src/{client => platform}/datascience/plotting/plotViewerMessageListener.ts (100%) rename src/{client => platform}/datascience/plotting/plotViewerProvider.ts (97%) rename src/{client => platform}/datascience/plotting/types.ts (100%) rename src/{client => platform}/datascience/prereleaseChecker.ts (100%) rename src/{client => platform}/datascience/progress/decorator.ts (100%) rename src/{client => platform}/datascience/progress/kernelProgressReporter.ts (100%) rename src/{client => platform}/datascience/progress/messages.ts (100%) rename src/{client => platform}/datascience/progress/progressReporter.ts (100%) rename src/{client => platform}/datascience/progress/types.ts (100%) create mode 100644 src/platform/datascience/serviceRegistry.ts rename src/{client => platform}/datascience/shiftEnterBanner.ts (98%) rename src/{client => platform}/datascience/statusProvider.ts (100%) rename src/{client => platform}/datascience/telemetry/types.ts (100%) rename src/{client => platform}/datascience/themeFinder.ts (100%) rename src/{client => platform}/datascience/types.ts (99%) rename src/{client => platform}/datascience/utils.ts (100%) rename src/{client => platform}/datascience/variablesView/notebookWatcher.ts (100%) rename src/{client => platform}/datascience/variablesView/types.ts (98%) rename src/{client => platform}/datascience/variablesView/variableView.ts (90%) rename src/{client => platform}/datascience/variablesView/variableViewActivationService.ts (100%) rename src/{client => platform}/datascience/variablesView/variableViewMessageListener.ts (100%) rename src/{client => platform}/datascience/variablesView/variableViewProvider.ts (100%) rename src/{client => platform}/datascience/webviews/webviewHost.ts (95%) rename src/{client => platform}/datascience/webviews/webviewPanelHost.ts (85%) rename src/{client => platform}/datascience/webviews/webviewViewHost.ts (79%) rename src/{client => platform}/debugger/constants.ts (100%) rename src/{client => platform}/debugger/extension/helpers/protocolParser.ts (100%) rename src/{client => platform}/debugger/extension/types.ts (100%) rename src/{client => platform}/debugger/jupyter/debugControllers.ts (99%) rename src/{client => platform}/debugger/jupyter/debugger.ts (100%) rename src/{client => platform}/debugger/jupyter/debuggingManager.ts (99%) rename src/{client => platform}/debugger/jupyter/helper.ts (100%) rename src/{client => platform}/debugger/jupyter/kernelDebugAdapter.ts (99%) rename src/{client => platform}/debugger/types.ts (100%) rename src/{client/datascience => platform}/devTools/README.md (100%) rename src/{client/datascience => platform}/devTools/clearCache.ts (91%) rename src/{client/datascience => platform}/devTools/jupyterOutputChannel.ts (92%) create mode 100644 src/platform/devTools/serviceRegistry.ts rename src/{extension => platform}/errors/errorHandler.ts (96%) rename src/{extension => platform}/errors/errorUtils.ts (99%) rename src/{extension => platform}/errors/errors.ts (100%) rename src/{extension => platform}/errors/index.ts (97%) rename src/{extension => platform}/errors/interactiveCellResultError.ts (100%) rename src/{extension => platform}/errors/jupyterConnectError.ts (100%) rename src/{extension => platform}/errors/jupyterDataRateLimitError.ts (81%) rename src/{extension => platform}/errors/jupyterDebuggerNotInstalledError.ts (89%) rename src/{extension => platform}/errors/jupyterDebuggerRemoteNotSupportedError.ts (87%) rename src/{extension => platform}/errors/jupyterInstallError.ts (100%) rename src/{extension => platform}/errors/jupyterInvalidKernelError.ts (85%) rename src/{extension => platform}/errors/jupyterKernelDependencyError.ts (82%) rename src/{extension => platform}/errors/jupyterSelfCertsError.ts (100%) rename src/{extension => platform}/errors/jupyterWaitForIdleError.ts (81%) rename src/{extension => platform}/errors/kernelConnectionTimeoutError.ts (90%) rename src/{extension => platform}/errors/kernelDeadError.ts (90%) rename src/{extension => platform}/errors/kernelDiedError.ts (100%) rename src/{extension => platform}/errors/kernelInterruptTimeoutError.ts (86%) rename src/{extension => platform}/errors/kernelPortNotUsedTimeoutError.ts (90%) rename src/{extension => platform}/errors/kernelProcessExitedError.ts (89%) rename src/{extension => platform}/errors/moduleNotInstalledError.ts (100%) rename src/{extension => platform}/errors/sessionDisposedError.ts (80%) rename src/{extension => platform}/errors/types.ts (100%) rename src/{client => platform}/interpreter/activation/types.ts (100%) rename src/{client => platform}/interpreter/configuration/types.ts (100%) rename src/{client => platform}/interpreter/contracts.ts (100%) rename src/{client => platform}/interpreter/display/visibilityFilter.ts (100%) rename src/{client => platform}/ioc/container.ts (100%) rename src/{client => platform}/ioc/index.ts (100%) rename src/{client => platform}/ioc/serviceManager.ts (95%) rename src/{client => platform}/ioc/types.ts (96%) rename src/{client => platform}/language/languageConfiguration.ts (100%) rename src/{client => platform}/logging/_global.ts (100%) rename src/{client => platform}/logging/formatters.ts (100%) rename src/{client => platform}/logging/gitHubIssueCodeLensProvider.ts (100%) rename src/{client => platform}/logging/gitHubIssueCommandListener.ts (100%) rename src/{client => platform}/logging/index.ts (100%) rename src/{client => platform}/logging/levels.ts (93%) rename src/{client => platform}/logging/logger.ts (93%) rename src/{client => platform}/logging/serviceRegistry.ts (100%) rename src/{client => platform}/logging/trace.ts (99%) rename src/{client => platform}/logging/transports.ts (95%) rename src/{client => platform}/logging/util.ts (100%) rename src/{extension => platform}/messageTypes.ts (99%) rename src/{client => platform}/pythonEnvironments/exec.ts (100%) rename src/{client => platform}/pythonEnvironments/info/executable.ts (100%) rename src/{client => platform}/pythonEnvironments/info/index.ts (100%) rename src/{client => platform}/pythonEnvironments/info/interpreter.ts (100%) rename src/{client => platform}/pythonEnvironments/info/pythonVersion.ts (100%) create mode 100644 src/platform/serviceRegistry.ts rename src/{client => platform}/startupTelemetry.ts (93%) rename src/{client => platform}/terminals/codeExecution/helper.ts (100%) rename src/{client => platform}/terminals/serviceRegistry.ts (100%) rename src/{client => platform}/terminals/types.ts (100%) rename src/{client => platform}/testing/common/constants.ts (100%) rename src/{client => }/telemetry/constants.ts (100%) rename src/{client => }/telemetry/envFileTelemetry.ts (89%) rename src/{client => }/telemetry/extensionInstallTelemetry.ts (92%) rename src/{client => }/telemetry/helpers.ts (93%) rename src/{client => }/telemetry/importTracker.ts (94%) rename src/{client => }/telemetry/index.ts (98%) rename src/{client/datascience => }/telemetry/interpreterCountTracker.ts (84%) rename src/{client/datascience => }/telemetry/interpreterPackageTracker.ts (87%) rename src/{client/datascience => }/telemetry/interpreterPackages.ts (92%) rename src/{client/datascience => }/telemetry/kernelTelemetry.ts (86%) rename src/{client => }/telemetry/languageInitializer.ts (78%) rename src/{client/datascience => }/telemetry/serviceRegistry.ts (84%) rename src/{client/datascience => }/telemetry/telemetry.ts (94%) create mode 100644 src/telemetry/types.ts rename src/{client/datascience => }/telemetry/workspaceInterpreterTracker.ts (84%) delete mode 100644 src/test/datascience/mockDebugService.ts delete mode 100644 src/test/datascience/mountedWebView.ts delete mode 100644 src/test/datascience/mountedWebViewFactory.ts create mode 100644 src/test/extension.serviceRegistry.vscode.test.ts delete mode 100644 src/test/serviceRegistry.ts delete mode 100644 src/test/testing/serviceRegistry.ts create mode 100644 src/webviews/serviceRegistry.ts diff --git a/.eslintrc.js b/.eslintrc.js index fdac6248da6..798afb7a675 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -30,11 +30,9 @@ module.exports = { 'build/webpack/loaders/remarkLoader.js', 'build/webpack/loaders/jsonloader.js', 'build/webpack/loaders/externalizeDependencies.js', - 'build/tslint-rules/messagesMustBeLocalizedRule.js', 'build/tslint-rules/baseRuleWalker.js', 'src/test/mocks/process.ts', 'src/test/mocks/moduleInstaller.ts', - 'src/test/mocks/proc.ts', 'src/test/mocks/autoSelector.ts', 'src/test/mocks/vsc/uuid.ts', 'src/test/mocks/vsc/strings.ts', @@ -49,10 +47,8 @@ module.exports = { 'src/test/smoke/common.ts', 'src/test/smoke/runInTerminal.smoke.test.ts', 'src/test/smoke/languageServer.smoke.test.ts', - 'src/test/testLogger.ts', 'src/test/textUtils.ts', 'src/test/unittests.ts', - 'src/test/utils/interpreters.ts', 'src/test/utils/fs.ts', 'src/test/api.functional.test.ts', 'src/test/common/exitCIAfterTestReporter.ts', @@ -63,10 +59,8 @@ module.exports = { 'src/test/common/configSettings.test.ts', 'src/test/common/experiments/manager.unit.test.ts', 'src/test/common/platform/platformService.test.ts', - 'src/test/common/platform/fs-temp.functional.test.ts', 'src/test/common/platform/serviceRegistry.unit.test.ts', 'src/test/common/platform/filesystem.functional.test.ts', - 'src/test/common/platform/fs-paths.functional.test.ts', 'src/test/common/platform/filesystem.test.ts', 'src/test/common/utils/version.unit.test.ts', 'src/test/common/utils/workerPool.functional.test.ts', @@ -128,26 +122,21 @@ module.exports = { 'src/test/application/misc/joinMailingListPrompt.unit.test.ts', 'src/test/performance/load.perf.test.ts', 'src/test/datascience/mockLanguageServerCache.ts', - 'src/test/datascience/mountedWebViewFactory.ts', 'src/test/datascience/data-viewing/dataViewerPDependencyService.unit.test.ts', - 'src/test/datascience/mockPythonService.ts', 'src/test/datascience/mockInputBox.ts', 'src/test/datascience/crossProcessLock.unit.test.ts', 'src/test/datascience/mockWorkspaceConfiguration.ts', - 'src/test/datascience/mockTextEditor.ts', 'src/test/datascience/mockLanguageServerAnalysisOptions.ts', 'src/test/datascience/mockLanguageServerProxy.ts', 'src/test/datascience/mockPythonSettings.ts', 'src/test/datascience/datascienceSurveyBanner.unit.test.ts', 'src/test/datascience/color.test.ts', - 'src/test/datascience/mockFileSystem.ts', 'src/test/datascience/interactive-common/', 'src/test/datascience/interactive-common/trustCommandHandler.unit.test.ts', 'src/test/datascience/extensionapi/exampleextension/ms-toolsai-test/webpack.config.js', 'src/test/datascience/extensionapi/exampleextension/ms-toolsai-test/.eslintrc.js', 'src/test/datascience/extensionapi/exampleextension/ms-toolsai-test/src/typings/python.d.ts', 'src/test/datascience/extensionapi/exampleextension/ms-toolsai-test/src/serverPicker.ts', - 'src/test/datascience/mockLanguageServer.ts', 'src/test/datascience/mockWorkspaceFolder.ts', 'src/test/datascience/jupyterHelpers.ts', 'src/test/datascience/kernelFinder.unit.test.ts', @@ -167,9 +156,7 @@ module.exports = { 'src/test/datascience/export/exportManager.test.ts', 'src/test/datascience/intellisense.unit.test.ts', 'src/test/datascience/interactivePanel.functional.test.tsx', - 'src/test/datascience/testPersistentStateFactory.ts', 'src/test/datascience/jupyter/serverCache.unit.test.ts', - 'src/test/datascience/mockProcessService.ts', 'src/test/refactor/extension.refactor.extract.method.test.ts', 'src/test/refactor/extension.refactor.extract.var.test.ts', 'src/test/refactor/rename.test.ts', @@ -185,7 +172,6 @@ module.exports = { 'src/datascience-ui/plot/index.tsx', 'src/datascience-ui/plot/testSvg.ts', 'src/datascience-ui/plot/toolbar.tsx', - 'src/datascience-ui/plot/mainPanel.tsx', 'src/datascience-ui/ipywidgets/manager.ts', 'src/datascience-ui/ipywidgets/container.tsx', 'src/datascience-ui/ipywidgets/types.ts', @@ -197,7 +183,6 @@ module.exports = { 'src/datascience-ui/react-common/svgViewer.tsx', 'src/datascience-ui/react-common/relativeImage.tsx', 'src/datascience-ui/react-common/progress.tsx', - 'src/datascience-ui/react-common/styleInjector.tsx', 'src/datascience-ui/react-common/textMeasure.ts', 'src/datascience-ui/react-common/flyout.tsx', 'src/datascience-ui/react-common/svgList.tsx', @@ -210,435 +195,7 @@ module.exports = { 'src/datascience-ui/startPage/index.tsx', 'src/datascience-ui/startPage/startPage.tsx', 'src/datascience-ui/data-explorer/emptyRowsView.tsx', - 'src/datascience-ui/data-explorer/progressBar.tsx', - 'src/client/interpreter/interpreterService.ts', - 'src/client/interpreter/configuration/interpreterComparer.ts', - 'src/client/interpreter/configuration/interpreterSelector/commands/base.ts', - 'src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts', - 'src/client/interpreter/configuration/interpreterSelector/commands/resetInterpreter.ts', - 'src/client/interpreter/configuration/interpreterSelector/commands/setShebangInterpreter.ts', - 'src/client/interpreter/configuration/interpreterSelector/interpreterSelector.ts', - 'src/client/interpreter/configuration/pythonPathUpdaterService.ts', - 'src/client/interpreter/configuration/pythonPathUpdaterServiceFactory.ts', - 'src/client/interpreter/configuration/types.ts', - 'src/client/interpreter/configuration/services/globalUpdaterService.ts', - 'src/client/interpreter/configuration/services/workspaceUpdaterService.ts', - 'src/client/interpreter/configuration/services/workspaceFolderUpdaterService.ts', - 'src/client/interpreter/serviceRegistry.ts', - 'src/client/interpreter/helpers.ts', - 'src/client/interpreter/virtualEnvs/condaInheritEnvPrompt.ts', - 'src/client/interpreter/virtualEnvs/types.ts', - 'src/client/interpreter/virtualEnvs/virtualEnvPrompt.ts', - 'src/client/interpreter/virtualEnvs/index.ts', - 'src/client/interpreter/autoSelection/interpreterSecurity/interpreterSecurityStorage.ts', - 'src/client/interpreter/autoSelection/interpreterSecurity/interpreterEvaluation.ts', - 'src/client/interpreter/autoSelection/interpreterSecurity/interpreterSecurityService.ts', - 'src/client/interpreter/autoSelection/types.ts', - 'src/client/interpreter/autoSelection/constants.ts', - 'src/client/interpreter/autoSelection/proxy.ts', - 'src/client/interpreter/autoSelection/rules/baseRule.ts', - 'src/client/interpreter/autoSelection/rules/winRegistry.ts', - 'src/client/interpreter/autoSelection/rules/settings.ts', - 'src/client/interpreter/autoSelection/rules/currentPath.ts', - 'src/client/interpreter/autoSelection/rules/cached.ts', - 'src/client/interpreter/autoSelection/rules/workspaceEnv.ts', - 'src/client/interpreter/autoSelection/rules/system.ts', - 'src/client/interpreter/autoSelection/index.ts', - 'src/client/interpreter/interpreterVersion.ts', - 'src/client/interpreter/activation/wrapperEnvironmentActivationService.ts', - 'src/client/interpreter/activation/terminalEnvironmentActivationService.ts', - 'src/client/interpreter/activation/service.ts', - 'src/client/interpreter/display/shebangCodeLensProvider.ts', - 'src/client/interpreter/display/index.ts', - 'src/client/interpreter/display/progressDisplay.ts', - 'src/client/interpreter/display/interpreterSelectionTip.ts', - 'src/client/constants.ts', - 'src/client/sourceMapSupport.ts', - 'src/client/startupTelemetry.ts', - 'src/client/typeFormatters/blockFormatProvider.ts', - 'src/client/typeFormatters/contracts.ts', - 'src/client/typeFormatters/codeBlockFormatProvider.ts', - 'src/client/typeFormatters/onEnterFormatter.ts', - 'src/client/typeFormatters/dispatcher.ts', - 'src/client/terminals/serviceRegistry.ts', - 'src/client/terminals/activation.ts', - 'src/client/terminals/types.ts', - 'src/client/terminals/codeExecution/djangoShellCodeExecution.ts', - 'src/client/terminals/codeExecution/repl.ts', - 'src/client/terminals/codeExecution/terminalCodeExecution.ts', - 'src/client/terminals/codeExecution/codeExecutionManager.ts', - 'src/client/terminals/codeExecution/djangoContext.ts', - 'src/client/providers/objectDefinitionProvider.ts', - 'src/client/providers/serviceRegistry.ts', - 'src/client/providers/symbolProvider.ts', - 'src/client/providers/completionSource.ts', - 'src/client/providers/renameProvider.ts', - 'src/client/providers/hoverProvider.ts', - 'src/client/providers/itemInfoSource.ts', - 'src/client/providers/formatProvider.ts', - 'src/client/providers/importSortProvider.ts', - 'src/client/providers/replProvider.ts', - 'src/client/providers/codeActionProvider/main.ts', - 'src/client/providers/codeActionProvider/launchJsonCodeActionProvider.ts', - 'src/client/providers/codeActionProvider/pythonCodeActionProvider.ts', - 'src/client/providers/types.ts', - 'src/client/providers/docStringFoldingProvider.ts', - 'src/client/providers/linterProvider.ts', - 'src/client/providers/providerUtilities.ts', - 'src/client/providers/simpleRefactorProvider.ts', - 'src/client/providers/completionProvider.ts', - 'src/client/providers/jediProxy.ts', - 'src/client/providers/definitionProvider.ts', - 'src/client/providers/referenceProvider.ts', - 'src/client/providers/terminalProvider.ts', - 'src/client/providers/signatureProvider.ts', - 'src/client/activation/languageServer/manager.ts', - 'src/client/activation/languageServer/languageServerExtension.ts', - 'src/client/activation/languageServer/languageServerProxy.ts', - 'src/client/activation/languageServer/languageClientFactory.ts', - 'src/client/activation/languageServer/platformData.ts', - 'src/client/activation/languageServer/languageServerCompatibilityService.ts', - 'src/client/activation/languageServer/languageServerPackageRepository.ts', - 'src/client/activation/languageServer/languageServerFolderService.ts', - 'src/client/activation/languageServer/outputChannel.ts', - 'src/client/activation/languageServer/languageServerPackageService.ts', - 'src/client/activation/languageServer/analysisOptions.ts', - 'src/client/activation/languageServer/activator.ts', - 'src/client/activation/commands.ts', - 'src/client/activation/progress.ts', - 'src/client/activation/extensionSurvey.ts', - 'src/client/activation/common/languageServerChangeHandler.ts', - 'src/client/activation/common/activatorBase.ts', - 'src/client/activation/common/languageServerFolderService.ts', - 'src/client/activation/common/languageServerPackageService.ts', - 'src/client/activation/common/downloader.ts', - 'src/client/activation/common/packageRepository.ts', - 'src/client/activation/common/analysisOptions.ts', - 'src/client/activation/common/downloadChannelRules.ts', - 'src/client/activation/aaTesting.ts', - 'src/client/activation/refCountedLanguageServer.ts', - 'src/client/activation/jedi.ts', - 'src/client/activation/languageClientMiddleware.ts', - 'src/client/activation/activationService.ts', - 'src/client/activation/node/manager.ts', - 'src/client/activation/node/cancellationUtils.ts', - 'src/client/activation/node/languageServerProxy.ts', - 'src/client/activation/node/languageClientFactory.ts', - 'src/client/activation/node/languageServerPackageRepository.ts', - 'src/client/activation/node/languageServerFolderService.ts', - 'src/client/activation/node/languageServerPackageService.ts', - 'src/client/activation/node/analysisOptions.ts', - 'src/client/activation/node/activator.ts', - 'src/client/activation/none/activator.ts', - 'src/client/formatters/blackFormatter.ts', - 'src/client/formatters/serviceRegistry.ts', - 'src/client/formatters/helper.ts', - 'src/client/formatters/dummyFormatter.ts', - 'src/client/formatters/autoPep8Formatter.ts', - 'src/client/formatters/lineFormatter.ts', - 'src/client/formatters/types.ts', - 'src/client/formatters/yapfFormatter.ts', - 'src/client/formatters/baseFormatter.ts', - 'src/client/language/languageConfiguration.ts', - 'src/client/language/characters.ts', - 'src/client/language/textRangeCollection.ts', - 'src/client/language/tokenizer.ts', - 'src/client/language/characterStream.ts', - 'src/client/language/textIterator.ts', - 'src/client/language/types.ts', - 'src/client/language/iterableTextRange.ts', - 'src/client/language/braceCounter.ts', - 'src/client/language/unicode.ts', - 'src/client/language/textBuilder.ts', - 'src/client/testing/serviceRegistry.ts', - 'src/client/testing/unittest/main.ts', - 'src/client/testing/unittest/helper.ts', - 'src/client/testing/unittest/testConfigurationManager.ts', - 'src/client/testing/unittest/socketServer.ts', - 'src/client/testing/unittest/runner.ts', - 'src/client/testing/unittest/services/parserService.ts', - 'src/client/testing/unittest/services/argsService.ts', - 'src/client/testing/unittest/services/discoveryService.ts', - 'src/client/testing/codeLenses/main.ts', - 'src/client/testing/codeLenses/testFiles.ts', - 'src/client/testing/nosetest/main.ts', - 'src/client/testing/nosetest/testConfigurationManager.ts', - 'src/client/testing/nosetest/runner.ts', - 'src/client/testing/nosetest/services/parserService.ts', - 'src/client/testing/nosetest/services/argsService.ts', - 'src/client/testing/nosetest/services/discoveryService.ts', - 'src/client/testing/main.ts', - 'src/client/testing/pytest/main.ts', - 'src/client/testing/pytest/testConfigurationManager.ts', - 'src/client/testing/pytest/runner.ts', - 'src/client/testing/pytest/services/argsService.ts', - 'src/client/testing/pytest/services/discoveryService.ts', - 'src/client/testing/pytest/services/testMessageService.ts', - 'src/client/testing/configurationFactory.ts', - 'src/client/testing/navigation/serviceRegistry.ts', - 'src/client/testing/navigation/symbolProvider.ts', - 'src/client/testing/navigation/helper.ts', - 'src/client/testing/navigation/commandHandler.ts', - 'src/client/testing/navigation/suiteNavigator.ts', - 'src/client/testing/navigation/types.ts', - 'src/client/testing/navigation/functionNavigator.ts', - 'src/client/testing/navigation/fileNavigator.ts', - 'src/client/testing/explorer/testTreeViewItem.ts', - 'src/client/testing/explorer/testTreeViewProvider.ts', - 'src/client/testing/explorer/commandHandlers.ts', - 'src/client/testing/explorer/failedTestHandler.ts', - 'src/client/testing/explorer/treeView.ts', - 'src/client/testing/types.ts', - 'src/client/testing/common/argumentsHelper.ts', - 'src/client/testing/common/enablementTracker.ts', - 'src/client/testing/common/debugLauncher.ts', - 'src/client/testing/common/managers/testConfigurationManager.ts', - 'src/client/testing/common/managers/baseTestManager.ts', - 'src/client/testing/common/types.ts', - 'src/client/testing/common/constants.ts', - 'src/client/testing/common/testUtils.ts', - 'src/client/testing/common/xUnitParser.ts', - 'src/client/testing/common/updateTestSettings.ts', - 'src/client/testing/common/testVisitors/visitor.ts', - 'src/client/testing/common/testVisitors/flatteningVisitor.ts', - 'src/client/testing/common/testVisitors/resultResetVisitor.ts', - 'src/client/testing/common/runner.ts', - 'src/client/testing/common/services/discoveredTestParser.ts', - 'src/client/testing/common/services/contextService.ts', - 'src/client/testing/common/services/testResultsService.ts', - 'src/client/testing/common/services/storageService.ts', - 'src/client/testing/common/services/types.ts', - 'src/client/testing/common/services/unitTestDiagnosticService.ts', - 'src/client/testing/common/services/testsStatusService.ts', - 'src/client/testing/common/services/discovery.ts', - 'src/client/testing/common/services/configSettingService.ts', - 'src/client/testing/common/services/testManagerService.ts', - 'src/client/testing/common/services/workspaceTestManagerService.ts', - 'src/client/testing/display/main.ts', - 'src/client/testing/display/picker.ts', - 'src/client/testing/configuration.ts', - 'src/client/common/configuration/service.ts', - 'src/client/common/net/browser.ts', - 'src/client/common/net/fileDownloader.ts', - 'src/client/common/net/httpClient.ts', - 'src/client/common/net/socket/socketCallbackHandler.ts', - 'src/client/common/net/socket/socketServer.ts', - 'src/client/common/net/socket/SocketStream.ts', - 'src/client/common/asyncDisposableRegistry.ts', - 'src/client/common/contextKey.ts', - 'src/client/common/markdown/restTextConverter.ts', - 'src/client/common/featureDeprecationManager.ts', - 'src/client/common/experiments/manager.ts', - 'src/client/common/experiments/telemetry.ts', - 'src/client/common/refBool.ts', - 'src/client/common/open.ts', - 'src/client/common/platform/errors.ts', - 'src/client/common/platform/fs-temp.ts', - 'src/client/common/platform/constants.ts', - 'src/client/common/platform/registry.ts', - 'src/client/common/persistentState.ts', - 'src/client/common/terminal/activator/base.ts', - 'src/client/common/terminal/activator/powershellFailedHandler.ts', - 'src/client/common/terminal/activator/index.ts', - 'src/client/common/terminal/helper.ts', - 'src/client/common/terminal/syncTerminalService.ts', - 'src/client/common/terminal/factory.ts', - 'src/client/common/terminal/types.ts', - 'src/client/common/terminal/commandPrompt.ts', - 'src/client/common/terminal/service.ts', - 'src/client/common/terminal/shellDetector.ts', - 'src/client/common/terminal/shellDetectors/userEnvironmentShellDetector.ts', - 'src/client/common/terminal/shellDetectors/vscEnvironmentShellDetector.ts', - 'src/client/common/terminal/shellDetectors/terminalNameShellDetector.ts', - 'src/client/common/terminal/shellDetectors/settingsShellDetector.ts', - 'src/client/common/terminal/shellDetectors/baseShellDetector.ts', - 'src/client/common/terminal/environmentActivationProviders/pipEnvActivationProvider.ts', - 'src/client/common/terminal/environmentActivationProviders/baseActivationProvider.ts', - 'src/client/common/terminal/environmentActivationProviders/condaActivationProvider.ts', - 'src/client/common/terminal/environmentActivationProviders/commandPrompt.ts', - 'src/client/common/terminal/environmentActivationProviders/bash.ts', - 'src/client/common/terminal/environmentActivationProviders/pyenvActivationProvider.ts', - 'src/client/common/utils/enum.ts', - 'src/client/common/utils/text.ts', - 'src/client/common/utils/platform.ts', - 'src/client/common/utils/stopWatch.ts', - 'src/client/common/utils/random.ts', - 'src/client/common/utils/icons.ts', - 'src/client/common/utils/sysTypes.ts', - 'src/client/common/utils/version.ts', - 'src/client/common/utils/logging.ts', - 'src/client/common/utils/cacheUtils.ts', - 'src/client/common/utils/workerPool.ts', - 'src/client/common/crypto.ts', - 'src/client/common/dotnet/compatibilityService.ts', - 'src/client/common/dotnet/serviceRegistry.ts', - 'src/client/common/dotnet/types.ts', - 'src/client/common/dotnet/services/unknownOsCompatibilityService.ts', - 'src/client/common/dotnet/services/macCompatibilityService.ts', - 'src/client/common/dotnet/services/linuxCompatibilityService.ts', - 'src/client/common/dotnet/services/windowsCompatibilityService.ts', - 'src/client/common/variables/serviceRegistry.ts', - 'src/client/common/variables/sysTypes.ts', - 'src/client/common/variables/systemVariables.ts', - 'src/client/common/nuget/azureBlobStoreNugetRepository.ts', - 'src/client/common/nuget/nugetRepository.ts', - 'src/client/common/nuget/types.ts', - 'src/client/common/nuget/nugetService.ts', - 'src/client/common/interpreterPathService.ts', - 'src/client/common/startPage/startPage.ts', - 'src/client/common/startPage/types.ts', - 'src/client/common/startPage/startPageMessageListener.ts', - 'src/client/common/application/languageService.ts', - 'src/client/common/application/', - 'src/client/common/application/clipboard.ts', - 'src/client/common/application/debugSessionTelemetry.ts', - 'src/client/common/application/activeResource.ts', - 'src/client/common/application/webPanels/webPanelProvider.ts', - 'src/client/common/application/webPanels/webPanel.ts', - 'src/client/common/application/commands/reloadCommand.ts', - 'src/client/common/application/terminalManager.ts', - 'src/client/common/installer/condaInstaller.ts', - 'src/client/common/installer/channelManager.ts', - 'src/client/common/installer/moduleInstaller.ts', - 'src/client/common/installer/poetryInstaller.ts', - 'src/client/common/installer/pipEnvInstaller.ts', - 'src/client/common/installer/productService.ts', - 'src/client/common/installer/pipInstaller.ts', - 'src/client/common/process/pythonToolService.ts', - 'src/client/common/process/internal/scripts/testing_tools.ts', - 'src/client/common/process/logger.ts', - 'src/client/common/process/constants.ts', - 'src/client/common/process/decoder.ts', - 'src/client/debugger/extension/configuration/providers/moduleLaunch.ts', - 'src/client/debugger/extension/configuration/providers/flaskLaunch.ts', - 'src/client/debugger/extension/configuration/providers/fileLaunch.ts', - 'src/client/debugger/extension/configuration/providers/remoteAttach.ts', - 'src/client/debugger/extension/configuration/providers/djangoLaunch.ts', - 'src/client/debugger/extension/configuration/providers/providerFactory.ts', - 'src/client/debugger/extension/configuration/providers/pyramidLaunch.ts', - 'src/client/debugger/extension/configuration/providers/pidAttach.ts', - 'src/client/debugger/extension/configuration/resolvers/base.ts', - 'src/client/debugger/extension/configuration/resolvers/helper.ts', - 'src/client/debugger/extension/configuration/resolvers/launch.ts', - 'src/client/debugger/extension/configuration/resolvers/attach.ts', - 'src/client/debugger/extension/configuration/types.ts', - 'src/client/debugger/extension/configuration/debugConfigurationService.ts', - 'src/client/debugger/extension/configuration/launch.json/updaterService.ts', - 'src/client/debugger/extension/configuration/launch.json/interpreterPathCommand.ts', - 'src/client/debugger/extension/configuration/launch.json/completionProvider.ts', - 'src/client/debugger/extension/banner.ts', - 'src/client/debugger/extension/serviceRegistry.ts', - 'src/client/debugger/extension/adapter/remoteLaunchers.ts', - 'src/client/debugger/extension/adapter/outdatedDebuggerPrompt.ts', - 'src/client/debugger/extension/adapter/factory.ts', - 'src/client/debugger/extension/adapter/types.ts', - 'src/client/debugger/extension/adapter/activator.ts', - 'src/client/debugger/extension/adapter/logging.ts', - 'src/client/debugger/extension/types.ts', - 'src/client/debugger/extension/hooks/eventHandlerDispatcher.ts', - 'src/client/debugger/extension/hooks/types.ts', - 'src/client/debugger/extension/hooks/constants.ts', - 'src/client/debugger/extension/hooks/childProcessAttachHandler.ts', - 'src/client/debugger/extension/hooks/childProcessAttachService.ts', - 'src/client/debugger/extension/attachQuickPick/wmicProcessParser.ts', - 'src/client/debugger/extension/attachQuickPick/factory.ts', - 'src/client/debugger/extension/attachQuickPick/types.ts', - 'src/client/debugger/extension/attachQuickPick/psProcessParser.ts', - 'src/client/debugger/extension/attachQuickPick/provider.ts', - 'src/client/debugger/extension/attachQuickPick/picker.ts', - 'src/client/debugger/extension/helpers/protocolParser.ts', - 'src/client/languageServices/jediProxyFactory.ts', - 'src/client/languageServices/proposeLanguageServerBanner.ts', - 'src/client/telemetry/types.ts', - 'src/client/telemetry/envFileTelemetry.ts', - 'src/client/telemetry/extensionInstallTelemetry.ts', - 'src/client/linters/pydocstyle.ts', - 'src/client/linters/serviceRegistry.ts', - 'src/client/linters/linterAvailability.ts', - 'src/client/linters/lintingEngine.ts', - 'src/client/linters/prospector.ts', - 'src/client/linters/pycodestyle.ts', - 'src/client/linters/linterInfo.ts', - 'src/client/linters/bandit.ts', - 'src/client/linters/linterCommands.ts', - 'src/client/linters/flake8.ts', - 'src/client/linters/errorHandlers/baseErrorHandler.ts', - 'src/client/linters/errorHandlers/notInstalled.ts', - 'src/client/linters/errorHandlers/standard.ts', - 'src/client/linters/types.ts', - 'src/client/linters/mypy.ts', - 'src/client/linters/baseLinter.ts', - 'src/client/linters/constants.ts', - 'src/client/linters/linterManager.ts', - 'src/client/linters/pylama.ts', - 'src/client/linters/pylint.ts', - 'src/client/application/serviceRegistry.ts', - 'src/client/application/types.ts', - 'src/client/application/diagnostics/surceMapSupportService.ts', - 'src/client/application/diagnostics/base.ts', - 'src/client/application/diagnostics/applicationDiagnostics.ts', - 'src/client/application/diagnostics/serviceRegistry.ts', - 'src/client/application/diagnostics/filter.ts', - 'src/client/application/diagnostics/checks/upgradeCodeRunner.ts', - 'src/client/application/diagnostics/checks/powerShellActivation.ts', - 'src/client/application/diagnostics/checks/envPathVariable.ts', - 'src/client/application/diagnostics/checks/invalidLaunchJsonDebugger.ts', - 'src/client/application/diagnostics/checks/pythonPathDeprecated.ts', - 'src/client/application/diagnostics/checks/lsNotSupported.ts', - 'src/client/application/diagnostics/checks/macPythonInterpreter.ts', - 'src/client/application/diagnostics/checks/invalidPythonPathInDebugger.ts', - 'src/client/application/diagnostics/checks/pythonInterpreter.ts', - 'src/client/application/diagnostics/promptHandler.ts', - 'src/client/application/diagnostics/types.ts', - 'src/client/application/diagnostics/constants.ts', - 'src/client/application/diagnostics/commands/base.ts', - 'src/client/application/diagnostics/commands/ignore.ts', - 'src/client/application/diagnostics/commands/factory.ts', - 'src/client/application/diagnostics/commands/execVSCCommand.ts', - 'src/client/application/diagnostics/commands/types.ts', - 'src/client/application/diagnostics/commands/launchBrowser.ts', - 'src/client/application/misc/joinMailingListPrompt.ts', - 'src/client/datascience/data-viewing/dataViewerMessageListener.ts', - 'src/client/datascience/progress/progressReporter.ts', - 'src/client/datascience/progress/decorator.ts', - 'src/client/datascience/ipywidgets/rceProvider.ts', - 'src/client/datascience/ipywidgets/constants.ts', - 'src/client/datascience/ipywidgets/ipywidgetHandler.ts', - 'src/client/datascience/crossProcessLock.ts', - 'src/client/datascience/debugLocationTrackerFactory.ts', - 'src/client/datascience/kernelSocketWrapper.ts', - 'src/client/datascience/jupyterUriProviderWrapper.ts', - 'src/client/datascience/plotting/plotViewerMessageListener.ts', - 'src/client/datascience/plotting/types.ts', - 'src/client/datascience/plotting/plotViewerProvider.ts', - 'src/client/datascience/notebook/renderer.ts', - 'src/client/datascience/notebook/survey.ts', - 'src/client/datascience/export/exportToHTML.ts', - 'src/client/datascience/export/exportToPython.ts', - 'src/client/datascience/export/exportToPDF.ts', - 'src/client/datascience/export/exportManagerFilePicker.ts', - 'src/client/datascience/export/exportFileOpener.ts', - 'src/client/datascience/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts', - 'src/client/datascience/jupyter/interpreter/jupyterInterpreterOldCacheStateStore.ts', - 'src/client/datascience/jupyter/interpreter/jupyterInterpreterSelector.ts', - 'src/client/datascience/jupyter/commandLineSelector.ts', - 'src/client/datascience/jupyter/variableScriptLoader.ts', - 'src/client/datascience/jupyter/jupyterImporter.ts', - 'src/client/datascience/jupyter/oldJupyterVariables.ts', - 'src/client/datascience/dataScienceFileSystem.ts', - 'src/client/logging/levels.ts', - 'src/client/logging/transports.ts', - 'src/client/logging/util.ts', - 'src/client/ioc/serviceManager.ts', - 'src/client/ioc/container.ts', - 'src/client/ioc/types.ts', - 'src/client/ioc/index.ts', - 'src/client/refactor/proxy.ts', - 'src/client/workspaceSymbols/main.ts', - 'src/client/workspaceSymbols/contracts.ts', - 'src/client/workspaceSymbols/generator.ts', - 'src/client/workspaceSymbols/parser.ts', - 'src/client/workspaceSymbols/provider.ts' + 'src/datascience-ui/data-explorer/progressBar.tsx' ], parser: '@typescript-eslint/parser', parserOptions: { @@ -748,10 +305,46 @@ module.exports = { basePath: './src', zones: [ { - target: './client/**/*.ts', + target: './intellisense/**/*.ts', from: './test', message: - 'Importing test modules from ./src/test into extension code in .src/client, is not allowed.' + 'Importing test modules from ./src/test into extension code in .src/intellisense, is not allowed.' + }, + { + target: './interactive-window/**/*.ts', + from: './test', + message: + 'Importing test modules from ./src/test into extension code in .src/interactive-window, is not allowed.' + }, + { + target: './kernels/**/*.ts', + from: './test', + message: + 'Importing test modules from ./src/test into extension code in .src/kernels, is not allowed.' + }, + { + target: './notebooks/**/*.ts', + from: './test', + message: + 'Importing test modules from ./src/test into extension code in .src/notebooks, is not allowed.' + }, + { + target: './platform/**/*.ts', + from: './test', + message: + 'Importing test modules from ./src/test into extension code in .src/platform, is not allowed.' + }, + { + target: './telemetry/**/*.ts', + from: './test', + message: + 'Importing test modules from ./src/test into extension code in .src/telemetry, is not allowed.' + }, + { + target: './webviews/**/*.ts', + from: './test', + message: + 'Importing test modules from ./src/test into extension code in .src/webviews, is not allowed.' } ] } diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a8410d8e92d..77ff8a30f2b 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -240,7 +240,7 @@ jobs: - name: 'Check for telemetry edit' uses: brettcannon/check-for-changed-files@v1.1.0 with: - prereq-pattern: './src/client/telemetry/index.ts' + prereq-pattern: './src/telemetry/index.ts' file-pattern: 'telemetry.md' skip-label: 'skip telemetry' failure-message: 'TELEMETRY.md should be updated when adding or removing telemetry. Please run "npm run generateTelemetry"' diff --git a/.prettierignore b/.prettierignore index 953832c3207..e54b479d233 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,3 @@ # Ignore the pythonEnvironments/ folder because we use ESLint there instead -src/client/pythonEnvironments/* +src/platform/pythonEnvironments/* src/test/pythonEnvironments/* diff --git a/.sonarcloud.properties b/.sonarcloud.properties index e20640d4b55..bfeae9f04a2 100644 --- a/.sonarcloud.properties +++ b/.sonarcloud.properties @@ -1,5 +1,5 @@ -sonar.sources=src/client,src/datascience-ui +sonar.sources=src/platform,src/datascience-ui sonar.exclusions=src/datascience-ui/**/codicon*.* sonar.tests=src/test sonar.cfamily.build-wrapper-output.bypass=true -sonar.cpd.exclusions=src/datascience-ui/**/redux/actions.ts,src/client/**/raw-kernel/rawKernel.ts,src/client/datascience/jupyter/*ariable*.ts,src/client/activation/**/*.ts +sonar.cpd.exclusions=src/datascience-ui/**/redux/actions.ts,src/platform/**/raw-kernel/rawKernel.ts,src/platform/datascience/jupyter/*ariable*.ts,src/platform/activation/**/*.ts diff --git a/.vscodeignore b/.vscodeignore index 460a191b14b..428456ab89d 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -72,7 +72,7 @@ news/** node_modules/** obj/** out/**/*.stats.json -out/client/**/*.analyzer.html +out/**/*.analyzer.html out/coverconfig.json out/datascience-ui/**/*.analyzer.html out/datascience-ui/common/** diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e55cb47523f..e7dc1f03874 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,6 +5,7 @@ | `main` branch | | ------------- | + ## | ![Main Build](https://github.com/microsoft/vscode-jupyter/actions/workflows/build-test.yml/badge.svg?branch=main) [For contributing to the [Microsoft Python Language Server](https://github.com/Microsoft/python-language-server) see its own repo; for [Pylance](https://github.com/microsoft/pylance-release) see its own repo; for [debugpy](https://github.com/microsoft/debugpy) see its own repo] @@ -214,7 +215,7 @@ Clone the repo into any directory, open that directory in VSCode, and use the `E Information on our coding standards can be found [here](https://github.com/Microsoft/vscode-jupyter/blob/main/CODING_STANDARDS.md). We have CI tests to ensure the code committed will adhere to the above coding standards. -Messages displayed to the user must be localized using/created constants from/in the [localize.ts](https://github.com/Microsoft/vscode-jupyter/blob/main/src/client/common/utils/localize.ts) file. +Messages displayed to the user must be localized using/created constants from/in the [localize.ts](https://github.com/Microsoft/vscode-jupyter/blob/main/src/platform/common/utils/localize.ts) file. ## Development process diff --git a/TELEMETRY.md b/TELEMETRY.md index 76e57715771..2ed4dd692d0 100644 --- a/TELEMETRY.md +++ b/TELEMETRY.md @@ -19,7 +19,7 @@ No properties for event ## Locations Used -[src/client/datascience/commands/commandRegistry.ts#L382](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/commandRegistry.ts#L382) +[src/interactive-window/commands/commandRegistry.ts#L376](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts#L376) ```typescript } } @@ -45,7 +45,7 @@ No description provided ## Locations Used -[src/client/datascience/commands/exportCommands.ts#L125](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/exportCommands.ts#L125) +[src/interactive-window/commands/exportCommands.ts#L125](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts#L125) ```typescript if (pickedItem !== undefined) { pickedItem.handler(); @@ -57,7 +57,7 @@ No description provided ``` -[src/client/datascience/commands/exportCommands.ts#L141](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/exportCommands.ts#L141) +[src/interactive-window/commands/exportCommands.ts#L141](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts#L141) ```typescript label: DataScience.exportPythonQuickPickLabel(), picked: true, @@ -69,7 +69,7 @@ No description provided ``` -[src/client/datascience/commands/exportCommands.ts#L155](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/exportCommands.ts#L155) +[src/interactive-window/commands/exportCommands.ts#L155](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts#L155) ```typescript label: DataScience.exportHTMLQuickPickLabel(), picked: false, @@ -81,7 +81,7 @@ No description provided ``` -[src/client/datascience/commands/exportCommands.ts#L170](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/exportCommands.ts#L170) +[src/interactive-window/commands/exportCommands.ts#L170](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts#L170) ```typescript label: DataScience.exportPDFQuickPickLabel(), picked: false, @@ -147,14 +147,14 @@ No properties for event ## Locations Used -[src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L368](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L368) +[src/interactive-window/interactiveWindowCommandListener.ts#L355](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts#L355) ```typescript } } @captureTelemetry(Telemetry.CreateNewInteractive, undefined, false) - private async createNewInteractiveWindow(): Promise { - await this.interactiveWindowProvider.getOrCreate(undefined); + private async createNewInteractiveWindow(connection?: KernelConnectionMetadata): Promise { + await this.interactiveWindowProvider.getOrCreate(undefined, connection); } ``` @@ -178,7 +178,7 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewer.ts#L314](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewer.ts#L314) +[src/platform/datascience/data-viewing/dataViewer.ts#L322](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewer.ts#L322) ```typescript private maybeSendSliceDataDimensionalityTelemetry(numberOfDimensions: number) { @@ -210,7 +210,7 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewer.ts#L197](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewer.ts#L197) +[src/platform/datascience/data-viewing/dataViewer.ts#L204](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewer.ts#L204) ```typescript break; @@ -241,7 +241,7 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewer.ts#L258](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewer.ts#L258) +[src/platform/datascience/data-viewing/dataViewer.ts#L265](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewer.ts#L265) ```typescript if (payload.shape?.length) { this.maybeSendSliceDataDimensionalityTelemetry(payload.shape.length); @@ -269,7 +269,7 @@ No properties for event ## Locations Used -[src/client/datascience/commands/commandRegistry.ts#L374](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/commandRegistry.ts#L374) +[src/interactive-window/commands/commandRegistry.ts#L368](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts#L368) ```typescript } } @@ -297,7 +297,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L120](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L120) +[src/interactive-window/editor-integration/codewatcher.ts#L124](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L124) ```typescript return this.codeLenses; } @@ -309,7 +309,7 @@ No properties for event ``` -[src/client/datascience/editor-integration/codewatcher.ts#L316](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L316) +[src/interactive-window/editor-integration/codewatcher.ts#L329](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L329) ```typescript return this.runMatchingCell(range, advance); } @@ -337,7 +337,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L185](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L185) +[src/interactive-window/editor-integration/codewatcher.ts#L188](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L188) ```typescript return this.runFileInteractiveInternal(false); } @@ -365,7 +365,7 @@ No properties for event ## Locations Used -[src/client/datascience/commands/commandRegistry.ts#L348](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/commandRegistry.ts#L348) +[src/interactive-window/commands/commandRegistry.ts#L342](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts#L342) ```typescript } } @@ -393,7 +393,7 @@ No properties for event ## Locations Used -[src/client/datascience/commands/commandRegistry.ts#L356](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/commandRegistry.ts#L356) +[src/interactive-window/commands/commandRegistry.ts#L350](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts#L350) ```typescript } } @@ -421,7 +421,7 @@ No properties for event ## Locations Used -[src/client/debugger/jupyter/debuggingManager.ts#L464](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/debuggingManager.ts#L464) +[src/platform/debugger/jupyter/debuggingManager.ts#L481](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/debuggingManager.ts#L481) ```typescript ); @@ -449,7 +449,7 @@ No properties for event ## Locations Used -[src/client/debugger/jupyter/debuggingManager.ts#L162](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/debuggingManager.ts#L162) +[src/platform/debugger/jupyter/debuggingManager.ts#L162](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/debuggingManager.ts#L162) ```typescript }), @@ -477,7 +477,7 @@ No properties for event ## Locations Used -[src/client/debugger/jupyter/debuggingManager.ts#L109](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/debuggingManager.ts#L109) +[src/platform/debugger/jupyter/debuggingManager.ts#L109](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/debuggingManager.ts#L109) ```typescript }), @@ -505,7 +505,7 @@ No properties for event ## Locations Used -[src/client/debugger/jupyter/debuggingManager.ts#L469](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/debuggingManager.ts#L469) +[src/platform/debugger/jupyter/debuggingManager.ts#L486](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/debuggingManager.ts#L486) ```typescript 'https://github.com/microsoft/vscode-jupyter/wiki/Setting-Up-Run-by-Line-and-Debugging-for-Notebooks' ); @@ -527,36 +527,12 @@ No description provided ## Properties -- +- reason: 'normally' | 'onKernelDisposed' | 'onAnInterrupt' | 'onARestart' | 'withKeybinding'; ## Locations Used -[src/client/debugger/jupyter/kernelDebugAdapter.ts#L89](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/kernelDebugAdapter.ts#L89) -```typescript - if (this.kernel) { - this.disposables.push( - this.kernel.onWillRestart(() => { - sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'onARestart' }); - this.disconnect(); - }) - ); -``` - - -[src/client/debugger/jupyter/kernelDebugAdapter.ts#L95](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/kernelDebugAdapter.ts#L95) -```typescript - ); - this.disposables.push( - this.kernel.onWillInterrupt(() => { - sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'onAnInterrupt' }); - this.disconnect(); - }) - ); -``` - - -[src/client/debugger/jupyter/kernelDebugAdapter.ts#L103](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/kernelDebugAdapter.ts#L103) +[src/platform/debugger/jupyter/kernelDebugAdapter.ts#L95](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/kernelDebugAdapter.ts#L95) ```typescript this.kernel.onDisposed(() => { void debug.stopDebugging(this.session); @@ -568,19 +544,19 @@ No description provided ``` -[src/client/debugger/jupyter/kernelDebugAdapter.ts#L117](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/kernelDebugAdapter.ts#L117) +[src/platform/debugger/jupyter/kernelDebugAdapter.ts#L109](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/kernelDebugAdapter.ts#L109) ```typescript cellStateChange.state === NotebookCellExecutionState.Idle && !this.disconected ) { sendTelemetryEvent(DebuggingTelemetry.endedSession, undefined, { reason: 'normally' }); - this.disconnect(); + void this.disconnect(); } }, ``` -[src/client/debugger/jupyter/debuggingManager.ts#L153](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/debuggingManager.ts#L153) +[src/platform/debugger/jupyter/debuggingManager.ts#L153](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/debuggingManager.ts#L153) ```typescript if (editor) { const controller = this.notebookToRunByLineController.get(editor.document); @@ -602,12 +578,12 @@ No description provided ## Properties -- +- status: 'installed' | 'notInstalled'; ## Locations Used -[src/client/debugger/jupyter/debuggingManager.ts#L443](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/debuggingManager.ts#L443) +[src/platform/debugger/jupyter/debuggingManager.ts#L463](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/debuggingManager.ts#L463) ```typescript } @@ -635,7 +611,7 @@ No properties for event ## Locations Used -[src/client/debugger/jupyter/debugControllers.ts#L25](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/debugControllers.ts#L25) +[src/platform/debugger/jupyter/debugControllers.ts#L25](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/debugControllers.ts#L25) ```typescript private readonly kernel: IKernel, private readonly commandManager: ICommandManager @@ -663,7 +639,7 @@ No properties for event ## Locations Used -[src/client/debugger/jupyter/debugControllers.ts#L54](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/debugger/jupyter/debugControllers.ts#L54) +[src/platform/debugger/jupyter/debugControllers.ts#L54](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/debugger/jupyter/debugControllers.ts#L54) ```typescript private readonly kernel: IKernel, private readonly settings: IConfigurationService @@ -805,7 +781,7 @@ No properties for event ## Locations Used -[src/client/datascience/shiftEnterBanner.ts#L103](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/shiftEnterBanner.ts#L103) +[src/platform/datascience/shiftEnterBanner.ts#L93](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/shiftEnterBanner.ts#L93) ```typescript ); } @@ -817,7 +793,7 @@ No properties for event ``` -[src/test/datascience/shiftEnterBanner.unit.test.ts#L115](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts#L115) +[src/test/datascience/shiftEnterBanner.unit.test.ts#L100](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts#L100) ```typescript expect(Reporter.eventNames).to.deep.equal([ @@ -845,7 +821,7 @@ No properties for event ## Locations Used -[src/client/datascience/shiftEnterBanner.ts#L114](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/shiftEnterBanner.ts#L114) +[src/platform/datascience/shiftEnterBanner.ts#L104](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/shiftEnterBanner.ts#L104) ```typescript await this.disableBanner(); } @@ -857,7 +833,7 @@ No properties for event ``` -[src/test/datascience/shiftEnterBanner.unit.test.ts#L70](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts#L70) +[src/test/datascience/shiftEnterBanner.unit.test.ts#L69](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts#L69) ```typescript expect(Reporter.eventNames).to.deep.equal([ @@ -886,7 +862,7 @@ No properties for event ## Locations Used -[src/client/datascience/telemetry/telemetry.ts#L79](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L79) +[src/telemetry/telemetry.ts#L84](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L84) ```typescript properties?: P[E] & { waitBeforeSending?: Promise }, ex?: Error @@ -898,7 +874,7 @@ No properties for event ``` -[src/client/datascience/telemetry/telemetry.ts#L116](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L116) +[src/telemetry/telemetry.ts#L121](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L121) ```typescript stopWatch?: StopWatch, properties?: P[E] & { [waitBeforeSending]?: Promise } @@ -910,23 +886,23 @@ No properties for event ``` -[src/client/datascience/notebook/vscodeNotebookController.ts#L187](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/vscodeNotebookController.ts#L187) +[src/notebooks/controllers/vscodeNotebookController.ts#L255](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts#L255) ```typescript return; } initializeInteractiveOrNotebookTelemetryBasedOnUserAction(notebook.uri, this.connection); sendKernelTelemetryEvent(notebook.uri, Telemetry.ExecuteCell); // Notebook is trusted. Continue to execute cells - traceInfo(`Execute Cells request ${cells.length} ${cells.map((cell) => cell.index).join(', ')}`); + traceInfo(`Execute Cells request ${cells.map((cell) => cell.index).join(', ')}`); await Promise.all(cells.map((cell) => this.executeCell(notebook, cell))); ``` -[src/client/datascience/jupyter/kernels/kernel.ts#L174](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernel.ts#L174) +[src/kernels/kernel.ts#L197](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.ts#L197) ```typescript - } - private perceivedJupyterStartupTelemetryCaptured?: boolean; + public async executeCell(cell: NotebookCell): Promise { + traceCellMessage(cell, `kernel.executeCell, ${getDisplayPath(cell.notebook.uri)}`); sendKernelTelemetryEvent(this.resourceUri, Telemetry.ExecuteCell); const stopWatch = new StopWatch(); const sessionPromise = this.startNotebook().then((nb) => nb.session); @@ -1008,7 +984,7 @@ No description provided ## Locations Used -[src/client/datascience/export/exportFileOpener.ts#L25](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/export/exportFileOpener.ts#L25) +[src/platform/datascience/export/exportFileOpener.ts#L25](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/export/exportFileOpener.ts#L25) ```typescript public async openFile(format: ExportFormat, uri: Uri) { if (format === ExportFormat.python) { @@ -1020,7 +996,7 @@ No description provided ``` -[src/client/datascience/export/exportFileOpener.ts#L32](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/export/exportFileOpener.ts#L32) +[src/platform/datascience/export/exportFileOpener.ts#L32](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/export/exportFileOpener.ts#L32) ```typescript }); } else { @@ -1032,7 +1008,7 @@ No description provided ``` -[src/client/datascience/export/fileConverter.ts#L107](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/export/fileConverter.ts#L107) +[src/platform/datascience/export/fileConverter.ts#L69](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/export/fileConverter.ts#L69) ```typescript } @@ -1040,7 +1016,7 @@ No description provided sendTelemetryEvent(Telemetry.ExportNotebookAs, undefined, { format: format, cancelled: true }); return; } - await this.exportFileOpener.openFile(format, target); + } ``` @@ -1058,7 +1034,7 @@ No description provided ## Locations Used -[src/client/datascience/commands/exportCommands.ts#L110](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/exportCommands.ts#L110) +[src/interactive-window/commands/exportCommands.ts#L110](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/exportCommands.ts#L110) ```typescript this.controllers.getSelectedNotebookController(sourceDocument)?.connection.interpreter || this.controllers.getPreferredNotebookController(sourceDocument)?.connection.interpreter; @@ -1084,9 +1060,9 @@ No description provided ## Locations Used -[src/client/datascience/export/fileConverter.ts#L68](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/export/fileConverter.ts#L68) +[src/platform/datascience/export/fileConverter.ts#L90](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/export/fileConverter.ts#L90) ```typescript - await this.performExport(format, sourceDocument, target, candidateInterpreter); + await this.performExport(format, sourceDocument, target, token, candidateInterpreter); } catch (e) { traceError('Export failed', e); sendTelemetryEvent(Telemetry.ExportNotebookAsFailed, undefined, { format: format }); @@ -1112,7 +1088,7 @@ No properties for event ## Locations Used -[src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L215](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L215) +[src/interactive-window/interactiveWindowCommandListener.ts#L203](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts#L203) ```typescript return result; } @@ -1140,7 +1116,7 @@ No properties for event ## Locations Used -[src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L263](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L263) +[src/interactive-window/interactiveWindowCommandListener.ts#L251](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts#L251) ```typescript } } @@ -1168,7 +1144,7 @@ No properties for event ## Locations Used -[src/client/datascience/variablesView/variableView.ts#L179](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/variablesView/variableView.ts#L179) +[src/platform/datascience/variablesView/variableView.ts#L174](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/variablesView/variableView.ts#L174) ```typescript } } catch (e) { @@ -1197,7 +1173,7 @@ No properties for event ## Locations Used -[src/client/datascience/notebook/notebookControllerManager.ts#L588](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/notebookControllerManager.ts#L588) +[src/notebooks/controllers/notebookControllerManager.ts#L803](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/notebookControllerManager.ts#L803) ```typescript } catch (ex) { // We know that this fails when we have xeus kernels installed (untill that's resolved thats one instance when we can have duplicates). @@ -1227,7 +1203,19 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/helpers.ts#L438](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/helpers.ts#L438) +[src/kernels/helpers.ts#L599](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.ts#L599) +```typescript + return preferredInterpreterKernelSpec; + } + // Telemetry to see if this happens in the real world, this should not be possible. + sendTelemetryEvent(Telemetry.FailedToFindKernelSpecInterpreterForInteractive); + } + } + +``` + + +[src/kernels/helpers.ts#L1350](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.ts#L1350) ```typescript return kernelMatchingPreferredInterpreter; } @@ -1255,7 +1243,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterPasswordConnect.ts#L30](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterPasswordConnect.ts#L30) +[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L30](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L30) ```typescript @inject(IConfigurationService) private readonly configService: IConfigurationService ) {} @@ -1283,7 +1271,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L679](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L679) +[src/interactive-window/editor-integration/codewatcher.ts#L689](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L689) ```typescript }); } @@ -1311,7 +1299,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L696](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L696) +[src/interactive-window/editor-integration/codewatcher.ts#L706](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L706) ```typescript } } @@ -1356,7 +1344,7 @@ No description provided ## Locations Used -[src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L383](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L383) +[src/interactive-window/interactiveWindowCommandListener.ts#L370](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts#L370) ```typescript return this.statusProvider.waitWithStatus(promise, message, undefined, canceled); } @@ -1368,7 +1356,7 @@ No description provided ``` -[src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L407](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-window/interactiveWindowCommandListener.ts#L407) +[src/interactive-window/interactiveWindowCommandListener.ts#L393](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/interactiveWindowCommandListener.ts#L393) ```typescript } } @@ -1379,6 +1367,83 @@ No description provided await this.waitForStatus( ``` + +
+ DATASCIENCE.INTERACTIVE_WINDOW_DEBUG_SETUP_CODE_FAILURE + +## Description + + +No description provided + +## Properties + +- + ename: string; +- + evalue: string; + +## Locations Used + +[src/kernels/debugging/interactiveWindowDebugger.ts#L114](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugging/interactiveWindowDebugger.ts#L114) +```typescript + executeSilently(kernel.session, this.tracingEnableCode, { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure enabling tracing code for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + }).ignoreErrors(); + } + +``` + + +[src/kernels/debugging/interactiveWindowDebugger.ts#L125](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugging/interactiveWindowDebugger.ts#L125) +```typescript + executeSilently(kernel.session, this.tracingDisableCode, { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure disabling tracing code for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + }).ignoreErrors(); + } + +``` + + +[src/kernels/debugging/interactiveWindowDebugger.ts#L154](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugging/interactiveWindowDebugger.ts#L154) +```typescript + const importResults = await executeSilently(kernel.session, this.waitForDebugClientCode, { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure starting debug session for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + }); + if (importResults.some((item) => item.output_type === 'error')) { + traceWarning(`${this.debuggerPackage} not found in path.`); +``` + + +[src/kernels/debugging/interactiveWindowDebugger.ts#L276](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugging/interactiveWindowDebugger.ts#L276) +```typescript + { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure appending debugger paths for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + } + ) + : []; +``` + + +[src/kernels/debugging/interactiveWindowDebugger.ts#L305](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/debugging/interactiveWindowDebugger.ts#L305) +```typescript + ? await executeSilently(kernel.session, this.enableDebuggerCode, { + traceErrors: true, + traceErrorsMessage: 'Execute_request failure enabling debugging for IW', + telemetryName: Telemetry.InteractiveWindowDebugSetupCodeFailure + }) + : []; + +``` +
DATASCIENCE.INTERRUPT @@ -1396,7 +1461,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/kernelExecution.ts#L177](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelExecution.ts#L177) +[src/notebooks/execution/kernelExecution.ts#L194](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts#L194) ```typescript this.documentExecutions.set(document, newCellExecutionQueue); return newCellExecutionQueue; @@ -1418,15 +1483,157 @@ No description provided ## Properties -- +- where: 'activeInterpreter' | 'otherInterpreter' | 'path' | 'nowhere'; -- +- command: JupyterCommands; ## Locations Used Event can be removed. Not referenced anywhere +
+
+ DATASCIENCE.JUPYTER_KERNEL_API_ACCESS + +## Description + + +No description provided + +## Properties + +- + extensionId: string; +- + allowed: 'yes' | 'no'; + +## Locations Used + +[src/platform/api/apiAccessService.ts#L70](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/apiAccessService.ts#L70) +```typescript + const extensionPermissions = this.globalState.get(API_ACCESS_GLOBAL_KEY); + const extensionPermission = extensionPermissions?.find((item) => item.extensionId === info.extensionId); + if (extensionPermission) { + sendTelemetryEvent(Telemetry.JupyterKernelApiAccess, undefined, { + extensionId: info.extensionId, + allowed: extensionPermission.allowed + }); +``` + + +[src/platform/api/apiAccessService.ts#L98](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/apiAccessService.ts#L98) +```typescript + extensionPermissions.push({ allowed: allow ? 'yes' : 'no', extensionId: info.extensionId }); + return this.globalState.update(API_ACCESS_GLOBAL_KEY, extensionPermissions); + }); + sendTelemetryEvent(Telemetry.JupyterKernelApiAccess, undefined, { + extensionId: info.extensionId, + allowed: allow ? 'yes' : 'no' + }); +``` + +
+
+ DATASCIENCE.JUPYTER_KERNEL_API_USAGE + +## Description + + +No description provided + +## Properties + +- + extensionId: string; +- + pemUsed: keyof IExportedKernelService; + +## Locations Used + +[src/platform/api/kernelApi.ts#L70](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts#L70) +```typescript + KernelConnectionMetadata + >(); + public get onDidChangeKernelSpecifications(): Event { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'onDidChangeKernelSpecifications' + }); +``` + + +[src/platform/api/kernelApi.ts#L78](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts#L78) +```typescript + return this._onDidChangeKernelSpecifications.event; + } + public get onDidChangeKernels(): Event { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'onDidChangeKernels' + }); +``` + + +[src/platform/api/kernelApi.ts#L100](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts#L100) +```typescript + ); + } + async getKernelSpecifications(refresh?: boolean): Promise { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'getKernelSpecifications' + }); +``` + + +[src/platform/api/kernelApi.ts#L109](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts#L109) +```typescript + return items.map((item) => this.translateKernelConnectionMetadataToExportedType(item)); + } + async getActiveKernels(): Promise<{ metadata: KernelConnectionMetadata; notebook: NotebookDocument }[]> { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'getActiveKernels' + }); +``` + + +[src/platform/api/kernelApi.ts#L125](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts#L125) +```typescript + getKernel( + notebook: NotebookDocument + ): { metadata: KernelConnectionMetadata; connection: IKernelConnectionInfo } | undefined { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'getKernel' + }); +``` + + +[src/platform/api/kernelApi.ts#L139](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts#L139) +```typescript + } + } + async startKernel(spec: KernelConnectionMetadata, notebook: NotebookDocument): Promise { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'startKernel' + }); +``` + + +[src/platform/api/kernelApi.ts#L146](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/kernelApi.ts#L146) +```typescript + return this.startOrConnect(spec, notebook); + } + async connect(spec: ActiveKernel, notebook: NotebookDocument): Promise { + sendTelemetryEvent(Telemetry.JupyterKernelApiUsage, undefined, { + extensionId: this.callingExtensionId, + pemUsed: 'connect' + }); +``` +
DATASCIENCE.JUPYTER_NOT_INSTALLED_ERROR_SHOWN @@ -1444,15 +1651,44 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L144](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L144) +[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L157](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L157) ```typescript - action: 'displayed', - moduleName: ProductNames.get(Product.jupyter)! - }); - sendTelemetryEvent(Telemetry.JupyterNotInstalledErrorShown); - const selection = await this.applicationShell.showErrorMessage( - message, - { modal: true }, + moduleName: ProductNames.get(Product.jupyter)!, + pythonEnvType: interpreter.envType + }); + sendTelemetryEvent(Telemetry.JupyterNotInstalledErrorShown); + const selection = await this.applicationShell.showErrorMessage( + message, + { modal: true }, +``` + +
+
+ DATASCIENCE.KERNEL_STARTUP_CODE_FAILURE + +## Description + + +No description provided + +## Properties + +- + ename: string; +- + evalue: string; + +## Locations Used + +[src/kernels/kernel.ts#L559](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.ts#L559) +```typescript + await this.executeSilently(notebook, startupCode, { + traceErrors: true, + traceErrorsMessage: 'Error executing jupyter extension internal startup code', + telemetryName: Telemetry.KernelStartupCodeFailure + }); + + // Run user specified startup commands ```
@@ -1491,7 +1727,7 @@ No properties for event ## Locations Used -[src/client/datascience/notebook/notebookEditorProvider.ts#L31](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/notebookEditorProvider.ts#L31) +[src/notebooks/notebookEditorProvider.ts#L30](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookEditorProvider.ts#L30) ```typescript const nb = await this.vscodeNotebook.openNotebookDocument(file); await this.vscodeNotebook.showNotebookDocument(nb); @@ -2125,11 +2361,11 @@ No properties for event ## Locations Used -[src/client/datascience/activation.ts#L52](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/activation.ts#L52) +[src/platform/datascience/activation.ts#L46](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/activation.ts#L46) ```typescript } this.notebookOpened = true; - this.PreWarmDaemonPool().ignoreErrors(); + void this.PreWarmDaemonPool(); sendTelemetryEvent(Telemetry.OpenNotebookAll); if (!this.rawSupported.isSupported && this.extensionChecker.isPythonExtensionInstalled) { @@ -2156,16 +2392,7 @@ No properties for event ## Locations Used -[src/client/datascience/notebook/creation/notebookCreator.ts#L53](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/creation/notebookCreator.ts#L53) -```typescript - matchOnDetail: true, - placeHolder - }); - sendTelemetryEvent(Telemetry.OpenNotebookSelection, undefined, { extensionId: item?.extensionId }); - if (item) { - await this.editorProvider.createNew({ defaultCellLanguage: item.defaultCellLanguage }); - } -``` +Event can be removed. Not referenced anywhere
@@ -2178,7 +2405,7 @@ No description provided ## Properties -- +- /** * The id of the extension registering with us to be displayed the dropdown list for notebook creation. */ @@ -2186,16 +2413,7 @@ No description provided ## Locations Used -[src/client/datascience/notebook/creation/creationOptionsService.ts#L21](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/creation/creationOptionsService.ts#L21) -```typescript - try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ext.packageJSON.contributes['jupyter.kernels'].forEach((kernel: any) => { - sendTelemetryEvent(Telemetry.OpenNotebookSelectionRegistered, undefined, { extensionId: ext.id }); - this._registrations.push({ - extensionId: ext.id, - displayName: kernel['title'], -``` +Event can be removed. Not referenced anywhere
@@ -2214,7 +2432,7 @@ No properties for event ## Locations Used -[src/client/datascience/telemetry/telemetry.ts#L363](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L363) +[src/telemetry/telemetry.ts#L369](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L369) ```typescript // eslint-disable-next-line @typescript-eslint/no-explicit-any function resetData(resource: Resource, eventName: string, properties: any) { @@ -2226,7 +2444,7 @@ function resetData(resource: Resource, eventName: string, properties: any) { ``` -[src/client/datascience/telemetry/telemetry.ts#L364](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L364) +[src/telemetry/telemetry.ts#L370](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L370) ```typescript function resetData(resource: Resource, eventName: string, properties: any) { // Once we have successfully interrupted, clear the interrupt counter. @@ -2238,7 +2456,7 @@ function resetData(resource: Resource, eventName: string, properties: any) { ``` -[src/client/datascience/telemetry/telemetry.ts#L365](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L365) +[src/telemetry/telemetry.ts#L371](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L371) ```typescript // Once we have successfully interrupted, clear the interrupt counter. if (eventName === Telemetry.NotebookInterrupt) { @@ -2250,7 +2468,7 @@ function resetData(resource: Resource, eventName: string, properties: any) { ``` -[src/client/datascience/jupyter/kernels/kernelExecution.ts#L233](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelExecution.ts#L233) +[src/notebooks/execution/kernelExecution.ts#L250](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts#L250) ```typescript // Otherwise a real error occurred. sendKernelTelemetryEvent( @@ -2262,7 +2480,7 @@ function resetData(resource: Resource, eventName: string, properties: any) { ``` -[src/client/datascience/jupyter/kernels/kernelExecution.ts#L245](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelExecution.ts#L245) +[src/notebooks/execution/kernelExecution.ts#L262](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts#L262) ```typescript })(); @@ -2295,7 +2513,7 @@ No properties for event ## Locations Used -[src/client/datascience/common.ts#L171](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/common.ts#L171) +[src/platform/datascience/common.ts#L171](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/common.ts#L171) ```typescript } @@ -2323,7 +2541,7 @@ No properties for event ## Locations Used -[src/client/datascience/telemetry/telemetry.ts#L372](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L372) +[src/telemetry/telemetry.ts#L378](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L378) ```typescript } } @@ -2335,7 +2553,7 @@ No properties for event ``` -[src/client/datascience/telemetry/telemetry.ts#L373](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L373) +[src/telemetry/telemetry.ts#L379](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L379) ```typescript } // Once we have successfully restarted, clear the interrupt counter. @@ -2347,7 +2565,7 @@ No properties for event ``` -[src/client/datascience/telemetry/telemetry.ts#L374](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L374) +[src/telemetry/telemetry.ts#L380](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L380) ```typescript // Once we have successfully restarted, clear the interrupt counter. if (eventName === Telemetry.NotebookRestart) { @@ -2359,27 +2577,27 @@ No properties for event ``` -[src/client/datascience/jupyter/kernels/kernelCommandListener.ts#L174](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelCommandListener.ts#L174) +[src/kernels/kernel.ts#L306](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.ts#L306) ```typescript - const stopWatch = new StopWatch(); - try { - await kernel.restart(); - sendKernelTelemetryEvent(kernel.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime); - } catch (exc) { - // If we get a kernel promise failure, then restarting timed out. Just shutdown and restart the entire server. - // Note, this code might not be necessary, as such an error is thrown only when interrupting a kernel times out. + ? this.kernelExecution.restart(this._notebookPromise?.then((item) => item.session)) + : this.start(new DisplayOptions(false))); + traceInfoIfCI(`Restarted ${getDisplayPath(this.notebookDocument.uri)}`); + sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime); + } catch (ex) { + traceError(`Restart failed ${getDisplayPath(this.notebookDocument.uri)}`, ex); + this._ignoreNotebookDisposedErrors = true; ``` -[src/client/datascience/jupyter/kernels/kernelCommandListener.ts#L180](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelCommandListener.ts#L180) +[src/kernels/kernel.ts#L317](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.ts#L317) ```typescript + this.restarting = undefined; + // If we get a kernel promise failure, then restarting timed out. Just shutdown and restart the entire server. // Note, this code might not be necessary, as such an error is thrown only when interrupting a kernel times out. - sendKernelTelemetryEvent( - kernel.resourceUri, - Telemetry.NotebookRestart, - stopWatch.elapsedTime, - undefined, - exc + sendKernelTelemetryEvent(this.resourceUri, Telemetry.NotebookRestart, stopWatch.elapsedTime, undefined, ex); + await notebook?.session.dispose().catch(noop); + this._ignoreNotebookDisposedErrors = false; + throw ex; ```
@@ -2399,7 +2617,7 @@ No properties for event ## Locations Used -[src/client/datascience/telemetry/telemetry.ts#L405](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L405) +[src/telemetry/telemetry.ts#L411](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L411) ```typescript } // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -2411,7 +2629,7 @@ function incrementStartFailureCount(resource: Resource, eventName: any, properti ``` -[src/client/datascience/telemetry/telemetry.ts#L406](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L406) +[src/telemetry/telemetry.ts#L412](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L412) ```typescript // eslint-disable-next-line @typescript-eslint/no-explicit-any function incrementStartFailureCount(resource: Resource, eventName: any, properties: any) { @@ -2423,7 +2641,7 @@ function incrementStartFailureCount(resource: Resource, eventName: any, properti ``` -[src/client/datascience/telemetry/telemetry.ts#L407](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/telemetry.ts#L407) +[src/telemetry/telemetry.ts#L413](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/telemetry.ts#L413) ```typescript function incrementStartFailureCount(resource: Resource, eventName: any, properties: any) { if (eventName === Telemetry.NotebookStart) { @@ -2435,25 +2653,13 @@ function incrementStartFailureCount(resource: Resource, eventName: any, properti ``` -[src/client/datascience/jupyter/kernels/kernel.ts#L349](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernel.ts#L349) -```typescript - } catch (ex) { - sendKernelTelemetryEvent( - this.resourceUri, - Telemetry.NotebookStart, - stopWatch.elapsedTime, - undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any -``` - - -[src/client/datascience/interactive-common/notebookProvider.ts#L115](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-common/notebookProvider.ts#L115) +[src/kernels/jupyter/launcher/notebookProvider.ts#L91](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/notebookProvider.ts#L91) ```typescript ) : this.jupyterNotebookProvider.createNotebook(options); - sendKernelTelemetryWhenDone(resource, Telemetry.NotebookStart, promise, undefined, { - disableUI: options.disableUI + sendKernelTelemetryWhenDone(options.resource, Telemetry.NotebookStart, promise, undefined, { + disableUI: options.ui.disableUI === true }); ``` @@ -2475,7 +2681,7 @@ No properties for event ## Locations Used -[src/client/datascience/plotting/plotViewerProvider.ts#L46](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/plotting/plotViewerProvider.ts#L46) +[src/platform/datascience/plotting/plotViewerProvider.ts#L46](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/plotting/plotViewerProvider.ts#L46) ```typescript this.currentViewer = this.serviceContainer.get(IPlotViewer); this.currentViewerClosed = this.currentViewer.closed(this.closedViewer); @@ -2505,6 +2711,83 @@ No properties for event Event can be removed. Not referenced anywhere + +
+ DATASCIENCE.PYTHON_VARIABLE_FETCHING_CODE_FAILURE + +## Description + + +No description provided + +## Properties + +- + ename: string; +- + evalue: string; + +## Locations Used + +[src/kernels/variables/pythonVariableRequester.ts#L62](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts#L62) +```typescript + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getDataFrameInfo', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ) + : []; +``` + + +[src/kernels/variables/pythonVariableRequester.ts#L93](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts#L93) +```typescript + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getDataFrameRows', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ) + : []; +``` + + +[src/kernels/variables/pythonVariableRequester.ts#L126](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts#L126) +```typescript + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getVariableProperties', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ) + : []; +``` + + +[src/kernels/variables/pythonVariableRequester.ts#L154](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts#L154) +```typescript + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getVariableNamesAndTypesFromKernel', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ) + : []; +``` + + +[src/kernels/variables/pythonVariableRequester.ts#L197](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/pythonVariableRequester.ts#L197) +```typescript + { + traceErrors: true, + traceErrorsMessage: 'Failure in execute_request for getFullVariable', + telemetryName: Telemetry.PythonVariableFetchingCodeFailure + } + ) + : []; +``` +
DATASCIENCE.RECOMMENT_EXTENSION @@ -2517,12 +2800,12 @@ Event can be removed. Not referenced anywhere ## Properties -- +- /** * Extension we recommended the user to install. */ extensionId: string; -- +- /** * `displayed` - If prompt was displayed * `dismissed` - If prompt was displayed & dismissed by the user @@ -2534,7 +2817,7 @@ Event can be removed. Not referenced anywhere ## Locations Used -[src/client/datascience/extensionRecommendation.ts#L117](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/extensionRecommendation.ts#L117) +[src/platform/datascience/extensionRecommendation.ts#L120](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/extensionRecommendation.ts#L120) ```typescript `[${extensionInfo.displayName}](${extensionInfo.extensionLink})`, language @@ -2546,7 +2829,7 @@ Event can be removed. Not referenced anywhere ``` -[src/client/datascience/extensionRecommendation.ts#L126](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/extensionRecommendation.ts#L126) +[src/platform/datascience/extensionRecommendation.ts#L129](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/extensionRecommendation.ts#L129) ```typescript ); switch (selection) { @@ -2558,7 +2841,7 @@ Event can be removed. Not referenced anywhere ``` -[src/client/datascience/extensionRecommendation.ts#L131](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/extensionRecommendation.ts#L131) +[src/platform/datascience/extensionRecommendation.ts#L134](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/extensionRecommendation.ts#L134) ```typescript break; } @@ -2570,7 +2853,7 @@ Event can be removed. Not referenced anywhere ``` -[src/client/datascience/extensionRecommendation.ts#L135](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/extensionRecommendation.ts#L135) +[src/platform/datascience/extensionRecommendation.ts#L138](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/extensionRecommendation.ts#L138) ```typescript break; } @@ -2582,7 +2865,7 @@ Event can be removed. Not referenced anywhere ``` -[src/client/datascience/extensionRecommendation.ts#L144](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/extensionRecommendation.ts#L144) +[src/platform/datascience/extensionRecommendation.ts#L147](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/extensionRecommendation.ts#L147) ```typescript break; } @@ -2631,7 +2914,7 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewer.ts#L193](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewer.ts#L193) +[src/platform/datascience/data-viewing/dataViewer.ts#L200](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewer.ts#L200) ```typescript case DataViewerMessages.RefreshDataViewer: @@ -2659,7 +2942,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/kernelCommandListener.ts#L127](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelCommandListener.ts#L127) +[src/kernels/kernelCommandListener.ts#L136](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelCommandListener.ts#L136) ```typescript return; } @@ -2710,15 +2993,15 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L134](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L134) +[src/interactive-window/editor-integration/codewatcher.ts#L138](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L138) ```typescript this.closeDocumentDisposable?.dispose(); // NOSONAR this.updateRequiredDisposable?.dispose(); // NOSONAR } @captureTelemetry(Telemetry.RunAllCells) public async runAllCells() { + const iw = await this.getActiveInteractiveWindow(); const runCellCommands = this.codeLenses.filter( - (c) => ```
@@ -2738,15 +3021,15 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L191](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L191) +[src/interactive-window/editor-integration/codewatcher.ts#L194](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L194) ```typescript } // Run all cells up to the cell containing this start line and character @captureTelemetry(Telemetry.RunAllCellsAbove) public async runAllCellsAbove(stopLine: number, stopCharacter: number) { + const iw = await this.getActiveInteractiveWindow(); const runCellCommands = this.codeLenses.filter((c) => c.command && c.command.command === Commands.RunCell); - let leftCount = runCellCommands.findIndex( ``` @@ -2824,7 +3107,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/debuggerVariables.ts#L125](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/debuggerVariables.ts#L125) +[src/kernels/variables/debuggerVariables.ts#L127](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/debuggerVariables.ts#L127) ```typescript // Note, full variable results isn't necessary for this call. It only really needs the variable value. const result = this.lastKnownVariables.find((v) => v.name === name); @@ -2852,16 +3135,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L303](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L303) -```typescript - } - } - - @captureTelemetry(Telemetry.RunCell) - public async runCell(range: Range): Promise { - if (!this.documentManager.activeTextEditor || !this.documentManager.activeTextEditor.document) { - return; -``` +Event can be removed. Not referenced anywhere
@@ -2880,15 +3154,15 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L229](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L229) +[src/interactive-window/editor-integration/codewatcher.ts#L232](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L232) ```typescript - } + await finished; } @captureTelemetry(Telemetry.RunCellAndAllBelow) public async runCellAndAllBelow(startLine: number, startCharacter: number) { + const iw = await this.getActiveInteractiveWindow(); const runCellCommands = this.codeLenses.filter((c) => c.command && c.command.command === Commands.RunCell); - const index = runCellCommands.findIndex( ```
@@ -2908,7 +3182,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L672](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L672) +[src/interactive-window/editor-integration/codewatcher.ts#L682](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L682) ```typescript }); } @@ -2936,7 +3210,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L665](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L665) +[src/interactive-window/editor-integration/codewatcher.ts#L675](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L675) ```typescript await this.moveCellsDirection(false); } @@ -2964,7 +3238,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L326](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L326) +[src/interactive-window/editor-integration/codewatcher.ts#L339](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L339) ```typescript return this.runMatchingCell(range, false, true); } @@ -2992,7 +3266,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L354](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L354) +[src/interactive-window/editor-integration/codewatcher.ts#L367](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L367) ```typescript } } @@ -3020,7 +3294,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L336](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L336) +[src/interactive-window/editor-integration/codewatcher.ts#L349](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L349) ```typescript return this.runMatchingCell(this.documentManager.activeTextEditor.selection, false); } @@ -3048,7 +3322,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L429](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L429) +[src/interactive-window/editor-integration/codewatcher.ts#L439](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L439) ```typescript } } @@ -3076,7 +3350,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L521](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L521) +[src/interactive-window/editor-integration/codewatcher.ts#L531](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L531) ```typescript editor.selections = selections; } @@ -3104,7 +3378,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L587](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L587) +[src/interactive-window/editor-integration/codewatcher.ts#L597](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L597) ```typescript } } @@ -3132,7 +3406,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L180](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L180) +[src/interactive-window/editor-integration/codewatcher.ts#L183](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L183) ```typescript } } @@ -3160,7 +3434,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L289](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L289) +[src/interactive-window/editor-integration/codewatcher.ts#L301](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L301) ```typescript } } @@ -3168,7 +3442,7 @@ No properties for event @captureTelemetry(Telemetry.RunFromLine) public async runFromLine(targetLine: number) { if (this.document && targetLine < this.document.lineCount) { - const lastLine = this.document.lineAt(this.document.lineCount - 1); + const iw = await this.getActiveInteractiveWindow(); ``` @@ -3188,7 +3462,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L416](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L416) +[src/interactive-window/editor-integration/codewatcher.ts#L426](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L426) ```typescript } } @@ -3216,7 +3490,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L403](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L403) +[src/interactive-window/editor-integration/codewatcher.ts#L413](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L413) ```typescript } } @@ -3246,7 +3520,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L395](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L395) +[src/interactive-window/editor-integration/codewatcher.ts#L405](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L405) ```typescript ); } @@ -3274,7 +3548,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L660](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L660) +[src/interactive-window/editor-integration/codewatcher.ts#L670](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L670) ```typescript await this.moveCellsDirection(true); } @@ -3302,7 +3576,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L655](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L655) +[src/interactive-window/editor-integration/codewatcher.ts#L665](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L665) ```typescript } } @@ -3330,7 +3604,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L466](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L466) +[src/interactive-window/editor-integration/codewatcher.ts#L476](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L476) ```typescript }); } @@ -3358,7 +3632,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L483](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L483) +[src/interactive-window/editor-integration/codewatcher.ts#L493](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L493) ```typescript } } @@ -3386,15 +3660,15 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L254](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L254) +[src/interactive-window/editor-integration/codewatcher.ts#L257](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L257) ```typescript - } + await finished; } @captureTelemetry(Telemetry.RunSelectionOrLine) public async runSelectionOrLine(activeEditor: TextEditor | undefined, text?: string | Uri) { if (this.document && activeEditor && this.fs.arePathsSame(activeEditor.document.uri, this.document.uri)) { - let codeToExecute: string | undefined; + const iw = await this.getActiveInteractiveWindow(); ``` @@ -3414,7 +3688,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codewatcher.ts#L275](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L275) +[src/interactive-window/editor-integration/codewatcher.ts#L286](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L286) ```typescript } } @@ -3422,7 +3696,7 @@ No properties for event @captureTelemetry(Telemetry.RunToLine) public async runToLine(targetLine: number) { if (this.document && targetLine > 0) { - const previousLine = this.document.lineAt(targetLine - 1); + const iw = await this.getActiveInteractiveWindow(); ``` @@ -3485,7 +3759,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts#L24](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts#L24) +[src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts#L24](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts#L24) ```typescript public async activate(): Promise { this.disposables.push( @@ -3513,7 +3787,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/commandLineSelector.ts#L36](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/commandLineSelector.ts#L36) +[src/kernels/jupyter/launcher/commandLineSelector.ts#L36](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/commandLineSelector.ts#L36) ```typescript workspaceService.onDidChangeConfiguration(this.onDidChangeConfiguration.bind(this)); } @@ -3525,7 +3799,7 @@ No properties for event ``` -[src/client/datascience/jupyter/serverSelector.ts#L56](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/serverSelector.ts#L56) +[src/kernels/jupyter/serverSelector.ts#L57](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts#L57) ```typescript @inject(IJupyterServerUriStorage) private readonly serverUriStorage: IJupyterServerUriStorage ) {} @@ -3553,13 +3827,13 @@ No properties for event ## Locations Used -[src/client/datascience/notebook/vscodeNotebookController.ts#L393](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/vscodeNotebookController.ts#L393) +[src/notebooks/controllers/vscodeNotebookController.ts#L571](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts#L571) ```typescript + // Else VSC is just setting a kernel for a notebook after it has opened. if (existingKernel) { - const telemetryEvent = - this.localOrRemoteKernel === 'local' - ? Telemetry.SelectLocalJupyterKernel - : Telemetry.SelectRemoteJupyterKernel; + const telemetryEvent = isLocalConnection(this.kernelConnection) + ? Telemetry.SelectLocalJupyterKernel + : Telemetry.SelectRemoteJupyterKernel; sendKernelTelemetryEvent(document.uri, telemetryEvent); this.notebookApi.notebookEditors ``` @@ -3581,12 +3855,12 @@ No properties for event ## Locations Used -[src/client/datascience/notebook/vscodeNotebookController.ts#L394](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/vscodeNotebookController.ts#L394) +[src/notebooks/controllers/vscodeNotebookController.ts#L572](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts#L572) ```typescript - const telemetryEvent = - this.localOrRemoteKernel === 'local' - ? Telemetry.SelectLocalJupyterKernel - : Telemetry.SelectRemoteJupyterKernel; + if (existingKernel) { + const telemetryEvent = isLocalConnection(this.kernelConnection) + ? Telemetry.SelectLocalJupyterKernel + : Telemetry.SelectRemoteJupyterKernel; sendKernelTelemetryEvent(document.uri, telemetryEvent); this.notebookApi.notebookEditors .filter((editor) => editor.document === document) @@ -3609,19 +3883,31 @@ No properties for event ## Locations Used -[src/client/datascience/interactive-common/notebookServerProvider.ts#L153](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-common/notebookServerProvider.ts#L153) +[src/platform/errors/errorHandler.ts#L76](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/errorHandler.ts#L76) ```typescript - ) - .ignoreErrors(); - } else if (value === closeOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageClose); - } - }) - .then(noop, noop); + ConfigurationTarget.Workspace + ); + } else if (value === closeOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageClose); + } + }); + } else if (err instanceof VscCancellationError || err instanceof CancellationError) { ``` -[src/client/datascience/jupyter/jupyterPasswordConnect.ts#L377](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterPasswordConnect.ts#L377) +[src/platform/errors/errorHandler.ts#L181](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/errorHandler.ts#L181) +```typescript + ConfigurationTarget.Workspace + ); + } else if (value === closeOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageClose); + } + }); + return KernelInterpreterDependencyResponse.failed; +``` + + +[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L397](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L397) ```typescript ); return this.fetchFunction(url, this.addAllowUnauthorized(url, true, options)); @@ -3649,19 +3935,31 @@ No properties for event ## Locations Used -[src/client/datascience/interactive-common/notebookServerProvider.ts#L143](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-common/notebookServerProvider.ts#L143) +[src/platform/errors/errorHandler.ts#L68](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/errorHandler.ts#L68) +```typescript + .showErrorMessage(DataScience.jupyterSelfCertFail().format(err.message), enableOption, closeOption) + .then((value) => { + if (value === enableOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); + void this.configuration.updateSetting( + 'allowUnauthorizedRemoteConnection', + true, +``` + + +[src/platform/errors/errorHandler.ts#L173](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/errorHandler.ts#L173) ```typescript - ) - .then((value) => { - if (value === enableOption) { - sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); - this.configuration - .updateSetting( - 'allowUnauthorizedRemoteConnection', + .showErrorMessage(DataScience.jupyterSelfCertFail().format(err.message), enableOption, closeOption) + .then((value) => { + if (value === enableOption) { + sendTelemetryEvent(Telemetry.SelfCertsMessageEnabled); + void this.configuration.updateSetting( + 'allowUnauthorizedRemoteConnection', + true, ``` -[src/client/datascience/jupyter/jupyterPasswordConnect.ts#L368](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterPasswordConnect.ts#L368) +[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L388](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L388) ```typescript closeOption ); @@ -3689,15 +3987,15 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/serverSelector.ts#L68](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/serverSelector.ts#L68) +[src/kernels/jupyter/serverSelector.ts#L69](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts#L69) ```typescript const multiStep = this.multiStepFactory.create<{}>(); return multiStep.run(this.startSelectingURI.bind(this, allowLocal), {}); } @captureTelemetry(Telemetry.SetJupyterURIToLocal) public async setJupyterURIToLocal(): Promise { - const previousValue = await this.serverUriStorage.getUri(); await this.serverUriStorage.setUri(Settings.JupyterServerLocalLaunch); + } ``` @@ -3719,7 +4017,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/serverSelector.ts#L62](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/serverSelector.ts#L62) +[src/kernels/jupyter/serverSelector.ts#L63](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts#L63) ```typescript allowLocal: boolean, commandSource: SelectJupyterUriCommandSource = 'nonUser' @@ -3741,12 +4039,12 @@ No description provided ## Properties -- +- azure: boolean; ## Locations Used -[src/client/datascience/jupyter/serverSelector.ts#L86](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/serverSelector.ts#L86) +[src/kernels/jupyter/serverSelector.ts#L78](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/serverSelector.ts#L78) ```typescript await this.serverUriStorage.setUri(userURI); @@ -3754,7 +4052,7 @@ No description provided sendTelemetryEvent(Telemetry.SetJupyterURIToUserSpecified, undefined, { azure: userURI.toLowerCase().includes('azure') }); - + } ``` @@ -3773,7 +4071,7 @@ No description provided ## Locations Used -[src/client/datascience/data-viewing/dataViewer.ts#L226](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewer.ts#L226) +[src/platform/datascience/data-viewing/dataViewer.ts#L233](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewer.ts#L233) ```typescript // Log telemetry about number of rows @@ -3785,7 +4083,7 @@ No description provided ``` -[src/client/datascience/data-viewing/dataViewer.ts#L308](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewer.ts#L308) +[src/platform/datascience/data-viewing/dataViewer.ts#L316](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewer.ts#L316) ```typescript private sendElapsedTimeTelemetry() { @@ -3813,7 +4111,7 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewerFactory.ts#L41](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewerFactory.ts#L41) +[src/platform/datascience/data-viewing/dataViewerFactory.ts#L41](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewerFactory.ts#L41) ```typescript } } @@ -3879,39 +4177,39 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L193](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L193) +[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L208](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L208) ```typescript - } + } - case DataScience.selectDifferentJupyterInterpreter(): { - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.selectAnotherInterpreter; - } + case DataScience.selectDifferentJupyterInterpreter(): { + sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); + return JupyterInterpreterDependencyResponse.selectAnotherInterpreter; + } ``` -[src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L199](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L199) +[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L214](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L214) ```typescript - case DataScience.pythonInteractiveHelpLink(): { - this.applicationShell.openUrl(HelpLinks.PythonInteractiveHelpLink); - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.cancel; - } + case DataScience.pythonInteractiveHelpLink(): { + this.applicationShell.openUrl(HelpLinks.PythonInteractiveHelpLink); + sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); + return JupyterInterpreterDependencyResponse.cancel; + } ``` -[src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L204](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L204) +[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L219](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L219) ```typescript - } + } - default: - sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); - return JupyterInterpreterDependencyResponse.cancel; - } - } + default: + sendTelemetryEvent(Telemetry.UserDidNotInstallJupyter); + return JupyterInterpreterDependencyResponse.cancel; + } + } finally { ``` @@ -3931,7 +4229,7 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewerDependencyService.ts#L108](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewerDependencyService.ts#L108) +[src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L108](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L108) ```typescript sendTelemetryEvent(Telemetry.UserInstalledPandas); } @@ -3959,15 +4257,15 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L186](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L186) +[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L201](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L201) ```typescript - return JupyterInterpreterDependencyResponse.cancel; + return JupyterInterpreterDependencyResponse.cancel; + } } - } - sendTelemetryEvent(Telemetry.UserInstalledJupyter); + sendTelemetryEvent(Telemetry.UserInstalledJupyter); - // Check if kernelspec module is something that accessible. - return this.checkKernelSpecAvailability(interpreter); + // Check if kernelspec module is something that accessible. + return this.checkKernelSpecAvailability(interpreter); ``` @@ -4011,7 +4309,7 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewerDependencyService.ts#L105](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewerDependencyService.ts#L105) +[src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L105](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L105) ```typescript cancellatonPromise ]); @@ -4022,6 +4320,35 @@ No properties for event sendTelemetryEvent(Telemetry.UserDidNotInstallPandas); ``` + +
+ DATASCIENCE.USER_STARTUP_CODE_FAILURE + +## Description + + +No description provided + +## Properties + +- + ename: string; +- + evalue: string; + +## Locations Used + +[src/kernels/kernel.ts#L566](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.ts#L566) +```typescript + await this.executeSilently(notebook, this.getUserStartupCommands(), { + traceErrors: true, + traceErrorsMessage: 'Error executing user defined startup code', + telemetryName: Telemetry.UserStartupCodeFailure + }); + } + +``` +
DATASCIENCE.VARIABLE_EXPLORER_TOGGLE @@ -4147,7 +4474,7 @@ No description provided ## Properties -- +- /** * Whether this is the first time in the session. * (fetching kernels first time in the session is slower, later its cached). @@ -4157,15 +4484,15 @@ No description provided ## Locations Used -[src/client/api/pythonApi.ts#L364](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/api/pythonApi.ts#L364) +[src/platform/api/pythonApi.ts#L289](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts#L289) ```typescript + } } - private workspaceCachedActiveInterpreter = new Map>(); @captureTelemetry(Telemetry.ActiveInterpreterListingPerf) + @traceDecorators.verbose('Get Active Interpreter', TraceOptions.Arguments | TraceOptions.BeforeCall) public getActiveInterpreter(resource?: Uri): Promise { this.hookupOnDidChangeInterpreterEvent(); - const workspaceId = this.workspace.getWorkspaceFolderIdentifier(resource); ```
@@ -4223,7 +4550,7 @@ No properties for event ## Locations Used -[src/client/datascience/editor-integration/codelensprovider.ts#L54](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codelensprovider.ts#L54) +[src/interactive-window/editor-integration/codelensprovider.ts#L60](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codelensprovider.ts#L60) ```typescript // On shutdown send how long on average we spent parsing code lens if (this.totalGetCodeLensCalls > 0) { @@ -4253,7 +4580,7 @@ No properties for event ## Locations Used -[src/client/common/application/commandManager.ts#L37](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/application/commandManager.ts#L37) +[src/platform/common/application/commandManager.ts#L37](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts#L37) ```typescript return commands.registerCommand( command, @@ -4265,7 +4592,7 @@ No properties for event ``` -[src/client/common/application/commandManager.ts#L71](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/application/commandManager.ts#L71) +[src/platform/common/application/commandManager.ts#L71](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts#L71) ```typescript return commands.registerTextEditorCommand( command, @@ -4277,10 +4604,10 @@ No properties for event ``` -[src/client/common/application/commandManager.ts#L102](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/application/commandManager.ts#L102) +[src/platform/common/application/commandManager.ts#L102](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/application/commandManager.ts#L102) ```typescript U extends ICommandNameArgumentTypeMapping[E] - >(command: E, ...rest: U): Thenable { + >(command: E, ...rest: U): Thenable { if (!commandsToIgnore.has(command)) { sendTelemetryEvent(Telemetry.CommandExecuted, undefined, { command: command as string }); } @@ -4355,14 +4682,14 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterExecution.ts#L204](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterExecution.ts#L204) +[src/kernels/jupyter/launcher/jupyterExecution.ts#L178](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts#L178) ```typescript ); } } else { sendTelemetryEvent(Telemetry.ConnectFailedJupyter, undefined, undefined, err, true); throw WrappedError.from( - localize.DataScience.jupyterNotebookConnectFailed().format(connection.baseUrl, err), + DataScience.jupyterNotebookConnectFailed().format(connection.baseUrl, err), err ``` @@ -4383,9 +4710,9 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterExecution.ts#L161](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterExecution.ts#L161) +[src/kernels/jupyter/launcher/jupyterExecution.ts#L139](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts#L139) ```typescript - traceInfo(`Connection complete for ${options ? options.purpose : 'unknown type of'} server`); + traceInfo(`Connection complete server`); sendTelemetryEvent( isLocalConnection ? Telemetry.ConnectLocalJupyter : Telemetry.ConnectRemoteJupyter @@ -4411,7 +4738,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterExecution.ts#L188](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterExecution.ts#L188) +[src/kernels/jupyter/launcher/jupyterExecution.ts#L165](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts#L165) ```typescript // Something else went wrong @@ -4439,9 +4766,9 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterExecution.ts#L161](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterExecution.ts#L161) +[src/kernels/jupyter/launcher/jupyterExecution.ts#L139](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts#L139) ```typescript - traceInfo(`Connection complete for ${options ? options.purpose : 'unknown type of'} server`); + traceInfo(`Connection complete server`); sendTelemetryEvent( isLocalConnection ? Telemetry.ConnectLocalJupyter : Telemetry.ConnectRemoteJupyter @@ -4469,7 +4796,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterExecution.ts#L142](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterExecution.ts#L142) +[src/kernels/jupyter/launcher/jupyterExecution.ts#L128](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts#L128) ```typescript connection = await this.startOrConnect(options, cancelToken); @@ -4497,7 +4824,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterExecution.ts#L192](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterExecution.ts#L192) +[src/kernels/jupyter/launcher/jupyterExecution.ts#L169](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts#L169) ```typescript // Check for the self signed certs error specifically @@ -4521,7 +4848,7 @@ No properties for event ## Properties -- +- /** * Indicates whether the python extension is installed. * If we send telemetry fro this & this is `true`, then we have a bug. @@ -4531,7 +4858,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/liveshare/hostRawNotebookProvider.ts#L86](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/liveshare/hostRawNotebookProvider.ts#L86) +[src/kernels/raw/session/hostRawNotebookProvider.ts#L115](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/hostRawNotebookProvider.ts#L115) ```typescript kernelConnection.kind === 'startUsingLocalKernelSpec' ) { @@ -4562,19 +4889,19 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/cellExecution.ts#L419](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/cellExecution.ts#L419) +[src/notebooks/execution/cellExecution.ts#L435](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/cellExecution.ts#L435) ```typescript const props = { notebook: true }; if (!CellExecution.sentExecuteCellTelemetry) { CellExecution.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatch.elapsedTime, props); + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props); } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatch.elapsedTime, props); + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatchForTelemetry.elapsedTime, props); } ``` -[src/client/datascience/editor-integration/codewatcher.ts#L1026](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L1026) +[src/interactive-window/editor-integration/codewatcher.ts#L1064](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L1064) ```typescript if (runningStopWatch) { if (!CodeWatcher.sentExecuteCellTelemetry) { @@ -4605,19 +4932,19 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/cellExecution.ts#L421](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/cellExecution.ts#L421) +[src/notebooks/execution/cellExecution.ts#L437](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/cellExecution.ts#L437) ```typescript CellExecution.sentExecuteCellTelemetry = true; - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatch.elapsedTime, props); + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, this.stopWatchForTelemetry.elapsedTime, props); } else { - sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatch.elapsedTime, props); + sendTelemetryEvent(Telemetry.ExecuteCellPerceivedWarm, this.stopWatchForTelemetry.elapsedTime, props); } } private canExecuteCell() { ``` -[src/client/datascience/editor-integration/codewatcher.ts#L1028](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/codewatcher.ts#L1028) +[src/interactive-window/editor-integration/codewatcher.ts#L1066](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/codewatcher.ts#L1066) ```typescript CodeWatcher.sentExecuteCellTelemetry = true; sendTelemetryEvent(Telemetry.ExecuteCellPerceivedCold, runningStopWatch.elapsedTime); @@ -4645,7 +4972,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/jupyterKernelService.ts#L170](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/jupyterKernelService.ts#L170) +[src/kernels/jupyter/jupyterKernelService.ts#L203](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.ts#L203) ```typescript await this.fs.writeLocalFile(kernelSpecFilePath, JSON.stringify(contents, undefined, 4)); } catch (ex) { @@ -4653,11 +4980,11 @@ No properties for event sendTelemetryEvent(Telemetry.FailedToUpdateKernelSpec, undefined, undefined, ex as any, true); throw ex; } - if (cancelToken?.isCancellationRequested) { + if (cancelToken.isCancellationRequested) { ``` -[src/client/datascience/jupyter/kernels/jupyterKernelService.ts#L269](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/jupyterKernelService.ts#L269) +[src/kernels/jupyter/jupyterKernelService.ts#L343](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.ts#L343) ```typescript await this.fs.writeLocalFile(kernelSpecFilePath, JSON.stringify(specModel, undefined, 2)); } catch (ex) { @@ -4751,15 +5078,87 @@ No properties for event ## Locations Used -[src/client/api/pythonApi.ts#L306](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/api/pythonApi.ts#L306) +[src/platform/common/process/environmentActivationService.ts#L239](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.ts#L239) ```typescript - .then((api) => api.getActivatedEnvironmentVariables(resource, interpreter, false)); + ]); - const envType = interpreter?.envType; + const envType = interpreter.envType; sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { envType, - failed: Object.keys(env || {}).length === 0 - }); + pythonEnvType: envType, + source: 'python', +``` + + +[src/platform/common/process/environmentActivationService.ts#L291](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.ts#L291) +```typescript + interpreter?.path + )}, shell cannot be determined.` + ); + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, 0, { + envType, + pythonEnvType: envType, + source: 'jupyter', +``` + + +[src/platform/common/process/environmentActivationService.ts#L334](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.ts#L334) +```typescript + const stopWatch = new StopWatch(); + try { + const env = await this.getCondaEnvVariables(resource, interpreter); + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, + source: 'jupyter', +``` + + +[src/platform/common/process/environmentActivationService.ts#L343](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.ts#L343) +```typescript + }); + return env; + } catch (ex) { + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, + source: 'jupyter', +``` + + +[src/platform/common/process/environmentActivationService.ts#L387](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.ts#L387) +```typescript + const processService = await processServicePromise; + const hasCustomEnvVars = Object.keys(customEnvVars).length; + if (!activationCommands || activationCommands.length === 0) { + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, + source: 'jupyter', +``` + + +[src/platform/common/process/environmentActivationService.ts#L479](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.ts#L479) +```typescript + } else if (returnedEnv) { + delete returnedEnv[PYTHON_WARNINGS]; + } + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, + source: 'jupyter', +``` + + +[src/platform/common/process/environmentActivationService.ts#L489](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/environmentActivationService.ts#L489) +```typescript + + return returnedEnv; + } catch (e) { + sendTelemetryEvent(Telemetry.GetActivatedEnvironmentVariables, stopWatch.elapsedTime, { + envType, + pythonEnvType: envType, + source: 'jupyter', ``` @@ -4779,7 +5178,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterPasswordConnect.ts#L252](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterPasswordConnect.ts#L252) +[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L258](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L258) ```typescript const requestHeaders = { Cookie: cookieString, 'X-XSRFToken': xsrfCookie }; return { requestHeaders }; @@ -4807,7 +5206,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterPasswordConnect.ts#L247](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterPasswordConnect.ts#L247) +[src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L253](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts#L253) ```typescript // If we found everything return it all back if not, undefined as partial is useless @@ -4869,43 +5268,43 @@ No description provided ## Properties -- +- /** * Hash of the cell output mimetype * * @type {string} */ hashedName: string; -- +- hasText: boolean; -- +- hasLatex: boolean; -- +- hasHtml: boolean; -- +- hasSvg: boolean; -- +- hasXml: boolean; -- +- hasJson: boolean; -- +- hasImage: boolean; -- +- hasGeo: boolean; -- +- hasPlotly: boolean; -- +- hasVega: boolean; -- +- hasWidget: boolean; -- +- hasJupyter: boolean; -- +- hasVnd: boolean; ## Locations Used -[src/client/datascience/jupyter/jupyterCellOutputMimeTypeTracker.ts#L153](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterCellOutputMimeTypeTracker.ts#L153) +[src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.ts#L154](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.ts#L154) ```typescript hasJupyter: lowerMimeType.includes('jupyter'), hasVnd: lowerMimeType.includes('vnd') @@ -4933,7 +5332,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterCellOutputMimeTypeTracker.ts#L119](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterCellOutputMimeTypeTracker.ts#L119) +[src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.ts#L120](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.ts#L120) ```typescript this.pendingChecks.set(id, setTimeout(check, 5000)); } @@ -4975,13 +5374,13 @@ Event can be removed. Not referenced anywhere ## Properties -- +- // Result is null if user signalled cancellation or if we timed out isResultNull: boolean; ## Locations Used -[src/client/datascience/editor-integration/hoverProvider.ts#L79](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/editor-integration/hoverProvider.ts#L79) +[src/interactive-window/editor-integration/hoverProvider.ts#L79](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/editor-integration/hoverProvider.ts#L79) ```typescript const timeoutHandler = sleep(300).then(() => undefined); this.stopWatch.reset(); @@ -5011,15 +5410,15 @@ No properties for event ## Locations Used -[src/client/api/pythonApi.ts#L353](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/api/pythonApi.ts#L353) +[src/platform/api/pythonApi.ts#L267](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts#L267) ```typescript return this.didChangeInterpreters.event; } @captureTelemetry(Telemetry.InterpreterListingPerf) + @traceDecorators.verbose('Get Interpreters', TraceOptions.Arguments | TraceOptions.BeforeCall) public getInterpreters(resource?: Uri): Promise { this.hookupOnDidChangeInterpreterEvent(); - // Cache result as it only changes when the interpreter list changes or we add more workspace folders ``` @@ -5039,7 +5438,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/kernelExecution.ts#L178](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelExecution.ts#L178) +[src/notebooks/execution/kernelExecution.ts#L195](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts#L195) ```typescript return newCellExecutionQueue; } @@ -5071,10 +5470,10 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterInvalidKernelError.ts#L19](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterInvalidKernelError.ts#L19) +[src/platform/errors/jupyterInvalidKernelError.ts#L18](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/jupyterInvalidKernelError.ts#L18) ```typescript - getDisplayNameOrNameOfKernelConnection(kernelConnectionMetadata) - ) + DataScience.kernelInvalid().format(getDisplayNameOrNameOfKernelConnection(kernelConnectionMetadata)), + kernelConnectionMetadata ); sendTelemetryEvent(Telemetry.KernelInvalid); } @@ -5122,7 +5521,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/ipyWidgetScriptSource.ts#L221](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/ipyWidgetScriptSource.ts#L221) +[src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSource.ts#L220](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSource.ts#L220) ```typescript widgetSource = await this.scriptProvider.getWidgetScriptSource(moduleName, moduleVersion); } catch (ex) { @@ -5173,7 +5572,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L163](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L163) +[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L164](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L164) ```typescript } traceError(`Widget load failure ${errorMessage}`, payload); @@ -5203,7 +5602,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L123](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L123) +[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L123](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L123) ```typescript private sendLoadSucceededTelemetry(payload: LoadIPyWidgetClassLoadAction) { @@ -5233,7 +5632,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/ipyWidgetMessageDispatcher.ts#L494](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/ipyWidgetMessageDispatcher.ts#L494) +[src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcher.ts#L497](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcher.ts#L497) ```typescript } @@ -5264,7 +5663,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/ipyWidgetScriptSourceProvider.ts#L205](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/ipyWidgetScriptSourceProvider.ts#L205) +[src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts#L211](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts#L211) ```typescript return this.configurationPromise.promise; } @@ -5294,7 +5693,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/ipyWidgetScriptSourceProvider.ts#L235](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/ipyWidgetScriptSourceProvider.ts#L235) +[src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts#L241](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts#L241) ```typescript break; } @@ -5324,7 +5723,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L186](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L186) +[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L187](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L187) ```typescript private sendRenderFailureTelemetry(payload: Error) { try { @@ -5376,7 +5775,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/localWidgetScriptSourceProvider.ts#L54](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/localWidgetScriptSourceProvider.ts#L54) +[src/kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider.ts#L53](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider.ts#L53) ```typescript } return (this.cachedWidgetScripts = this.getWidgetScriptSourcesWithoutCache()); @@ -5406,10 +5805,10 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L205](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L205) +[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L206](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L206) ```typescript this.jupyterOutput.appendLine( - localize.DataScience.unhandledMessage().format(msg.header.msg_type, JSON.stringify(msg.content)) + DataScience.unhandledMessage().format(msg.header.msg_type, JSON.stringify(msg.content)) ); sendTelemetryEvent(Telemetry.IPyWidgetUnhandledMessage, undefined, { msg_type: msg.header.msg_type }); } catch { @@ -5436,7 +5835,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/ipyWidgetScriptSourceProvider.ts#L108](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/ipyWidgetScriptSourceProvider.ts#L108) +[src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts#L107](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts#L107) ```typescript } } @@ -5466,7 +5865,7 @@ No properties for event ## Locations Used -[src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L175](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/ipywidgets/commonMessageCoordinator.ts#L175) +[src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L176](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts#L176) ```typescript } private sendUnsupportedWidgetVersionFailureTelemetry(payload: NotifyIPyWidgeWidgetVersionNotSupportedAction) { @@ -5494,11 +5893,11 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/liveshare/hostJupyterServer.ts#L230](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts#L230) +[src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts#L194](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts#L194) ```typescript - ); - const baseUrl = this.launchInfo?.connectionInfo.baseUrl || ''; - this.logRemoteOutput(localize.DataScience.createdNewNotebook().format(baseUrl)); + this.throwIfDisposedOrCancelled(cancelToken); + const baseUrl = this.connection?.baseUrl || ''; + this.logRemoteOutput(DataScience.createdNewNotebook().format(baseUrl)); sendKernelTelemetryEvent(resource, Telemetry.JupyterCreatingNotebook, stopWatch.elapsedTime); return notebook; } catch (ex) { @@ -5506,7 +5905,7 @@ No properties for event ``` -[src/client/datascience/jupyter/liveshare/hostJupyterServer.ts#L235](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/liveshare/hostJupyterServer.ts#L235) +[src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts#L199](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts#L199) ```typescript } catch (ex) { sendKernelTelemetryEvent( @@ -5538,7 +5937,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/commandLineSelector.ts#L93](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/commandLineSelector.ts#L93) +[src/kernels/jupyter/launcher/commandLineSelector.ts#L93](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/commandLineSelector.ts#L93) ```typescript private async setJupyterCommandLine(val: string): Promise { @@ -5566,11 +5965,11 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterWaitForIdleError.ts#L12](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterWaitForIdleError.ts#L12) +[src/platform/errors/jupyterWaitForIdleError.ts#L14](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/errors/jupyterWaitForIdleError.ts#L14) ```typescript -export class JupyterWaitForIdleError extends BaseError { - constructor(message: string) { - super('timeout', message); +export class JupyterWaitForIdleError extends BaseKernelError { + constructor(kernelConnectionMetadata: KernelConnectionMetadata) { + super('timeout', DataScience.jupyterLaunchTimedOut(), kernelConnectionMetadata); sendTelemetryEvent(Telemetry.SessionIdleTimeout); } } @@ -5623,7 +6022,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L310](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L310) +[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L329](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L329) ```typescript return JupyterInterpreterDependencyResponse.ok; } @@ -5651,15 +6050,15 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/jupyterKernelService.ts#L121](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/jupyterKernelService.ts#L121) +[src/kernels/jupyter/jupyterKernelService.ts#L149](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.ts#L149) ```typescript */ // eslint-disable-next-line // eslint-disable-next-line complexity @captureTelemetry(Telemetry.RegisterInterpreterAsKernel, undefined, true) @traceDecorators.error('Failed to register an interpreter as a kernel') - @reportAction(ReportableAction.KernelsRegisterKernel) // eslint-disable-next-line + private async registerKernel( ``` @@ -5673,7 +6072,7 @@ No description provided ## Properties -- +- /** * Total time spent in attempting to start and connect to jupyter before giving up. * @@ -5683,16 +6082,7 @@ No description provided ## Locations Used -[src/client/datascience/jupyter/jupyterExecution.ts#L221](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterExecution.ts#L221) -```typescript - // If we're here, then starting jupyter timeout. - // Kill any existing connections. - connection?.dispose(); - sendTelemetryEvent(Telemetry.JupyterStartTimeout, stopWatch.elapsedTime, { - timeout: stopWatch.elapsedTime - }); - if (allowUI) { -``` +Event can be removed. Not referenced anywhere
@@ -5711,15 +6101,15 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterExecution.ts#L283](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterExecution.ts#L283) +[src/kernels/jupyter/launcher/jupyterExecution.ts#L241](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/jupyterExecution.ts#L241) ```typescript } // eslint-disable-next-line @captureTelemetry(Telemetry.StartJupyter) private async startNotebookServer( + resource: Resource, useDefaultConfig: boolean, - customCommandLine: string[], ```
@@ -5740,7 +6130,7 @@ No properties for event ## Locations Used -[src/client/datascience/telemetry/kernelTelemetry.ts#L53](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/telemetry/kernelTelemetry.ts#L53) +[src/telemetry/kernelTelemetry.ts#L53](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/kernelTelemetry.ts#L53) ```typescript }); trackKernelResourceInformation(resource, counters); @@ -5794,11 +6184,11 @@ No properties for event ## Locations Used -[src/client/datascience/kernel-launcher/localKernelFinder.ts#L52](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/localKernelFinder.ts#L52) +[src/kernels/raw/finder/localKernelFinder.ts#L55](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKernelFinder.ts#L55) ```typescript @inject(IFileSystem) private readonly fs: IFileSystem ) {} - @traceDecorators.verbose('Find kernel spec') + @traceDecorators.verbose('Find kernel spec', TraceOptions.BeforeCall | TraceOptions.Arguments) @captureTelemetry(Telemetry.KernelFinderPerf) public async findKernel( resource: Resource, @@ -5806,7 +6196,7 @@ No properties for event ``` -[src/client/datascience/kernel-launcher/remoteKernelFinder.ts#L56](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/remoteKernelFinder.ts#L56) +[src/kernels/raw/finder/remoteKernelFinder.ts#L60](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/remoteKernelFinder.ts#L60) ```typescript ); } @@ -5836,7 +6226,7 @@ No properties for event ## Locations Used -[src/client/datascience/kernel-launcher/kernelLauncher.ts#L118](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/kernelLauncher.ts#L118) +[src/kernels/raw/launcher/kernelLauncher.ts#L113](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelLauncher.ts#L113) ```typescript // Should be available now, wait with a timeout return await this.launchProcess(kernelConnectionMetadata, resource, workingDirectory, timeout, cancelToken); @@ -5858,14 +6248,14 @@ No description provided ## Properties -- +- /** * Whether this is the first time in the session. * (fetching kernels first time in the session is slower, later its cached). * This is a generic property supported for all telemetry (sent by decorators). */ firstTime?: boolean; -- +- /** * Whether this telemetry is for listing of all kernels or just python or just non-python. * (fetching kernels first time in the session is slower, later its cached). @@ -5874,7 +6264,7 @@ No description provided ## Locations Used -[src/client/datascience/kernel-launcher/localKnownPathKernelSpecFinder.ts#L64](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/localKnownPathKernelSpecFinder.ts#L64) +[src/kernels/raw/finder/localKnownPathKernelSpecFinder.ts#L45](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKnownPathKernelSpecFinder.ts#L45) ```typescript /** * @param {boolean} includePythonKernels Include/exclude Python kernels in the result. @@ -5886,10 +6276,10 @@ No description provided ``` -[src/client/datascience/kernel-launcher/localPythonAndRelatedNonPythonKernelSpecFinder.ts#L50](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/localPythonAndRelatedNonPythonKernelSpecFinder.ts#L50) +[src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.ts#L74](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.ts#L74) ```typescript ) { - super(fs, workspaceService, extensionChecker); + super(fs, workspaceService, extensionChecker, globalState); } @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'localPython' }) public async listKernelSpecs(resource: Resource, ignoreCache?: boolean, cancelToken?: CancellationToken) { @@ -5898,9 +6288,9 @@ No description provided ``` -[src/client/datascience/kernel-launcher/localKernelFinder.ts#L153](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/localKernelFinder.ts#L153) +[src/kernels/raw/finder/localKernelFinder.ts#L191](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKernelFinder.ts#L191) ```typescript - return this.jupyterPaths.getKernelSpecRootPath(); + return preferredKernel; } @captureTelemetry(Telemetry.KernelListingPerf, { kind: 'local' }) @@ -5910,7 +6300,7 @@ No description provided ``` -[src/client/datascience/kernel-launcher/remoteKernelFinder.ts#L57](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/remoteKernelFinder.ts#L57) +[src/kernels/raw/finder/remoteKernelFinder.ts#L61](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/remoteKernelFinder.ts#L61) ```typescript } @traceDecorators.verbose('Find remote kernel spec') @@ -5932,7 +6322,7 @@ No description provided ## Properties -- +- action: 'displayed'; - // Message displayed. /** @@ -6011,7 +6401,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L286](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L286) +[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L305](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L305) ```typescript .then(() => true) .catch((e) => { @@ -6033,7 +6423,7 @@ No description provided ## Properties -- +- /** * Number of kernel specs. */ @@ -6061,7 +6451,7 @@ No properties for event ## Locations Used -[src/client/datascience/variablesView/variableView.ts#L89](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/variablesView/variableView.ts#L89) +[src/platform/datascience/variablesView/variableView.ts#L84](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/variablesView/variableView.ts#L84) ```typescript this.dataViewerChecker = new DataViewerChecker(configuration, appShell); } @@ -6089,7 +6479,7 @@ No properties for event ## Locations Used -[src/client/datascience/variablesView/variableView.ts#L148](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/variablesView/variableView.ts#L148) +[src/platform/datascience/variablesView/variableView.ts#L143](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/variablesView/variableView.ts#L143) ```typescript // I've we've been made visible, make sure that we are updated @@ -6115,7 +6505,7 @@ No description provided ## Locations Used -[src/client/datascience/interactive-common/notebookUsageTracker.ts#L54](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-common/notebookUsageTracker.ts#L54) +[src/notebooks/notebookUsageTracker.ts#L45](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookUsageTracker.ts#L45) ```typescript public dispose() { // Send a bunch of telemetry @@ -6160,7 +6550,7 @@ No description provided ## Locations Used -[src/client/datascience/interactive-common/notebookUsageTracker.ts#L57](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-common/notebookUsageTracker.ts#L57) +[src/notebooks/notebookUsageTracker.ts#L48](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/notebookUsageTracker.ts#L48) ```typescript sendTelemetryEvent(Telemetry.NotebookOpenCount, undefined, { count: this.openedNotebookCount }); } @@ -6192,32 +6582,6 @@ No properties for event Event can be removed. Not referenced anywhere - -
- DS_INTERNAL.NATIVE.WORKSPACE_NOTEBOOK_COUNT - -## Description - - -No description provided - -## Properties - -- count: number - -## Locations Used - -[src/client/datascience/interactive-common/notebookUsageTracker.ts#L62](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/interactive-common/notebookUsageTracker.ts#L62) -```typescript - }); - } - if (this.notebookCount) { - sendTelemetryEvent(Telemetry.NotebookWorkspaceCount, undefined, { count: this.notebookCount }); - } - } - private onEditorOpened(doc: NotebookDocument): void { -``` -
DS_INTERNAL.NEW_FILE_USED_IN_INTERACTIVE @@ -6259,7 +6623,7 @@ Event can be removed. Not referenced anywhere ## Locations Used -[src/client/datascience/notebookStorage/preferredRemoteKernelIdProvider.ts#L59](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebookStorage/preferredRemoteKernelIdProvider.ts#L59) +[src/kernels/raw/finder/preferredRemoteKernelIdProvider.ts#L59](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/preferredRemoteKernelIdProvider.ts#L59) ```typescript } @@ -6289,7 +6653,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/kernel.ts#L286](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernel.ts#L286) +[src/kernels/kernel.ts#L349](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.ts#L349) ```typescript // Setup telemetry if (!this.perceivedJupyterStartupTelemetryCaptured) { @@ -6301,15 +6665,15 @@ No properties for event ``` -[src/client/datascience/jupyter/kernels/kernel.ts#L338](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernel.ts#L338) +[src/kernels/kernel.ts#L438](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.ts#L438) ```typescript - } - sendKernelTelemetryEvent( - this.resourceUri, - Telemetry.PerceivedJupyterStartupNotebook, - stopWatch.elapsedTime - ); - if (this.notebook?.connection) { + + sendKernelTelemetryEvent( + this.resourceUri, + Telemetry.PerceivedJupyterStartupNotebook, + stopWatch.elapsedTime + ); + this.notebook = notebook; ```
@@ -6331,11 +6695,11 @@ No properties for event ## Locations Used -[src/client/datascience/kernel-launcher/localKernelFinder.ts#L82](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/localKernelFinder.ts#L82) +[src/kernels/raw/finder/localKernelFinder.ts#L92](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKernelFinder.ts#L92) ```typescript - preferredInterpreter, - undefined - ); + + // Find the preferred kernel index from the list. + const preferred = findPreferredKernel(kernels, resource, notebookMetadata, preferredInterpreter, undefined); sendTelemetryEvent(Telemetry.PreferredKernel, undefined, { result: preferred ? 'found' : 'notfound', resourceType, @@ -6343,7 +6707,7 @@ No properties for event ``` -[src/client/datascience/kernel-launcher/localKernelFinder.ts#L94](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/localKernelFinder.ts#L94) +[src/kernels/raw/finder/localKernelFinder.ts#L104](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/localKernelFinder.ts#L104) ```typescript } } catch (ex) { @@ -6355,7 +6719,7 @@ No properties for event ``` -[src/client/datascience/kernel-launcher/remoteKernelFinder.ts#L82](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/remoteKernelFinder.ts#L82) +[src/kernels/raw/finder/remoteKernelFinder.ts#L85](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/remoteKernelFinder.ts#L85) ```typescript undefined, this.preferredRemoteKernelIdProvider @@ -6367,7 +6731,7 @@ No properties for event ``` -[src/client/datascience/kernel-launcher/remoteKernelFinder.ts#L90](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/remoteKernelFinder.ts#L90) +[src/kernels/raw/finder/remoteKernelFinder.ts#L93](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/finder/remoteKernelFinder.ts#L93) ```typescript return preferred; } catch (ex) { @@ -6389,7 +6753,7 @@ No description provided ## Properties -- +- action: | 'displayed' // Message displayed. | 'dismissed' // user dismissed the message. @@ -6397,22 +6761,22 @@ No description provided ## Locations Used -[src/client/api/pythonApi.ts#L171](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/api/pythonApi.ts#L171) +[src/platform/api/pythonApi.ts#L169](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts#L169) ```typescript // Ask user if they want to install and then wait for them to actually install it. const yes = localize.Common.bannerLabelYes(); const no = localize.Common.bannerLabelNo(); sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); - const answer = await this.appShell.showErrorMessage(localize.DataScience.pythonExtensionRequired(), yes, no); - if (answer === yes) { - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); + const answer = await this.appShell.showInformationMessage( + localize.DataScience.pythonExtensionRequired(), + { modal: true }, ``` -[src/client/api/pythonApi.ts#L174](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/api/pythonApi.ts#L174) +[src/platform/api/pythonApi.ts#L177](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts#L177) ```typescript - sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); - const answer = await this.appShell.showErrorMessage(localize.DataScience.pythonExtensionRequired(), yes, no); + no + ); if (answer === yes) { sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); await this.installPythonExtension(); @@ -6421,7 +6785,7 @@ No description provided ``` -[src/client/api/pythonApi.ts#L177](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/api/pythonApi.ts#L177) +[src/platform/api/pythonApi.ts#L180](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/api/pythonApi.ts#L180) ```typescript sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); await this.installPythonExtension(); @@ -6433,19 +6797,19 @@ No description provided ``` -[src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L63](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L63) +[src/notebooks/controllers/noPythonKernelsNotebookController.ts#L63](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts#L63) ```typescript } } private async handleExecutionWithoutPythonExtension() { sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'displayed' }); - const selection = await this.appShell.showErrorMessage( + const selection = await this.appShell.showInformationMessage( DataScience.pythonExtensionRequiredToRunNotebook(), { modal: true }, ``` -[src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L70](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L70) +[src/notebooks/controllers/noPythonKernelsNotebookController.ts#L70](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts#L70) ```typescript Common.install() ); @@ -6457,7 +6821,7 @@ No description provided ``` -[src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L73](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L73) +[src/notebooks/controllers/noPythonKernelsNotebookController.ts#L73](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts#L73) ```typescript sendTelemetryEvent(Telemetry.PythonExtensionNotInstalled, undefined, { action: 'download' }); this.commandManager.executeCommand('extension.open', PythonExtension).then(noop, noop); @@ -6489,7 +6853,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/helpers.ts#L792](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/helpers.ts#L792) +[src/kernels/helpers.ts#L1697](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.ts#L1697) ```typescript kernelConnection.interpreter.path.toLowerCase(), sysExecutable.toLowerCase() @@ -6501,7 +6865,7 @@ No properties for event ``` -[src/client/datascience/jupyter/kernels/helpers.ts#L817](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/helpers.ts#L817) +[src/kernels/helpers.ts#L1721](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.ts#L1721) ```typescript }); if (execOutput.stdout.trim().length > 0) { @@ -6523,16 +6887,17 @@ No description provided ## Properties -- +- moduleName: string; -- +- /** * Whether the module was already (once before) installed into the python environment or * whether this already exists (detected via `pip list`) */ isModulePresent?: 'true' | undefined; -- +- action: + | 'cancelled' // User cancelled the installation or closed the notebook or the like. | 'displayed' // Install prompt may have been displayed. | 'prompted' // Install prompt was displayed. | 'installed' // Installation disabled (this is what python extension returns). @@ -6543,158 +6908,162 @@ No description provided | 'donotinstall' // User chose not to install from prompt. | 'differentKernel' // User chose to select a different kernel. | 'error' // Some other error. + | 'installedInJupyter' // The package was successfully installed in Jupyter whilst failed to install in Python ext. + | 'failedToInstallInJupyter' // Failed to install the package in Jupyter as well as Python ext. | 'dismissed'; - // User chose to dismiss the prompt. resourceType?: 'notebook' | 'interactive'; -- +- /** * Hash of the resource (notebook.uri or pythonfile.uri associated with this). * If we run the same notebook tomorrow, the hash will be the same. */ resourceHash?: string; +- + pythonEnvType?: EnvironmentType; ## Locations Used -[src/client/api/pythonApi.ts#L283](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/api/pythonApi.ts#L283) +[src/kernels/installer/productInstaller.ts#L299](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/installer/productInstaller.ts#L299) ```typescript action = 'failed'; throw ex; } finally { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action, moduleName: ProductNames.get(product)! }); ``` -[src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L140](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L140) +[src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L152](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts#L152) ```typescript - } - - const message = getMessageForLibrariesNotInstalled(missingProducts, interpreter.displayName); - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { - action: 'displayed', - moduleName: ProductNames.get(Product.jupyter)! - }); + pipInstalledInNonCondaEnv === false ? [Product.pip].concat(missingProducts) : missingProducts, + interpreter.displayName + ); + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { + action: 'displayed', + moduleName: ProductNames.get(Product.jupyter)!, + pythonEnvType: interpreter.envType ``` -[src/client/datascience/data-viewing/dataViewerDependencyService.ts#L68](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewerDependencyService.ts#L68) +[src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L71](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L71) ```typescript - interpreter?: PythonEnvironment, - token?: CancellationToken + interpreter: PythonEnvironment, + tokenSource: CancellationTokenSource ): Promise { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'displayed', - moduleName: ProductNames.get(Product.pandas)! - }); + moduleName: ProductNames.get(Product.pandas)!, + pythonEnvType: interpreter?.envType ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L138](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L138) +[src/kernels/kernelDependencyService.ts#L212](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L212) ```typescript - const ipykernelProductName = ProductNames.get(Product.ipykernel)!; + const productNameForTelemetry = products.map((product) => ProductNames.get(product)!).join(', '); const resourceType = resource ? getResourceType(resource) : undefined; const resourceHash = resource ? getTelemetrySafeHashedString(resource.toString()) : undefined; - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'displayed', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L156](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L156) +[src/kernels/kernelDependencyService.ts#L230](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L230) ```typescript - const options = resource ? [installPrompt, selectKernel] : [installPrompt]; + const options = resource ? [Common.install(), selectKernel] : [Common.install()]; try { if (!this.isCodeSpace) { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'prompted', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L170](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L170) +[src/kernels/kernelDependencyService.ts#L246](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L246) ```typescript promptCancellationPromise ]); - if (installerToken.isCancellationRequested) { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + if (cancelTokenSource.token.isCancellationRequested) { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'dismissed', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L180](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L180) +[src/kernels/kernelDependencyService.ts#L256](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L256) ```typescript + return KernelInterpreterDependencyResponse.cancel; } - if (selection === selectKernel) { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'differentKernel', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L188](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L188) +[src/kernels/kernelDependencyService.ts#L265](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L265) ```typescript }); return KernelInterpreterDependencyResponse.selectDifferentKernel; - } else if (selection === installPrompt) { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + } else if (selection === Common.install()) { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'install', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L205](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L205) +[src/kernels/kernelDependencyService.ts#L289](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L289) ```typescript cancellationPromise ]); if (response === InstallerResponse.Installed) { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'installed', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L213](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L213) +[src/kernels/kernelDependencyService.ts#L298](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L298) ```typescript }); return KernelInterpreterDependencyResponse.ok; } else if (response === InstallerResponse.Ignore) { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'failed', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L223](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L223) +[src/kernels/kernelDependencyService.ts#L309](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L309) ```typescript } } - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'dismissed', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` -[src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L231](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelDependencyService.ts#L231) +[src/kernels/kernelDependencyService.ts#L319](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernelDependencyService.ts#L319) ```typescript - }); return KernelInterpreterDependencyResponse.cancel; } catch (ex) { - sendTelemetryEvent(Telemetry.PythonModuleInstal, undefined, { + traceError(`Failed to install ${productNameForTelemetry}`, ex); + sendTelemetryEvent(Telemetry.PythonModuleInstall, undefined, { action: 'error', - moduleName: ipykernelProductName, + moduleName: productNameForTelemetry, resourceType, ``` @@ -6709,7 +7078,7 @@ No description provided ## Properties -- +- action: | 'displayed' // Message displayed. | 'dismissed' // user dismissed the message. @@ -6717,7 +7086,7 @@ No description provided ## Locations Used -[src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L77](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L77) +[src/notebooks/controllers/noPythonKernelsNotebookController.ts#L77](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts#L77) ```typescript } } @@ -6729,7 +7098,7 @@ No description provided ``` -[src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L84](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L84) +[src/notebooks/controllers/noPythonKernelsNotebookController.ts#L84](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts#L84) ```typescript Common.install() ); @@ -6741,7 +7110,7 @@ No description provided ``` -[src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L87](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/noPythonKernelsNotebookController.ts#L87) +[src/notebooks/controllers/noPythonKernelsNotebookController.ts#L87](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/noPythonKernelsNotebookController.ts#L87) ```typescript sendTelemetryEvent(Telemetry.PythonNotInstalled, undefined, { action: 'download' }); this.appShell.openUrl('https://www.python.org/downloads'); @@ -6770,14 +7139,14 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawNotebookProvider.ts#L76](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawNotebookProvider.ts#L76) +[src/kernels/raw/session/hostRawNotebookProvider.ts#L93](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/hostRawNotebookProvider.ts#L93) ```typescript return this.rawNotebookSupportedService.isSupported; } @captureTelemetry(Telemetry.RawKernelCreatingNotebook, undefined, true) public async createNotebook( - document: NotebookDocument, + document: vscode.NotebookDocument, resource: Resource, ``` @@ -6803,10 +7172,10 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L296](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L296) +[src/kernels/raw/session/rawJupyterSession.ts#L349](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L349) ```typescript - continue; - } + } else { + traceWarning(`Didn't get response for requestKernelInfo after ${stopWatch.elapsedTime}ms.`); } sendTelemetryEvent(Telemetry.RawKernelInfoResonse, stopWatch.elapsedTime, { attempts, @@ -6831,13 +7200,13 @@ No properties for event ## Locations Used -[src/client/datascience/kernel-launcher/kernelProcess.ts#L102](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/kernelProcess.ts#L102) +[src/kernels/raw/launcher/kernelProcess.ts#L119](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelProcess.ts#L119) ```typescript } } @captureTelemetry(Telemetry.RawKernelProcessLaunch, undefined, true) - public async launch(workingDirectory: string, timeout: number, cancelToken?: CancellationToken): Promise { + public async launch(workingDirectory: string, timeout: number, cancelToken: CancellationToken): Promise { if (this.launchedOnce) { throw new Error('Kernel has already been launched.'); ``` @@ -6860,7 +7229,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L152](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L152) +[src/kernels/raw/session/rawJupyterSession.ts#L146](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L146) ```typescript throw error; } @@ -6890,7 +7259,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawSession.ts#L96](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawSession.ts#L96) +[src/kernels/raw/session/rawSession.ts#L95](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawSession.ts#L95) ```typescript public async dispose() { // We want to know who called dispose on us @@ -6921,10 +7290,10 @@ No properties for event ## Locations Used -[src/client/datascience/kernel-launcher/kernelLauncher.ts#L145](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/kernel-launcher/kernelLauncher.ts#L145) +[src/kernels/raw/launcher/kernelLauncher.ts#L213](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/launcher/kernelLauncher.ts#L213) ```typescript - kernelProcess.exited( + const disposable = kernelProcess.exited( ({ exitCode, reason }) => { sendTelemetryEvent(Telemetry.RawKernelSessionKernelProcessExited, undefined, { exitCode, @@ -6933,7 +7302,7 @@ No properties for event ``` -[src/client/datascience/raw-kernel/rawSession.ts#L251](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawSession.ts#L251) +[src/kernels/raw/session/rawSession.ts#L255](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawSession.ts#L255) ```typescript traceError(`Disposing session as kernel process died ExitCode: ${e.exitCode}, Reason: ${e.reason}`); // Send telemetry so we know why the kernel process exited, @@ -6945,7 +7314,7 @@ No properties for event ``` -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L197](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L197) +[src/kernels/raw/session/rawJupyterSession.ts#L190](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L190) ```typescript if (session !== this.session) { return; @@ -6973,15 +7342,15 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L125](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L125) +[src/kernels/helpers.ts#L1951](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/helpers.ts#L1951) ```typescript - undefined, - error - ); - sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartNoIpykernel, { - reason: error.reason - }); - traceError('Raw session failed to start because dependencies not installed'); + const isLocal = isLocalConnection(controller?.connection); + const rawLocalKernel = serviceContainer.get(IRawNotebookProvider).isSupported && isLocal; + if (rawLocalKernel && context === 'start') { + sendKernelTelemetryEvent(resource, Telemetry.RawKernelSessionStartNoIpykernel, { + reason: handleResult + }); + } ``` @@ -7004,7 +7373,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L171](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L171) +[src/kernels/raw/session/rawJupyterSession.ts#L164](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L164) ```typescript // We want to know why we got shut down const stacktrace = new Error().stack; @@ -7033,9 +7402,9 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L81](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L81) +[src/kernels/raw/session/rawJupyterSession.ts#L87](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L87) ```typescript - + Cancellation.throwIfCanceled(options.token); // Only connect our session if we didn't cancel or timeout sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartSuccess); sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStart, stopWatch.elapsedTime); @@ -7045,7 +7414,7 @@ No properties for event ``` -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L98](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L98) +[src/kernels/raw/session/rawJupyterSession.ts#L104](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L104) ```typescript if (error instanceof CancellationError) { sendKernelTelemetryEvent( @@ -7057,7 +7426,7 @@ No properties for event ``` -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L109](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L109) +[src/kernels/raw/session/rawJupyterSession.ts#L115](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L115) ```typescript } else if (error instanceof TimedOutError) { sendKernelTelemetryEvent( @@ -7069,19 +7438,7 @@ No properties for event ``` -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L120](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L120) -```typescript - } else if (error instanceof IpyKernelNotInstalledError) { - sendKernelTelemetryEvent( - this.resource, - Telemetry.RawKernelSessionStart, - stopWatch.elapsedTime, - undefined, - error -``` - - -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L134](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L134) +[src/kernels/raw/session/rawJupyterSession.ts#L127](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L127) ```typescript // Send our telemetry event with the error included sendKernelTelemetryEvent( @@ -7109,7 +7466,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L142](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L142) +[src/kernels/raw/session/rawJupyterSession.ts#L135](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L135) ```typescript ); sendKernelTelemetryEvent( @@ -7137,10 +7494,10 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L80](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L80) +[src/kernels/raw/session/rawJupyterSession.ts#L86](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L86) ```typescript - newSession = await this.startRawSession(cancelToken, disableUI); - + newSession = await this.startRawSession(options); + Cancellation.throwIfCanceled(options.token); // Only connect our session if we didn't cancel or timeout sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartSuccess); sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStart, stopWatch.elapsedTime); @@ -7165,7 +7522,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L114](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L114) +[src/kernels/raw/session/rawJupyterSession.ts#L120](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L120) ```typescript undefined, error @@ -7173,7 +7530,7 @@ No properties for event sendKernelTelemetryEvent(this.resource, Telemetry.RawKernelSessionStartTimeout); traceError('Raw session failed to start in given timeout'); throw error; - } else if (error instanceof IpyKernelNotInstalledError) { + } else { ``` @@ -7193,7 +7550,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L103](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L103) +[src/kernels/raw/session/rawJupyterSession.ts#L109](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L109) ```typescript undefined, error @@ -7221,13 +7578,13 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawJupyterSession.ts#L238](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawJupyterSession.ts#L238) +[src/kernels/raw/session/rawJupyterSession.ts#L237](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawJupyterSession.ts#L237) ```typescript - return this.startRawSession(cancelToken); + return this.startRawSession({ token: cancelToken, ui: new DisplayOptions(disableUI) }); } @captureTelemetry(Telemetry.RawKernelStartRawSession, undefined, true) - private async startRawSession(cancelToken?: CancellationToken, disableUI?: boolean): Promise { + private async startRawSession(options: { token: CancellationToken; ui: IDisplayOptions }): Promise { if ( this.kernelConnectionMetadata.kind !== 'startUsingLocalKernelSpec' && ``` @@ -7249,7 +7606,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/jupyterKernelService.ts#L191](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/jupyterKernelService.ts#L191) +[src/kernels/jupyter/jupyterKernelService.ts#L225](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/jupyterKernelService.ts#L225) ```typescript ); } @@ -7271,7 +7628,7 @@ No description provided ## Properties -- +- /** * Number of kernel specs. */ @@ -7298,7 +7655,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/kernelExecution.ts#L253](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelExecution.ts#L253) +[src/notebooks/execution/kernelExecution.ts#L270](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts#L270) ```typescript } @@ -7326,7 +7683,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/kernelExecution.ts#L252](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernelExecution.ts#L252) +[src/notebooks/execution/kernelExecution.ts#L269](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/execution/kernelExecution.ts#L269) ```typescript }); } @@ -7348,7 +7705,7 @@ No description provided ## Properties -- +- /** * The result of the selection. * notSelected - No interpreter was selected. @@ -7361,10 +7718,10 @@ No description provided ## Locations Used -[src/client/datascience/jupyter/interpreter/jupyterInterpreterService.ts#L95](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterService.ts#L95) +[src/kernels/jupyter/interpreter/jupyterInterpreterService.ts#L86](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.ts#L86) ```typescript - resolveToUndefinedWhenCancelled - ]); + public async selectInterpreter(): Promise { + const interpreter = await this.jupyterInterpreterSelector.selectInterpreter(); if (!interpreter) { sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'notSelected' }); return; @@ -7373,7 +7730,7 @@ No description provided ``` -[src/client/datascience/jupyter/interpreter/jupyterInterpreterService.ts#L106](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterService.ts#L106) +[src/kernels/jupyter/interpreter/jupyterInterpreterService.ts#L97](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.ts#L97) ```typescript return interpreter; } @@ -7381,11 +7738,11 @@ No description provided sendTelemetryEvent(Telemetry.SelectJupyterInterpreter, undefined, { result: 'installationCancelled' }); return; default: - return this.selectInterpreter(token); + return this.selectInterpreter(); ``` -[src/client/datascience/jupyter/interpreter/jupyterInterpreterService.ts#L169](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterService.ts#L169) +[src/kernels/jupyter/interpreter/jupyterInterpreterService.ts#L162](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterService.ts#L162) ```typescript this._selectedInterpreter = interpreter; this._onDidChangeInterpreter.fire(interpreter); @@ -7413,7 +7770,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.ts#L78](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.ts#L78) +[src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.ts#L86](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.ts#L86) ```typescript if (!interpreter) { // Unlikely scenario, user hasn't selected python, python extension will fall over. @@ -7441,7 +7798,7 @@ No properties for event ## Locations Used -[src/client/datascience/datascience.ts#L126](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/datascience.ts#L126) +[src/platform/datascience/datascience.ts#L126](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/datascience.ts#L126) ```typescript resultSettings[k] = currentValue; } @@ -7469,7 +7826,7 @@ No properties for event ## Locations Used -[src/client/datascience/shiftEnterBanner.ts#L78](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/shiftEnterBanner.ts#L78) +[src/platform/datascience/shiftEnterBanner.ts#L68](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/shiftEnterBanner.ts#L68) ```typescript return; } @@ -7481,7 +7838,7 @@ No properties for event ``` -[src/test/datascience/shiftEnterBanner.unit.test.ts#L69](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts#L69) +[src/test/datascience/shiftEnterBanner.unit.test.ts#L68](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts#L68) ```typescript config.verifyAll(); @@ -7493,7 +7850,7 @@ No properties for event ``` -[src/test/datascience/shiftEnterBanner.unit.test.ts#L114](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts#L114) +[src/test/datascience/shiftEnterBanner.unit.test.ts#L99](https://github.com/microsoft/vscode-jupyter/tree/main/src/test/datascience/shiftEnterBanner.unit.test.ts#L99) ```typescript config.verifyAll(); @@ -7521,15 +7878,15 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewerDependencyService.ts#L60](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewerDependencyService.ts#L60) +[src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L60](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L60) ```typescript - throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); - } - - sendTelemetryEvent(Telemetry.PandasNotInstalled); - await this.installMissingDependencies(interpreter, token); - } + throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); + } + sendTelemetryEvent(Telemetry.PandasNotInstalled); + await this.installMissingDependencies(interpreter, tokenSource); + } finally { + tokenSource.dispose(); ``` @@ -7549,15 +7906,15 @@ No properties for event ## Locations Used -[src/client/datascience/data-viewing/dataViewerDependencyService.ts#L54](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/data-viewing/dataViewerDependencyService.ts#L54) +[src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L54](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/data-viewing/dataViewerDependencyService.ts#L54) ```typescript - if (isVersionOfPandasSupported(pandasVersion)) { - return; - } - sendTelemetryEvent(Telemetry.PandasTooOld); - // Warn user that we cannot start because pandas is too old. - const versionStr = `${pandasVersion.major}.${pandasVersion.minor}.${pandasVersion.build}`; - throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); + if (isVersionOfPandasSupported(pandasVersion)) { + return; + } + sendTelemetryEvent(Telemetry.PandasTooOld); + // Warn user that we cannot start because pandas is too old. + const versionStr = `${pandasVersion.major}.${pandasVersion.minor}.${pandasVersion.build}`; + throw new Error(DataScience.pandasTooOldForViewingFormat().format(versionStr)); ``` @@ -7579,7 +7936,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/kernel.ts#L288](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernel.ts#L288) +[src/kernels/kernel.ts#L351](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/kernel.ts#L351) ```typescript this.perceivedJupyterStartupTelemetryCaptured = true; sendTelemetryEvent(Telemetry.PerceivedJupyterStartupNotebook, stopWatch.elapsedTime); @@ -7607,7 +7964,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/notebookStarter.ts#L145](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/notebookStarter.ts#L145) +[src/kernels/jupyter/launcher/notebookStarter.ts#L150](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/launcher/notebookStarter.ts#L150) ```typescript } @@ -7636,16 +7993,7 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/kernels/kernel.ts#L356](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/kernels/kernel.ts#L356) -```typescript - ex as any - ); - if (options?.disableUI) { - sendTelemetryEvent(Telemetry.KernelStartFailedAndUIDisabled); - } else { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.errorHandler.handleError(ex as any).ignoreErrors(); // Just a notification, so don't await this -``` +Event can be removed. Not referenced anywhere
@@ -7669,7 +8017,7 @@ No properties for event ## Locations Used -[src/client/datascience/baseJupyterSession.ts#L37](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/baseJupyterSession.ts#L37) +[src/kernels/common/baseJupyterSession.ts#L40](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/common/baseJupyterSession.ts#L40) ```typescript export class JupyterSessionStartError extends WrappedError { constructor(originalException: Error) { @@ -7697,11 +8045,11 @@ No properties for event ## Locations Used -[src/client/datascience/notebook/vscodeNotebookController.ts#L387](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/vscodeNotebookController.ts#L387) +[src/notebooks/controllers/vscodeNotebookController.ts#L566](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts#L566) ```typescript + default: // We don't know as its the default kernel on Jupyter server. } - trackKernelResourceInformation(document.uri, { kernelConnection: this.connection }); sendKernelTelemetryEvent(document.uri, Telemetry.SwitchKernel); // If we have an existing kernel, then we know for a fact the user is changing the kernel. // Else VSC is just setting a kernel for a notebook after it has opened. @@ -7723,7 +8071,7 @@ No description provided ## Locations Used -[src/client/datascience/common.ts#L171](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/common.ts#L171) +[src/platform/datascience/common.ts#L171](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/common.ts#L171) ```typescript } @@ -7735,7 +8083,7 @@ export function sendNotebookOrKernelLanguageTelemetry( ``` -[src/client/datascience/notebook/vscodeNotebookController.ts#L369](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/vscodeNotebookController.ts#L369) +[src/notebooks/controllers/vscodeNotebookController.ts#L548](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts#L548) ```typescript } switch (this.connection.kind) { @@ -7747,7 +8095,7 @@ export function sendNotebookOrKernelLanguageTelemetry( ``` -[src/client/datascience/notebook/vscodeNotebookController.ts#L373](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/vscodeNotebookController.ts#L373) +[src/notebooks/controllers/vscodeNotebookController.ts#L552](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts#L552) ```typescript break; case 'connectToLiveKernel': @@ -7759,10 +8107,10 @@ export function sendNotebookOrKernelLanguageTelemetry( ``` -[src/client/datascience/notebook/vscodeNotebookController.ts#L379](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/vscodeNotebookController.ts#L379) +[src/notebooks/controllers/vscodeNotebookController.ts#L559](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/controllers/vscodeNotebookController.ts#L559) ```typescript - break; case 'startUsingLocalKernelSpec': + case 'startUsingRemoteKernelSpec': sendNotebookOrKernelLanguageTelemetry( Telemetry.SwitchToExistingKernel, this.connection.kernelSpec.language @@ -7883,14 +8231,14 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterVariables.ts#L44](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterVariables.ts#L44) +[src/kernels/variables/jupyterVariables.ts#L42](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/variables/jupyterVariables.ts#L42) ```typescript } // IJupyterVariables implementation @captureTelemetry(Telemetry.VariableExplorerFetchTime, undefined, true) public async getVariables(request: IJupyterVariablesRequest, kernel?: IKernel): Promise { - return (await this.getVariableHandler()).getVariables(request, kernel); + return this.variableHandler.getVariables(request, kernel); } ``` @@ -7909,7 +8257,7 @@ No description provided ## Locations Used -[src/client/datascience/variablesView/variableView.ts#L192](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/variablesView/variableView.ts#L192) +[src/platform/datascience/variablesView/variableView.ts#L187](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/variablesView/variableView.ts#L187) ```typescript const response = await this.variables.getVariables(args, activeNotebook); @@ -7931,12 +8279,12 @@ No description provided ## Properties -- +- isErrorOutput: boolean; ## Locations Used -[src/client/datascience/notebook/helpers/helpers.ts#L725](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/notebook/helpers/helpers.ts#L725) +[src/notebooks/helpers.ts#L736](https://github.com/microsoft/vscode-jupyter/tree/main/src/notebooks/helpers.ts#L736) ```typescript // Unless we already know its an unknown output type. const outputType: nbformat.OutputType = @@ -7964,11 +8312,11 @@ No properties for event ## Locations Used -[src/client/datascience/jupyter/jupyterSession.ts#L53](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/jupyter/jupyterSession.ts#L53) +[src/kernels/jupyter/session/jupyterSession.ts#L78](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/jupyter/session/jupyterSession.ts#L78) ```typescript + super(resource, kernelConnectionMetadata, restartSessionUsed, workingDirectory, interruptTimeout); } - @reportAction(ReportableAction.JupyterSessionWaitForIdleSession) @captureTelemetry(Telemetry.WaitForIdleJupyter, undefined, true) public waitForIdle(timeout: number): Promise { // Wait for idle on this session @@ -7990,7 +8338,7 @@ No description provided ## Locations Used -[src/client/datascience/webviews/webviewHost.ts#L284](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/webviews/webviewHost.ts#L284) +[src/platform/datascience/webviews/webviewHost.ts#L282](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/webviews/webviewHost.ts#L282) ```typescript protected webViewRendered() { if (this.webviewInit && !this.webviewInit.resolved) { @@ -8018,7 +8366,7 @@ No properties for event ## Locations Used -[src/client/datascience/webviews/webviewHost.ts#L302](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/webviews/webviewHost.ts#L302) +[src/platform/datascience/webviews/webviewHost.ts#L300](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/datascience/webviews/webviewHost.ts#L300) ```typescript this.dispose(); }; @@ -8048,7 +8396,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawNotebookSupportedService.ts#L58](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawNotebookSupportedService.ts#L58) +[src/kernels/raw/session/rawNotebookSupportedService.ts#L43](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawNotebookSupportedService.ts#L43) ```typescript try { require('zeromq'); @@ -8078,7 +8426,7 @@ No properties for event ## Locations Used -[src/client/datascience/raw-kernel/rawNotebookSupportedService.ts#L62](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/raw-kernel/rawNotebookSupportedService.ts#L62) +[src/kernels/raw/session/rawNotebookSupportedService.ts#L47](https://github.com/microsoft/vscode-jupyter/tree/main/src/kernels/raw/session/rawNotebookSupportedService.ts#L47) ```typescript this._isSupported = true; } catch (e) { @@ -8108,7 +8456,7 @@ No properties for event ## Locations Used -[src/client/common/variables/environment.ts#L140](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/variables/environment.ts#L140) +[src/platform/common/variables/environment.ts#L173](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/variables/environment.ts#L173) ```typescript }); if (!invalid && replacement !== value) { @@ -8138,7 +8486,7 @@ No properties for event ## Locations Used -[src/client/telemetry/envFileTelemetry.ts#L46](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/telemetry/envFileTelemetry.ts#L46) +[src/telemetry/envFileTelemetry.ts#L46](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/envFileTelemetry.ts#L46) ```typescript } @@ -8168,7 +8516,7 @@ No properties for event ## Locations Used -[src/client/telemetry/types.ts#L8](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/telemetry/types.ts#L8) +[src/telemetry/types.ts#L10](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/types.ts#L10) ```typescript import { IEventNamePropertyMapping } from '../telemetry/index'; import { EventName } from './constants'; @@ -8180,7 +8528,7 @@ export interface IImportTracker {} ``` -[src/client/startupTelemetry.ts#L31](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/startupTelemetry.ts#L31) +[src/platform/startupTelemetry.ts#L31](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/startupTelemetry.ts#L31) ```typescript await activatedPromise; durations.totalActivateTime = stopWatch.elapsedTime; @@ -8192,7 +8540,7 @@ export interface IImportTracker {} ``` -[src/client/startupTelemetry.ts#L52](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/startupTelemetry.ts#L52) +[src/platform/startupTelemetry.ts#L52](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/startupTelemetry.ts#L52) ```typescript traceError('getActivationTelemetryProps() failed.', ex); } @@ -8222,7 +8570,7 @@ No properties for event ## Locations Used -[src/client/telemetry/importTracker.ts#L208](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/telemetry/importTracker.ts#L208) +[src/telemetry/importTracker.ts#L205](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/importTracker.ts#L205) ```typescript // Hash the package name so that we will never accidentally see a // user's private package name. @@ -8262,7 +8610,7 @@ No properties for event ## Locations Used -[src/client/telemetry/importTracker.ts#L161](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/telemetry/importTracker.ts#L161) +[src/telemetry/importTracker.ts#L158](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/importTracker.ts#L158) ```typescript } } @@ -8274,7 +8622,7 @@ No properties for event ``` -[src/client/telemetry/importTracker.ts#L168](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/telemetry/importTracker.ts#L168) +[src/telemetry/importTracker.ts#L165](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/importTracker.ts#L165) ```typescript this.lookForImports(lines); } @@ -8286,7 +8634,7 @@ No properties for event ``` -[src/client/telemetry/importTracker.ts#L192](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/telemetry/importTracker.ts#L192) +[src/telemetry/importTracker.ts#L189](https://github.com/microsoft/vscode-jupyter/tree/main/src/telemetry/importTracker.ts#L189) ```typescript this.lookForImports(result); } @@ -8328,7 +8676,7 @@ No properties for event ## Locations Used -[src/client/common/experiments/service.ts#L104](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/experiments/service.ts#L104) +[src/platform/common/experiments/service.ts#L104](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/experiments/service.ts#L104) ```typescript // so we need to perform these checks and send the corresponding telemetry manually. switch (this.getOptInOptOutStatus(experiment)) { @@ -8340,7 +8688,7 @@ No properties for event ``` -[src/client/common/experiments/service.ts#L112](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/experiments/service.ts#L112) +[src/platform/common/experiments/service.ts#L112](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/experiments/service.ts#L112) ```typescript } case 'optIn': { @@ -8392,14 +8740,14 @@ No properties for event ## Locations Used -[src/client/datascience/commands/commandRegistry.ts#L558](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/commandRegistry.ts#L558) +[src/interactive-window/commands/commandRegistry.ts#L566](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts#L566) ```typescript sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_SUCCESS); } } catch (e) { sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_ERROR, undefined, undefined, e); traceError(e); - void this.appShell.showErrorMessage(e.toString()); + void this.errorHandler.handleError(e); } ``` @@ -8420,7 +8768,7 @@ No properties for event ## Locations Used -[src/client/datascience/commands/commandRegistry.ts#L540](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/commandRegistry.ts#L540) +[src/interactive-window/commands/commandRegistry.ts#L539](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts#L539) ```typescript return this.commandManager.executeCommand('outline.focus'); } @@ -8428,7 +8776,7 @@ No properties for event sendTelemetryEvent(EventName.OPEN_DATAVIEWER_FROM_VARIABLE_WINDOW_REQUEST); if (this.debugService.activeDebugSession) { try { - const variable = convertDebugProtocolVariableToIJupyterVariable( + // First find out the current python environment that we are working with ```
@@ -8448,7 +8796,7 @@ No properties for event ## Locations Used -[src/client/datascience/commands/commandRegistry.ts#L555](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/datascience/commands/commandRegistry.ts#L555) +[src/interactive-window/commands/commandRegistry.ts#L563](https://github.com/microsoft/vscode-jupyter/tree/main/src/interactive-window/commands/commandRegistry.ts#L563) ```typescript if (columnSize && (await this.dataViewerChecker.isRequestedColumnSizeAllowed(columnSize))) { const title: string = `${DataScience.dataExplorerTitle()} - ${jupyterVariable.name}`; @@ -8478,7 +8826,7 @@ No properties for event ## Locations Used -[src/client/common/platform/platformService.ts#L21](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/platform/platformService.ts#L21) +[src/platform/common/platform/platformService.ts#L21](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.ts#L21) ```typescript public version?: SemVer; constructor() { @@ -8490,7 +8838,7 @@ No properties for event ``` -[src/client/common/platform/platformService.ts#L45](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/platform/platformService.ts#L45) +[src/platform/common/platform/platformService.ts#L45](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.ts#L45) ```typescript try { const ver = coerce(os.release()); @@ -8502,7 +8850,7 @@ No properties for event ``` -[src/client/common/platform/platformService.ts#L52](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/platform/platformService.ts#L52) +[src/platform/common/platform/platformService.ts#L52](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/platform/platformService.ts#L52) ```typescript } throw new Error('Unable to parse version'); @@ -8524,28 +8872,28 @@ No description provided ## Properties -- +- /** * Carries `true` if environment variables are present, `false` otherwise * * @type {boolean} */ hasEnvVars?: boolean; -- +- /** * Carries `true` if fetching environment variables failed, `false` otherwise * * @type {boolean} */ failed?: boolean; -- +- /** * Whether the environment was activated within a terminal or not. * * @type {boolean} */ activatedInTerminal?: boolean; -- +- /** * Whether the environment was activated by the wrapper class. * If `true`, this telemetry is sent by the class that wraps the two activation providers . @@ -8556,7 +8904,7 @@ No description provided ## Locations Used -[src/client/common/process/pythonExecutionFactory.ts#L172](https://github.com/microsoft/vscode-jupyter/tree/main/src/client/common/process/pythonExecutionFactory.ts#L172) +[src/platform/common/process/pythonExecutionFactory.ts#L164](https://github.com/microsoft/vscode-jupyter/tree/main/src/platform/common/process/pythonExecutionFactory.ts#L164) ```typescript options.allowEnvironmentFetchExceptions ); diff --git a/build/existingFiles.json b/build/existingFiles.json index e6676bb3f47..5dbd08884b5 100644 --- a/build/existingFiles.json +++ b/build/existingFiles.json @@ -1,326 +1,326 @@ [ - "src/client/activation/activationService.ts", - "src/client/activation/downloadChannelRules.ts", - "src/client/activation/downloader.ts", - "src/client/activation/hashVerifier.ts", - "src/client/activation/interpreterDataService.ts", - "src/client/activation/jedi.ts", - "src/client/activation/languageServer/languageServer.ts", - "src/client/activation/languageServer/languageServerFolderService.ts", - "src/client/activation/languageServer/languageServerHashes.ts", - "src/client/activation/languageServer/languageServerPackageRepository.ts", - "src/client/activation/languageServer/languageServerPackageService.ts", - "src/client/activation/platformData.ts", - "src/client/activation/progress.ts", - "src/client/activation/serviceRegistry.ts", - "src/client/activation/types.ts", - "src/client/api.ts", - "src/client/application/diagnostics/applicationDiagnostics.ts", - "src/client/application/diagnostics/base.ts", - "src/client/application/diagnostics/checks/envPathVariable.ts", - "src/client/application/diagnostics/checks/invalidDebuggerType.ts", - "src/client/application/diagnostics/checks/invalidPythonPathInDebugger.ts", - "src/client/application/diagnostics/checks/powerShellActivation.ts", - "src/client/application/diagnostics/checks/pythonInterpreter.ts", - "src/client/application/diagnostics/commands/base.ts", - "src/client/application/diagnostics/commands/execVSCCommand.ts", - "src/client/application/diagnostics/commands/factory.ts", - "src/client/application/diagnostics/commands/ignore.ts", - "src/client/application/diagnostics/commands/launchBrowser.ts", - "src/client/application/diagnostics/commands/types.ts", - "src/client/application/diagnostics/constants.ts", - "src/client/application/diagnostics/filter.ts", - "src/client/application/diagnostics/promptHandler.ts", - "src/client/application/diagnostics/serviceRegistry.ts", - "src/client/application/diagnostics/types.ts", - "src/client/application/serviceRegistry.ts", - "src/client/application/types.ts", - "src/client/common/application/applicationEnvironment.ts", - "src/client/common/application/applicationShell.ts", - "src/client/common/application/commandManager.ts", - "src/client/common/application/debugService.ts", - "src/client/common/application/documentManager.ts", - "src/client/common/application/extensions.ts", - "src/client/common/application/terminalManager.ts", - "src/client/common/application/types.ts", - "src/client/common/application/workspace.ts", - "src/client/common/configSettingMonitor.ts", - "src/client/common/configSettings.ts", - "src/client/common/configuration/service.ts", - "src/client/common/constants.ts", - "src/client/common/contextKey.ts", - "src/client/common/editor.ts", - "src/client/common/envFileParser.ts", - "src/client/common/errors/errorUtils.ts", - "src/client/common/errors/moduleNotInstalledError.ts", - "src/client/common/extensions.ts", - "src/client/common/featureDeprecationManager.ts", - "src/client/common/helpers.ts", - "src/client/common/installer/channelManager.ts", - "src/client/common/installer/condaInstaller.ts", - "src/client/common/installer/moduleInstaller.ts", - "src/client/common/installer/pipEnvInstaller.ts", - "src/client/common/installer/pipInstaller.ts", - "src/client/common/installer/productInstaller.ts", - "src/client/common/installer/productNames.ts", - "src/client/common/installer/productPath.ts", - "src/client/common/installer/productService.ts", - "src/client/common/installer/serviceRegistry.ts", - "src/client/common/installer/types.ts", - "src/client/common/logger.ts", - "src/client/common/markdown/restTextConverter.ts", - "src/client/common/net/browser.ts", - "src/client/common/net/httpClient.ts", - "src/client/common/net/socket/socketCallbackHandler.ts", - "src/client/common/net/socket/socketServer.ts", - "src/client/common/net/socket/SocketStream.ts", - "src/client/common/nuget/azureBlobStoreNugetRepository.ts", - "src/client/common/nuget/nugetRepository.ts", - "src/client/common/nuget/nugetService.ts", - "src/client/common/nuget/types.ts", - "src/client/common/open.ts", - "src/client/common/persistentState.ts", - "src/client/common/platform/constants.ts", - "src/client/common/platform/fileSystem.ts", - "src/client/common/platform/osinfo.ts", - "src/client/common/platform/pathUtils.ts", - "src/client/common/platform/platformService.ts", - "src/client/common/platform/registry.ts", - "src/client/common/platform/serviceRegistry.ts", - "src/client/common/platform/types.ts", - "src/client/common/process/constants.ts", - "src/client/common/process/currentProcess.ts", - "src/client/common/process/decoder.ts", - "src/client/common/process/proc.ts", - "src/client/common/process/processFactory.ts", - "src/client/common/process/pythonExecutionFactory.ts", - "src/client/common/process/pythonProcess.ts", - "src/client/common/process/pythonToolService.ts", - "src/client/common/process/serviceRegistry.ts", - "src/client/common/process/types.ts", - "src/client/common/serviceRegistry.ts", - "src/client/common/terminal/activator/base.ts", - "src/client/common/terminal/activator/index.ts", - "src/client/common/terminal/activator/powershellFailedHandler.ts", - "src/client/common/terminal/commandPrompt.ts", - "src/client/common/terminal/environmentActivationProviders/baseActivationProvider.ts", - "src/client/common/terminal/environmentActivationProviders/bash.ts", - "src/client/common/terminal/environmentActivationProviders/commandPrompt.ts", - "src/client/common/terminal/environmentActivationProviders/condaActivationProvider.ts", - "src/client/common/terminal/environmentActivationProviders/pyenvActivationProvider.ts", - "src/client/common/terminal/factory.ts", - "src/client/common/terminal/helper.ts", - "src/client/common/terminal/service.ts", - "src/client/common/terminal/types.ts", - "src/client/common/types.ts", - "src/client/common/util.ts", - "src/client/common/utils/async.ts", - "src/client/common/utils/decorators.ts", - "src/client/common/utils/enum.ts", - "src/client/common/utils/fs.ts", - "src/client/common/utils/localize.ts", - "src/client/common/utils/logging.ts", - "src/client/common/utils/misc.ts", - "src/client/common/utils/platform.ts", - "src/client/common/utils/random.ts", - "src/client/common/utils/stopWatch.ts", - "src/client/common/utils/string.ts", - "src/client/common/utils/sysTypes.ts", - "src/client/common/utils/text.ts", - "src/client/common/utils/version.ts", - "src/client/common/variables/environment.ts", - "src/client/common/variables/environmentVariablesProvider.ts", - "src/client/common/variables/serviceRegistry.ts", - "src/client/common/variables/systemVariables.ts", - "src/client/common/variables/sysTypes.ts", - "src/client/common/variables/types.ts", - "src/client/debugger/constants.ts", - "src/client/debugger/extension/banner.ts", - "src/client/debugger/extension/configuration/baseProvider.ts", - "src/client/debugger/extension/configuration/configurationProviderUtils.ts", - "src/client/debugger/extension/configuration/pythonV2Provider.ts", - "src/client/debugger/extension/configuration/types.ts", - "src/client/debugger/extension/hooks/childProcessAttachHandler.ts", - "src/client/debugger/extension/hooks/childProcessAttachService.ts", - "src/client/debugger/extension/hooks/constants.ts", - "src/client/debugger/extension/hooks/eventHandlerDispatcher.ts", - "src/client/debugger/extension/hooks/processTerminationHandler.ts", - "src/client/debugger/extension/hooks/processTerminationService.ts", - "src/client/debugger/extension/hooks/types.ts", - "src/client/debugger/extension/serviceRegistry.ts", - "src/client/debugger/extension/types.ts", - "src/client/debugger/types.ts", - "src/client/extension.ts", - "src/client/formatters/autoPep8Formatter.ts", - "src/client/formatters/baseFormatter.ts", - "src/client/formatters/blackFormatter.ts", - "src/client/formatters/dummyFormatter.ts", - "src/client/formatters/helper.ts", - "src/client/formatters/lineFormatter.ts", - "src/client/formatters/serviceRegistry.ts", - "src/client/formatters/types.ts", - "src/client/formatters/yapfFormatter.ts", - "src/client/interpreter/configuration/interpreterComparer.ts", - "src/client/interpreter/configuration/interpreterSelector.ts", - "src/client/interpreter/configuration/pythonPathUpdaterService.ts", - "src/client/interpreter/configuration/pythonPathUpdaterServiceFactory.ts", - "src/client/interpreter/configuration/services/globalUpdaterService.ts", - "src/client/interpreter/configuration/services/workspaceFolderUpdaterService.ts", - "src/client/interpreter/configuration/services/workspaceUpdaterService.ts", - "src/client/interpreter/configuration/types.ts", - "src/client/interpreter/contracts.ts", - "src/client/interpreter/display/index.ts", - "src/client/interpreter/display/shebangCodeLensProvider.ts", - "src/client/interpreter/helpers.ts", - "src/client/interpreter/interpreterService.ts", - "src/client/interpreter/interpreterVersion.ts", - "src/client/interpreter/locators/helpers.ts", - "src/client/interpreter/locators/index.ts", - "src/client/interpreter/locators/services/baseVirtualEnvService.ts", - "src/client/interpreter/locators/services/cacheableLocatorService.ts", - "src/client/interpreter/locators/services/conda.ts", - "src/client/interpreter/locators/services/condaEnvFileService.ts", - "src/client/interpreter/locators/services/condaEnvService.ts", - "src/client/interpreter/locators/services/condaHelper.ts", - "src/client/interpreter/locators/services/condaService.ts", - "src/client/interpreter/locators/services/currentPathService.ts", - "src/client/interpreter/locators/services/globalVirtualEnvService.ts", - "src/client/interpreter/locators/services/KnownPathsService.ts", - "src/client/interpreter/locators/services/pipEnvService.ts", - "src/client/interpreter/locators/services/windowsRegistryService.ts", - "src/client/interpreter/locators/services/workspaceVirtualEnvService.ts", - "src/client/interpreter/serviceRegistry.ts", - "src/client/interpreter/virtualEnvs/index.ts", - "src/client/interpreter/virtualEnvs/types.ts", - "src/client/ioc/container.ts", - "src/client/ioc/index.ts", - "src/client/ioc/serviceManager.ts", - "src/client/ioc/types.ts", - "src/client/jupyter/provider.ts", - "src/client/language/braceCounter.ts", - "src/client/language/characters.ts", - "src/client/language/characterStream.ts", - "src/client/language/iterableTextRange.ts", - "src/client/language/textBuilder.ts", - "src/client/language/textIterator.ts", - "src/client/language/textRangeCollection.ts", - "src/client/language/tokenizer.ts", - "src/client/language/types.ts", - "src/client/language/unicode.ts", - "src/client/languageServices/jediProxyFactory.ts", - "src/client/languageServices/proposeLanguageServerBanner.ts", - "src/client/linters/bandit.ts", - "src/client/linters/baseLinter.ts", - "src/client/linters/errorHandlers/baseErrorHandler.ts", - "src/client/linters/errorHandlers/errorHandler.ts", - "src/client/linters/errorHandlers/notInstalled.ts", - "src/client/linters/errorHandlers/standard.ts", - "src/client/linters/flake8.ts", - "src/client/linters/linterCommands.ts", - "src/client/linters/linterInfo.ts", - "src/client/linters/linterManager.ts", - "src/client/linters/lintingEngine.ts", - "src/client/linters/mypy.ts", - "src/client/linters/pycodestyle.ts", - "src/client/linters/prospector.ts", - "src/client/linters/pydocstyle.ts", - "src/client/linters/pylama.ts", - "src/client/linters/pylint.ts", - "src/client/linters/serviceRegistry.ts", - "src/client/linters/types.ts", - "src/client/providers/codeActionsProvider.ts", - "src/client/providers/completionProvider.ts", - "src/client/providers/completionSource.ts", - "src/client/providers/definitionProvider.ts", - "src/client/providers/docStringFoldingProvider.ts", - "src/client/providers/formatProvider.ts", - "src/client/providers/hoverProvider.ts", - "src/client/providers/importSortProvider.ts", - "src/client/providers/itemInfoSource.ts", - "src/client/providers/jediProxy.ts", - "src/client/providers/linterProvider.ts", - "src/client/providers/objectDefinitionProvider.ts", - "src/client/providers/providerUtilities.ts", - "src/client/providers/referenceProvider.ts", - "src/client/providers/renameProvider.ts", - "src/client/providers/replProvider.ts", - "src/client/providers/serviceRegistry.ts", - "src/client/providers/signatureProvider.ts", - "src/client/providers/simpleRefactorProvider.ts", - "src/client/providers/symbolProvider.ts", - "src/client/providers/terminalProvider.ts", - "src/client/providers/types.ts", - "src/client/refactor/contracts.ts", - "src/client/refactor/proxy.ts", - "src/client/telemetry/constants.ts", - "src/client/telemetry/index.ts", - "src/client/telemetry/types.ts", - "src/client/telemetry/vscode-extension-telemetry.d.ts", - "src/client/terminals/activation.ts", - "src/client/terminals/codeExecution/codeExecutionManager.ts", - "src/client/terminals/codeExecution/djangoContext.ts", - "src/client/terminals/codeExecution/djangoShellCodeExecution.ts", - "src/client/terminals/codeExecution/helper.ts", - "src/client/terminals/codeExecution/repl.ts", - "src/client/terminals/codeExecution/terminalCodeExecution.ts", - "src/client/terminals/serviceRegistry.ts", - "src/client/terminals/types.ts", - "src/client/typeFormatters/blockFormatProvider.ts", - "src/client/typeFormatters/codeBlockFormatProvider.ts", - "src/client/typeFormatters/contracts.ts", - "src/client/typeFormatters/dispatcher.ts", - "src/client/typeFormatters/onEnterFormatter.ts", - "src/client/testing/codeLenses/main.ts", - "src/client/testing/codeLenses/testFiles.ts", - "src/client/testing/common/argumentsHelper.ts", - "src/client/testing/common/constants.ts", - "src/client/testing/common/debugLauncher.ts", - "src/client/testing/common/managers/baseTestManager.ts", - "src/client/testing/common/managers/testConfigurationManager.ts", - "src/client/testing/common/runner.ts", - "src/client/testing/common/services/configSettingService.ts", - "src/client/testing/common/services/storageService.ts", - "src/client/testing/common/services/testManagerService.ts", - "src/client/testing/common/services/testResultsService.ts", - "src/client/testing/common/services/workspaceTestManagerService.ts", - "src/client/testing/common/testUtils.ts", - "src/client/testing/common/testVisitors/flatteningVisitor.ts", - "src/client/testing/common/testVisitors/folderGenerationVisitor.ts", - "src/client/testing/common/testVisitors/resultResetVisitor.ts", - "src/client/testing/common/types.ts", - "src/client/testing/common/xUnitParser.ts", - "src/client/testing/configuration.ts", - "src/client/testing/configurationFactory.ts", - "src/client/testing/display/main.ts", - "src/client/testing/display/picker.ts", - "src/client/testing/main.ts", - "src/client/testing/nosetest/main.ts", - "src/client/testing/nosetest/runner.ts", - "src/client/testing/nosetest/services/argsService.ts", - "src/client/testing/nosetest/services/discoveryService.ts", - "src/client/testing/nosetest/services/parserService.ts", - "src/client/testing/nosetest/testConfigurationManager.ts", - "src/client/testing/pytest/main.ts", - "src/client/testing/pytest/runner.ts", - "src/client/testing/pytest/services/argsService.ts", - "src/client/testing/pytest/services/discoveryService.ts", - "src/client/testing/pytest/services/parserService.ts", - "src/client/testing/pytest/testConfigurationManager.ts", - "src/client/testing/serviceRegistry.ts", - "src/client/testing/types.ts", - "src/client/testing/unittest/helper.ts", - "src/client/testing/unittest/main.ts", - "src/client/testing/unittest/runner.ts", - "src/client/testing/unittest/services/argsService.ts", - "src/client/testing/unittest/services/discoveryService.ts", - "src/client/testing/unittest/services/parserService.ts", - "src/client/testing/unittest/socketServer.ts", - "src/client/testing/unittest/testConfigurationManager.ts", - "src/client/workspaceSymbols/contracts.ts", - "src/client/workspaceSymbols/generator.ts", - "src/client/workspaceSymbols/main.ts", - "src/client/workspaceSymbols/parser.ts", - "src/client/workspaceSymbols/provider.ts", + "src/platform/activation/activationService.ts", + "src/platform/activation/downloadChannelRules.ts", + "src/platform/activation/downloader.ts", + "src/platform/activation/hashVerifier.ts", + "src/platform/activation/interpreterDataService.ts", + "src/platform/activation/jedi.ts", + "src/platform/activation/languageServer/languageServer.ts", + "src/platform/activation/languageServer/languageServerFolderService.ts", + "src/platform/activation/languageServer/languageServerHashes.ts", + "src/platform/activation/languageServer/languageServerPackageRepository.ts", + "src/platform/activation/languageServer/languageServerPackageService.ts", + "src/platform/activation/platformData.ts", + "src/platform/activation/progress.ts", + "src/platform/activation/serviceRegistry.ts", + "src/platform/activation/types.ts", + "src/platform/api.ts", + "src/platform/application/diagnostics/applicationDiagnostics.ts", + "src/platform/application/diagnostics/base.ts", + "src/platform/application/diagnostics/checks/envPathVariable.ts", + "src/platform/application/diagnostics/checks/invalidDebuggerType.ts", + "src/platform/application/diagnostics/checks/invalidPythonPathInDebugger.ts", + "src/platform/application/diagnostics/checks/powerShellActivation.ts", + "src/platform/application/diagnostics/checks/pythonInterpreter.ts", + "src/platform/application/diagnostics/commands/base.ts", + "src/platform/application/diagnostics/commands/execVSCCommand.ts", + "src/platform/application/diagnostics/commands/factory.ts", + "src/platform/application/diagnostics/commands/ignore.ts", + "src/platform/application/diagnostics/commands/launchBrowser.ts", + "src/platform/application/diagnostics/commands/types.ts", + "src/platform/application/diagnostics/constants.ts", + "src/platform/application/diagnostics/filter.ts", + "src/platform/application/diagnostics/promptHandler.ts", + "src/platform/application/diagnostics/serviceRegistry.ts", + "src/platform/application/diagnostics/types.ts", + "src/platform/application/serviceRegistry.ts", + "src/platform/application/types.ts", + "src/platform/common/application/applicationEnvironment.ts", + "src/platform/common/application/applicationShell.ts", + "src/platform/common/application/commandManager.ts", + "src/platform/common/application/debugService.ts", + "src/platform/common/application/documentManager.ts", + "src/platform/common/application/extensions.ts", + "src/platform/common/application/terminalManager.ts", + "src/platform/common/application/types.ts", + "src/platform/common/application/workspace.ts", + "src/platform/common/configSettingMonitor.ts", + "src/platform/common/configSettings.ts", + "src/platform/common/configuration/service.ts", + "src/platform/common/constants.ts", + "src/platform/common/contextKey.ts", + "src/platform/common/editor.ts", + "src/platform/common/envFileParser.ts", + "src/platform/common/errors/errorUtils.ts", + "src/platform/common/errors/moduleNotInstalledError.ts", + "src/platform/common/extensions.ts", + "src/platform/common/featureDeprecationManager.ts", + "src/platform/common/helpers.ts", + "src/platform/common/installer/channelManager.ts", + "src/platform/common/installer/condaInstaller.ts", + "src/platform/common/installer/moduleInstaller.ts", + "src/platform/common/installer/pipEnvInstaller.ts", + "src/platform/common/installer/pipInstaller.ts", + "src/platform/common/installer/productInstaller.ts", + "src/platform/common/installer/productNames.ts", + "src/platform/common/installer/productPath.ts", + "src/platform/common/installer/productService.ts", + "src/platform/common/installer/serviceRegistry.ts", + "src/platform/common/installer/types.ts", + "src/platform/common/logger.ts", + "src/platform/common/markdown/restTextConverter.ts", + "src/platform/common/net/browser.ts", + "src/platform/common/net/httpClient.ts", + "src/platform/common/net/socket/socketCallbackHandler.ts", + "src/platform/common/net/socket/socketServer.ts", + "src/platform/common/net/socket/SocketStream.ts", + "src/platform/common/nuget/azureBlobStoreNugetRepository.ts", + "src/platform/common/nuget/nugetRepository.ts", + "src/platform/common/nuget/nugetService.ts", + "src/platform/common/nuget/types.ts", + "src/platform/common/open.ts", + "src/platform/common/persistentState.ts", + "src/platform/common/platform/constants.ts", + "src/platform/common/platform/fileSystem.ts", + "src/platform/common/platform/osinfo.ts", + "src/platform/common/platform/pathUtils.ts", + "src/platform/common/platform/platformService.ts", + "src/platform/common/platform/registry.ts", + "src/platform/common/platform/serviceRegistry.ts", + "src/platform/common/platform/types.ts", + "src/platform/common/process/constants.ts", + "src/platform/common/process/currentProcess.ts", + "src/platform/common/process/decoder.ts", + "src/platform/common/process/proc.ts", + "src/platform/common/process/processFactory.ts", + "src/platform/common/process/pythonExecutionFactory.ts", + "src/platform/common/process/pythonProcess.ts", + "src/platform/common/process/pythonToolService.ts", + "src/platform/common/process/serviceRegistry.ts", + "src/platform/common/process/types.ts", + "src/platform/common/serviceRegistry.ts", + "src/platform/common/terminal/activator/base.ts", + "src/platform/common/terminal/activator/index.ts", + "src/platform/common/terminal/activator/powershellFailedHandler.ts", + "src/platform/common/terminal/commandPrompt.ts", + "src/platform/common/terminal/environmentActivationProviders/baseActivationProvider.ts", + "src/platform/common/terminal/environmentActivationProviders/bash.ts", + "src/platform/common/terminal/environmentActivationProviders/commandPrompt.ts", + "src/platform/common/terminal/environmentActivationProviders/condaActivationProvider.ts", + "src/platform/common/terminal/environmentActivationProviders/pyenvActivationProvider.ts", + "src/platform/common/terminal/factory.ts", + "src/platform/common/terminal/helper.ts", + "src/platform/common/terminal/service.ts", + "src/platform/common/terminal/types.ts", + "src/platform/common/types.ts", + "src/platform/common/util.ts", + "src/platform/common/utils/async.ts", + "src/platform/common/utils/decorators.ts", + "src/platform/common/utils/enum.ts", + "src/platform/common/utils/fs.ts", + "src/platform/common/utils/localize.ts", + "src/platform/common/utils/logging.ts", + "src/platform/common/utils/misc.ts", + "src/platform/common/utils/platform.ts", + "src/platform/common/utils/random.ts", + "src/platform/common/utils/stopWatch.ts", + "src/platform/common/utils/string.ts", + "src/platform/common/utils/sysTypes.ts", + "src/platform/common/utils/text.ts", + "src/platform/common/utils/version.ts", + "src/platform/common/variables/environment.ts", + "src/platform/common/variables/environmentVariablesProvider.ts", + "src/platform/common/variables/serviceRegistry.ts", + "src/platform/common/variables/systemVariables.ts", + "src/platform/common/variables/sysTypes.ts", + "src/platform/common/variables/types.ts", + "src/platform/debugger/constants.ts", + "src/platform/debugger/extension/banner.ts", + "src/platform/debugger/extension/configuration/baseProvider.ts", + "src/platform/debugger/extension/configuration/configurationProviderUtils.ts", + "src/platform/debugger/extension/configuration/pythonV2Provider.ts", + "src/platform/debugger/extension/configuration/types.ts", + "src/platform/debugger/extension/hooks/childProcessAttachHandler.ts", + "src/platform/debugger/extension/hooks/childProcessAttachService.ts", + "src/platform/debugger/extension/hooks/constants.ts", + "src/platform/debugger/extension/hooks/eventHandlerDispatcher.ts", + "src/platform/debugger/extension/hooks/processTerminationHandler.ts", + "src/platform/debugger/extension/hooks/processTerminationService.ts", + "src/platform/debugger/extension/hooks/types.ts", + "src/platform/debugger/extension/serviceRegistry.ts", + "src/platform/debugger/extension/types.ts", + "src/platform/debugger/types.ts", + "src/extension.ts", + "src/platform/formatters/autoPep8Formatter.ts", + "src/platform/formatters/baseFormatter.ts", + "src/platform/formatters/blackFormatter.ts", + "src/platform/formatters/dummyFormatter.ts", + "src/platform/formatters/helper.ts", + "src/platform/formatters/lineFormatter.ts", + "src/platform/formatters/serviceRegistry.ts", + "src/platform/formatters/types.ts", + "src/platform/formatters/yapfFormatter.ts", + "src/platform/interpreter/configuration/interpreterComparer.ts", + "src/platform/interpreter/configuration/interpreterSelector.ts", + "src/platform/interpreter/configuration/pythonPathUpdaterService.ts", + "src/platform/interpreter/configuration/pythonPathUpdaterServiceFactory.ts", + "src/platform/interpreter/configuration/services/globalUpdaterService.ts", + "src/platform/interpreter/configuration/services/workspaceFolderUpdaterService.ts", + "src/platform/interpreter/configuration/services/workspaceUpdaterService.ts", + "src/platform/interpreter/configuration/types.ts", + "src/platform/interpreter/contracts.ts", + "src/platform/interpreter/display/index.ts", + "src/platform/interpreter/display/shebangCodeLensProvider.ts", + "src/platform/interpreter/helpers.ts", + "src/platform/interpreter/interpreterService.ts", + "src/platform/interpreter/interpreterVersion.ts", + "src/platform/interpreter/locators/helpers.ts", + "src/platform/interpreter/locators/index.ts", + "src/platform/interpreter/locators/services/baseVirtualEnvService.ts", + "src/platform/interpreter/locators/services/cacheableLocatorService.ts", + "src/platform/interpreter/locators/services/conda.ts", + "src/platform/interpreter/locators/services/condaEnvFileService.ts", + "src/platform/interpreter/locators/services/condaEnvService.ts", + "src/platform/interpreter/locators/services/condaHelper.ts", + "src/platform/interpreter/locators/services/condaService.ts", + "src/platform/interpreter/locators/services/currentPathService.ts", + "src/platform/interpreter/locators/services/globalVirtualEnvService.ts", + "src/platform/interpreter/locators/services/KnownPathsService.ts", + "src/platform/interpreter/locators/services/pipEnvService.ts", + "src/platform/interpreter/locators/services/windowsRegistryService.ts", + "src/platform/interpreter/locators/services/workspaceVirtualEnvService.ts", + "src/platform/interpreter/serviceRegistry.ts", + "src/platform/interpreter/virtualEnvs/index.ts", + "src/platform/interpreter/virtualEnvs/types.ts", + "src/platform/ioc/container.ts", + "src/platform/ioc/index.ts", + "src/platform/ioc/serviceManager.ts", + "src/platform/ioc/types.ts", + "src/platform/jupyter/provider.ts", + "src/platform/language/braceCounter.ts", + "src/platform/language/characters.ts", + "src/platform/language/characterStream.ts", + "src/platform/language/iterableTextRange.ts", + "src/platform/language/textBuilder.ts", + "src/platform/language/textIterator.ts", + "src/platform/language/textRangeCollection.ts", + "src/platform/language/tokenizer.ts", + "src/platform/language/types.ts", + "src/platform/language/unicode.ts", + "src/platform/languageServices/jediProxyFactory.ts", + "src/platform/languageServices/proposeLanguageServerBanner.ts", + "src/platform/linters/bandit.ts", + "src/platform/linters/baseLinter.ts", + "src/platform/linters/errorHandlers/baseErrorHandler.ts", + "src/platform/linters/errorHandlers/errorHandler.ts", + "src/platform/linters/errorHandlers/notInstalled.ts", + "src/platform/linters/errorHandlers/standard.ts", + "src/platform/linters/flake8.ts", + "src/platform/linters/linterCommands.ts", + "src/platform/linters/linterInfo.ts", + "src/platform/linters/linterManager.ts", + "src/platform/linters/lintingEngine.ts", + "src/platform/linters/mypy.ts", + "src/platform/linters/pycodestyle.ts", + "src/platform/linters/prospector.ts", + "src/platform/linters/pydocstyle.ts", + "src/platform/linters/pylama.ts", + "src/platform/linters/pylint.ts", + "src/platform/linters/serviceRegistry.ts", + "src/platform/linters/types.ts", + "src/platform/providers/codeActionsProvider.ts", + "src/platform/providers/completionProvider.ts", + "src/platform/providers/completionSource.ts", + "src/platform/providers/definitionProvider.ts", + "src/platform/providers/docStringFoldingProvider.ts", + "src/platform/providers/formatProvider.ts", + "src/platform/providers/hoverProvider.ts", + "src/platform/providers/importSortProvider.ts", + "src/platform/providers/itemInfoSource.ts", + "src/platform/providers/jediProxy.ts", + "src/platform/providers/linterProvider.ts", + "src/platform/providers/objectDefinitionProvider.ts", + "src/platform/providers/providerUtilities.ts", + "src/platform/providers/referenceProvider.ts", + "src/platform/providers/renameProvider.ts", + "src/platform/providers/replProvider.ts", + "src/platform/providers/serviceRegistry.ts", + "src/platform/providers/signatureProvider.ts", + "src/platform/providers/simpleRefactorProvider.ts", + "src/platform/providers/symbolProvider.ts", + "src/platform/providers/terminalProvider.ts", + "src/platform/providers/types.ts", + "src/platform/refactor/contracts.ts", + "src/platform/refactor/proxy.ts", + "src/telemetry/constants.ts", + "src/telemetry/index.ts", + "src/telemetry/types.ts", + "src/telemetry/vscode-extension-telemetry.d.ts", + "src/platform/terminals/activation.ts", + "src/platform/terminals/codeExecution/codeExecutionManager.ts", + "src/platform/terminals/codeExecution/djangoContext.ts", + "src/platform/terminals/codeExecution/djangoShellCodeExecution.ts", + "src/platform/terminals/codeExecution/helper.ts", + "src/platform/terminals/codeExecution/repl.ts", + "src/platform/terminals/codeExecution/terminalCodeExecution.ts", + "src/platform/terminals/serviceRegistry.ts", + "src/platform/terminals/types.ts", + "src/platform/typeFormatters/blockFormatProvider.ts", + "src/platform/typeFormatters/codeBlockFormatProvider.ts", + "src/platform/typeFormatters/contracts.ts", + "src/platform/typeFormatters/dispatcher.ts", + "src/platform/typeFormatters/onEnterFormatter.ts", + "src/platform/testing/codeLenses/main.ts", + "src/platform/testing/codeLenses/testFiles.ts", + "src/platform/testing/common/argumentsHelper.ts", + "src/platform/testing/common/constants.ts", + "src/platform/testing/common/debugLauncher.ts", + "src/platform/testing/common/managers/baseTestManager.ts", + "src/platform/testing/common/managers/testConfigurationManager.ts", + "src/platform/testing/common/runner.ts", + "src/platform/testing/common/services/configSettingService.ts", + "src/platform/testing/common/services/storageService.ts", + "src/platform/testing/common/services/testManagerService.ts", + "src/platform/testing/common/services/testResultsService.ts", + "src/platform/testing/common/services/workspaceTestManagerService.ts", + "src/platform/testing/common/testUtils.ts", + "src/platform/testing/common/testVisitors/flatteningVisitor.ts", + "src/platform/testing/common/testVisitors/folderGenerationVisitor.ts", + "src/platform/testing/common/testVisitors/resultResetVisitor.ts", + "src/platform/testing/common/types.ts", + "src/platform/testing/common/xUnitParser.ts", + "src/platform/testing/configuration.ts", + "src/platform/testing/configurationFactory.ts", + "src/platform/testing/display/main.ts", + "src/platform/testing/display/picker.ts", + "src/platform/testing/main.ts", + "src/platform/testing/nosetest/main.ts", + "src/platform/testing/nosetest/runner.ts", + "src/platform/testing/nosetest/services/argsService.ts", + "src/platform/testing/nosetest/services/discoveryService.ts", + "src/platform/testing/nosetest/services/parserService.ts", + "src/platform/testing/nosetest/testConfigurationManager.ts", + "src/platform/testing/pytest/main.ts", + "src/platform/testing/pytest/runner.ts", + "src/platform/testing/pytest/services/argsService.ts", + "src/platform/testing/pytest/services/discoveryService.ts", + "src/platform/testing/pytest/services/parserService.ts", + "src/platform/testing/pytest/testConfigurationManager.ts", + "src/platform/testing/serviceRegistry.ts", + "src/platform/testing/types.ts", + "src/platform/testing/unittest/helper.ts", + "src/platform/testing/unittest/main.ts", + "src/platform/testing/unittest/runner.ts", + "src/platform/testing/unittest/services/argsService.ts", + "src/platform/testing/unittest/services/discoveryService.ts", + "src/platform/testing/unittest/services/parserService.ts", + "src/platform/testing/unittest/socketServer.ts", + "src/platform/testing/unittest/testConfigurationManager.ts", + "src/platform/workspaceSymbols/contracts.ts", + "src/platform/workspaceSymbols/generator.ts", + "src/platform/workspaceSymbols/main.ts", + "src/platform/workspaceSymbols/parser.ts", + "src/platform/workspaceSymbols/provider.ts", "src/server/dummy.ts", "src/test/aaFirstTest/aaFirstTest.test.ts", "src/test/activation/activationService.unit.test.ts", diff --git a/build/tslint-rules/messagesMustBeLocalizedRule.js b/build/tslint-rules/messagesMustBeLocalizedRule.js index 025a3df7262..ebc89b714ab 100644 --- a/build/tslint-rules/messagesMustBeLocalizedRule.js +++ b/build/tslint-rules/messagesMustBeLocalizedRule.js @@ -21,7 +21,8 @@ const methodNames = [ // TODO: Ideally we would not ignore any files. const ignoredFiles = util.getListOfFiles('unlocalizedFiles.json'); const ignoredPrefix = path.normalize('src/test'); -const failureMessage = 'Messages must be localized in the Jupyter Extension (use src/client/common/utils/localize.ts)'; +const failureMessage = + 'Messages must be localized in the Jupyter Extension (use src/platform/common/utils/localize.ts)'; class NoStringLiteralsInMessages extends baseRuleWalker.BaseRuleWalker { visitCallExpression(node) { if (!this.shouldIgnoreNode(node)) { diff --git a/build/unlocalizedFiles.json b/build/unlocalizedFiles.json index 4da3d450af2..6b6f453f009 100644 --- a/build/unlocalizedFiles.json +++ b/build/unlocalizedFiles.json @@ -1,26 +1,26 @@ [ - "src/client/activation/activationService.ts", - "src/client/common/installer/channelManager.ts", - "src/client/common/installer/moduleInstaller.ts", - "src/client/common/installer/productInstaller.ts", - "src/client/debugger/extension/hooks/childProcessAttachService.ts", - "src/client/formatters/baseFormatter.ts", - "src/client/formatters/blackFormatter.ts", - "src/client/interpreter/configuration/pythonPathUpdaterService.ts", - "src/client/linters/errorHandlers/notInstalled.ts", - "src/client/linters/errorHandlers/standard.ts", - "src/client/linters/linterCommands.ts", - "src/client/linters/prospector.ts", - "src/client/providers/importSortProvider.ts", - "src/client/providers/objectDefinitionProvider.ts", - "src/client/providers/simpleRefactorProvider.ts", - "src/client/pythonEnvironments/discovery/locators/services/pipEnvService.ts", - "src/client/terminals/codeExecution/helper.ts", - "src/client/testing/common/debugLauncher.ts", - "src/client/testing/common/managers/baseTestManager.ts", - "src/client/testing/common/services/discovery.ts", - "src/client/testing/configuration.ts", - "src/client/testing/display/main.ts", - "src/client/testing/main.ts", - "src/client/workspaceSymbols/generator.ts" + "src/platform/activation/activationService.ts", + "src/platform/common/installer/channelManager.ts", + "src/platform/common/installer/moduleInstaller.ts", + "src/platform/common/installer/productInstaller.ts", + "src/platform/debugger/extension/hooks/childProcessAttachService.ts", + "src/platform/formatters/baseFormatter.ts", + "src/platform/formatters/blackFormatter.ts", + "src/platform/interpreter/configuration/pythonPathUpdaterService.ts", + "src/platform/linters/errorHandlers/notInstalled.ts", + "src/platform/linters/errorHandlers/standard.ts", + "src/platform/linters/linterCommands.ts", + "src/platform/linters/prospector.ts", + "src/platform/providers/importSortProvider.ts", + "src/platform/providers/objectDefinitionProvider.ts", + "src/platform/providers/simpleRefactorProvider.ts", + "src/platform/pythonEnvironments/discovery/locators/services/pipEnvService.ts", + "src/platform/terminals/codeExecution/helper.ts", + "src/platform/testing/common/debugLauncher.ts", + "src/platform/testing/common/managers/baseTestManager.ts", + "src/platform/testing/common/services/discovery.ts", + "src/platform/testing/configuration.ts", + "src/platform/testing/display/main.ts", + "src/platform/testing/main.ts", + "src/platform/workspaceSymbols/generator.ts" ] diff --git a/build/webpack/common.js b/build/webpack/common.js index 91f73f6f374..be6147ece85 100644 --- a/build/webpack/common.js +++ b/build/webpack/common.js @@ -46,7 +46,7 @@ function getDefaultPlugins(name) { } exports.getDefaultPlugins = getDefaultPlugins; function getListOfExistingModulesInOutDir() { - const outDir = path.join(constants.ExtensionRootDir, 'out', 'client'); + const outDir = path.join(constants.ExtensionRootDir, 'out'); const files = glob.sync('**/*.js', { sync: true, cwd: outDir }); return files.map((filePath) => `./${filePath.slice(0, -3)}`); } diff --git a/build/webpack/webpack.extension.config.js b/build/webpack/webpack.extension.config.js index 895b3d78dd9..a982490f4ec 100644 --- a/build/webpack/webpack.extension.config.js +++ b/build/webpack/webpack.extension.config.js @@ -17,7 +17,7 @@ const config = { mode: 'production', target: 'node', entry: { - extension: './src/client/extension.ts' + extension: './src/extension.ts' }, devtool: 'source-map', node: { @@ -112,7 +112,7 @@ const config = { // ZMQ requires prebuilds to be in our node_modules directory. So recreate the ZMQ structure. // However we don't webpack to manage this, so it was part of the excluded modules. Delete it from there // so at runtime we pick up the original structure. - new removeFilesWebpackPlugin({ after: { include: ['./out/client/node_modules/zeromq.js'], log: false } }), + new removeFilesWebpackPlugin({ after: { include: ['./out/node_modules/zeromq.js'], log: false } }), new copyWebpackPlugin({ patterns: [{ from: './node_modules/zeromq/**/*.js' }] }), new copyWebpackPlugin({ patterns: [{ from: './node_modules/zeromq/**/*.node' }] }), new copyWebpackPlugin({ patterns: [{ from: './node_modules/zeromq/**/*.json' }] }), @@ -134,7 +134,7 @@ const config = { }, output: { filename: '[name].js', - path: path.resolve(constants.ExtensionRootDir, 'out', 'client'), + path: path.resolve(constants.ExtensionRootDir, 'out'), libraryTarget: 'commonjs2', devtoolModuleFilenameTemplate: '../../[resource-path]' } diff --git a/build/webpack/webpack.extension.dependencies.config.js b/build/webpack/webpack.extension.dependencies.config.js index 2df250a1294..5fb2e3c5f69 100644 --- a/build/webpack/webpack.extension.dependencies.config.js +++ b/build/webpack/webpack.extension.dependencies.config.js @@ -82,7 +82,7 @@ const config = { }, output: { filename: '[name].js', - path: path.resolve(constants.ExtensionRootDir, 'out', 'client'), + path: path.resolve(constants.ExtensionRootDir, 'out'), libraryTarget: 'commonjs2', devtoolModuleFilenameTemplate: '../../[resource-path]' } diff --git a/news/3 Code Health/8981.md b/news/3 Code Health/8981.md new file mode 100644 index 00000000000..7ae7b16e23b --- /dev/null +++ b/news/3 Code Health/8981.md @@ -0,0 +1 @@ +Refactor client code into a 'platform' directory and organize serviceRegistry files in a hierarchical structure. diff --git a/package.json b/package.json index 8fc971a584b..7c2758d01fb 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "onNotebook:jupyter-notebook", "onNotebook:interactive" ], - "main": "./out/client/extension", + "main": "./out/extension.js", "capabilities": { "virtualWorkspaces": true, "untrustedWorkspaces": { diff --git a/src/client/constants.ts b/src/client/constants.ts deleted file mode 100644 index 4d3d9e31ae3..00000000000 --- a/src/client/constants.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -import * as path from 'path'; - -// This file is also used by the debug adapter. -// When bundling, the bundle file for the debug adapter ends up elsewhere. -const folderName = path.basename(__dirname); -export const EXTENSION_ROOT_DIR = - folderName === 'client' ? path.join(__dirname, '..', '..') : path.join(__dirname, '..', '..', '..', '..'); - -export const HiddenFileFormatString = '_HiddenFile_{0}.py'; - -export const MillisecondsInADay = 24 * 60 * 60 * 1_000; diff --git a/src/client/datascience/serviceRegistry.ts b/src/client/datascience/serviceRegistry.ts deleted file mode 100644 index 5a35936d85b..00000000000 --- a/src/client/datascience/serviceRegistry.ts +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -'use strict'; -import * as vscode from 'vscode'; -import { IExtensionSingleActivationService, IExtensionSyncActivationService } from '../activation/types'; -import { IPythonExtensionChecker } from '../api/types'; -import { JVSC_EXTENSION_ID } from '../common/constants'; -import { FileSystemPathUtils } from '../common/platform/fs-paths'; -import { IFileSystemPathUtils } from '../common/platform/types'; -import { IConfigurationService } from '../common/types'; -import { ProtocolParser } from '../debugger/extension/helpers/protocolParser'; -import { IProtocolParser } from '../debugger/extension/types'; -import { IServiceManager } from '../ioc/types'; -import { GitHubIssueCommandListener } from '../logging/gitHubIssueCommandListener'; -import { setSharedProperty } from '../telemetry'; -import { Activation } from './activation'; -import { CodeCssGenerator } from './codeCssGenerator'; -import { JupyterCommandLineSelectorCommand } from '../../extension/commands/commandLineSelector'; -import { JupyterServerSelectorCommand } from '../../extension/commands/serverSelector'; -import { DataScienceStartupTime, Identifiers } from './constants'; -import { DataViewer } from './data-viewing/dataViewer'; -import { DataViewerDependencyService } from './data-viewing/dataViewerDependencyService'; -import { DataViewerFactory } from './data-viewing/dataViewerFactory'; -import { JupyterVariableDataProvider } from './data-viewing/jupyterVariableDataProvider'; -import { JupyterVariableDataProviderFactory } from './data-viewing/jupyterVariableDataProviderFactory'; -import { IDataViewer, IDataViewerFactory } from './data-viewing/types'; -import { GlobalActivation } from './datascience'; -import { DebugLocationTrackerFactory } from './debugLocationTrackerFactory'; -import { DataScienceErrorHandler } from '../../extension/errors/errorHandler'; -import { ExportBase } from './export/exportBase'; -import { ExportDialog } from './export/exportDialog'; -import { ExportFileOpener } from './export/exportFileOpener'; -import { ExportInterpreterFinder } from './export/exportInterpreterFinder'; -import { FileConverter } from './export/fileConverter'; -import { ExportToHTML } from './export/exportToHTML'; -import { ExportToPDF } from './export/exportToPDF'; -import { ExportToPython } from './export/exportToPython'; -import { ExportUtil } from './export/exportUtil'; -import { ExportFormat, INbConvertExport, IExportDialog, IFileConverter, IExport } from './export/types'; -import { MultiplexingDebugService } from './multiplexingDebugService'; -import { registerTypes as registerNotebookTypes } from '../../notebooks/serviceRegistry'; -import { registerTypes as registerContextTypes } from './telemetry/serviceRegistry'; -import { registerTypes as registerInteractiveTypes } from '../../interactive-window/serviceRegistry'; -import { registerTypes as registerExtensionTypes } from '../../extension/serviceRegistry'; -import { PlotViewer } from './plotting/plotViewer'; -import { PlotViewerProvider } from './plotting/plotViewerProvider'; -import { StatusProvider } from './statusProvider'; -import { ThemeFinder } from './themeFinder'; -import { - ICellHashListener, - ICodeCssGenerator, - IDataScience, - IDataScienceCommandListener, - IDataScienceErrorHandler, - IDebugLocationTracker, - IJupyterCommandFactory, - IInteractiveWindowDebugger, - IJupyterDebugService, - IJupyterExecution, - IJupyterInterpreterDependencyManager, - IJupyterNotebookProvider, - IJupyterPasswordConnect, - IJupyterServerProvider, - IJupyterServerUriStorage, - IJupyterSessionManagerFactory, - IJupyterSubCommandExecutionService, - IJupyterUriProviderRegistration, - IJupyterVariableDataProvider, - IJupyterVariableDataProviderFactory, - IJupyterVariables, - IKernelDependencyService, - IKernelVariableRequester, - INbConvertExportToPythonService, - INbConvertInterpreterDependencyChecker, - INotebookExporter, - INotebookImporter, - INotebookProvider, - INotebookServer, - IPlotViewer, - IPlotViewerProvider, - IRawNotebookProvider, - IRawNotebookSupportedService, - IStatusProvider, - IThemeFinder -} from './types'; -import { NotebookWatcher } from './variablesView/notebookWatcher'; -import { INotebookWatcher, IVariableViewProvider } from './variablesView/types'; -import { VariableViewActivationService } from './variablesView/variableViewActivationService'; -import { VariableViewProvider } from './variablesView/variableViewProvider'; -import { IApplicationEnvironment } from '../common/application/types'; -import { ExtensionRecommendationService } from './extensionRecommendation'; -import { IDebuggingManager } from '../debugger/types'; -import { DebuggingManager } from '../debugger/jupyter/debuggingManager'; -import { KernelCommandListener } from '../../kernels/kernelCommandListener'; -import { ExportToPythonPlain } from './export/exportToPythonPlain'; -import { KernelProgressReporter } from './progress/kernelProgressReporter'; -import { PreReleaseChecker } from './prereleaseChecker'; -import { InteractiveWindowDebugger } from '../../kernels/debugging/interactiveWindowDebugger'; -import { JupyterDebugService } from '../../kernels/debugging/jupyterDebugService'; -import { isLocalLaunch } from '../../kernels/helpers'; -import { JupyterExporter } from '../../kernels/jupyter/import-export/jupyterExporter'; -import { JupyterImporter } from '../../kernels/jupyter/import-export/jupyterImporter'; -import { JupyterCommandFactory } from '../../kernels/jupyter/interpreter/jupyterCommand'; -import { JupyterInterpreterDependencyService } from '../../kernels/jupyter/interpreter/jupyterInterpreterDependencyService'; -import { JupyterInterpreterOldCacheStateStore } from '../../kernels/jupyter/interpreter/jupyterInterpreterOldCacheStateStore'; -import { JupyterInterpreterSelectionCommand } from '../../kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand'; -import { JupyterInterpreterSelector } from '../../kernels/jupyter/interpreter/jupyterInterpreterSelector'; -import { JupyterInterpreterService } from '../../kernels/jupyter/interpreter/jupyterInterpreterService'; -import { MigrateJupyterInterpreterStateService, JupyterInterpreterStateStore } from '../../kernels/jupyter/interpreter/jupyterInterpreterStateStore'; -import { JupyterInterpreterSubCommandExecutionService } from '../../kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService'; -import { NbConvertExportToPythonService } from '../../kernels/jupyter/interpreter/nbconvertExportToPythonService'; -import { NbConvertInterpreterDependencyChecker } from '../../kernels/jupyter/interpreter/nbconvertInterpreterDependencyChecker'; -import { CellOutputMimeTypeTracker } from '../../kernels/jupyter/jupyterCellOutputMimeTypeTracker'; -import { JupyterKernelService } from '../../kernels/jupyter/jupyterKernelService'; -import { JupyterCommandLineSelector } from '../../kernels/jupyter/launcher/commandLineSelector'; -import { JupyterNotebookProvider } from '../../kernels/jupyter/launcher/jupyterNotebookProvider'; -import { JupyterPasswordConnect } from '../../kernels/jupyter/launcher/jupyterPasswordConnect'; -import { HostJupyterExecution } from '../../kernels/jupyter/launcher/liveshare/hostJupyterExecution'; -import { HostJupyterServer } from '../../kernels/jupyter/launcher/liveshare/hostJupyterServer'; -import { NotebookProvider } from '../../kernels/jupyter/launcher/notebookProvider'; -import { NotebookServerProvider } from '../../kernels/jupyter/launcher/notebookServerProvider'; -import { NotebookStarter } from '../../kernels/jupyter/launcher/notebookStarter'; -import { JupyterServerUriStorage } from '../../kernels/jupyter/launcher/serverUriStorage'; -import { JupyterServerSelector } from '../../kernels/jupyter/serverSelector'; -import { JupyterSessionManagerFactory } from '../../kernels/jupyter/session/jupyterSessionManagerFactory'; -import { KernelDependencyService } from '../../kernels/kernelDependencyService'; -import { JupyterPaths } from '../../kernels/raw/finder/jupyterPaths'; -import { LocalKernelFinder } from '../../kernels/raw/finder/localKernelFinder'; -import { LocalKnownPathKernelSpecFinder } from '../../kernels/raw/finder/localKnownPathKernelSpecFinder'; -import { LocalPythonAndRelatedNonPythonKernelSpecFinder } from '../../kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder'; -import { RemoteKernelFinder } from '../../kernels/raw/finder/remoteKernelFinder'; -import { KernelEnvironmentVariablesService } from '../../kernels/raw/launcher/kernelEnvVarsService'; -import { KernelLauncher } from '../../kernels/raw/launcher/kernelLauncher'; -import { HostRawNotebookProvider } from '../../kernels/raw/session/hostRawNotebookProvider'; -import { RawNotebookSupportedService } from '../../kernels/raw/session/rawNotebookSupportedService'; -import { IKernelLauncher, ILocalKernelFinder, IRemoteKernelFinder } from '../../kernels/raw/types'; -import { DebuggerVariableRegistration } from '../../kernels/variables/debuggerVariableRegistration'; -import { DebuggerVariables } from '../../kernels/variables/debuggerVariables'; -import { JupyterVariables } from '../../kernels/variables/jupyterVariables'; -import { KernelVariables } from '../../kernels/variables/kernelVariables'; -import { PreWarmActivatedJupyterEnvironmentVariables } from '../../kernels/variables/preWarmVariables'; -import { PythonVariablesRequester } from '../../kernels/variables/pythonVariableRequester'; -import { ProgressReporter } from './progress/progressReporter'; -import { IPyWidgetMessageDispatcherFactory } from '../../kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcherFactory'; -import { NotebookIPyWidgetCoordinator } from '../../kernels/ipywidgets-message-coordination/notebookIPyWidgetCoordinator'; -import { JupyterUriProviderRegistration } from '../../kernels/jupyter/jupyterUriProviderRegistration'; -import { PreferredRemoteKernelIdProvider } from '../../kernels/raw/finder/preferredRemoteKernelIdProvider'; -import { LogReplayService } from '../../intellisense/logReplayService'; - -// README: Did you make sure "dataScienceIocContainer.ts" has also been updated appropriately? - -// eslint-disable-next-line -export function registerTypes(serviceManager: IServiceManager, inNotebookApiExperiment: boolean, isDevMode: boolean) { - const isVSCInsiders = serviceManager.get(IApplicationEnvironment).channel === 'insiders'; - const useVSCodeNotebookAPI = inNotebookApiExperiment; - serviceManager.addSingletonInstance(DataScienceStartupTime, Date.now()); - serviceManager.addSingleton(IRawNotebookSupportedService, RawNotebookSupportedService); - - const packageJson: { engines: { vscode: string } } | undefined = vscode.extensions.getExtension(JVSC_EXTENSION_ID)?.packageJSON; - const isInsiderVersion = packageJson?.engines?.vscode?.toLowerCase()?.endsWith('insider'); - setSharedProperty('isInsiderExtension', isVSCInsiders && isInsiderVersion ? 'true' : 'false'); - - // This will ensure all subsequent telemetry will get the context of whether it is a custom/native/old notebook editor. - // This is temporary, and once we ship native editor this needs to be removed. - setSharedProperty('ds_notebookeditor', useVSCodeNotebookAPI ? 'native' : 'custom'); - const isLocalConnection = isLocalLaunch(serviceManager.get(IConfigurationService)); - setSharedProperty('localOrRemoteConnection', isLocalConnection ? 'local' : 'remote'); - const isPythonExtensionInstalled = serviceManager.get(IPythonExtensionChecker); - setSharedProperty('isPythonExtensionInstalled', isPythonExtensionInstalled.isPythonExtensionInstalled ? 'true' : 'false'); - const rawService = serviceManager.get(IRawNotebookSupportedService); - setSharedProperty('rawKernelSupported', rawService.isSupported ? 'true' : 'false'); - - // This condition is temporary. - serviceManager.addSingleton(IDataScienceErrorHandler, DataScienceErrorHandler); - serviceManager.add(IDataViewer, DataViewer); - serviceManager.addSingleton(NotebookIPyWidgetCoordinator, NotebookIPyWidgetCoordinator); - serviceManager.add(IJupyterCommandFactory, JupyterCommandFactory); - serviceManager.add(INotebookExporter, JupyterExporter); - serviceManager.add(INotebookImporter, JupyterImporter); - serviceManager.add(INotebookServer, HostJupyterServer); - serviceManager.addSingleton(PreferredRemoteKernelIdProvider, PreferredRemoteKernelIdProvider); - serviceManager.addSingleton(IRawNotebookProvider, HostRawNotebookProvider); - serviceManager.addSingleton(IJupyterNotebookProvider, JupyterNotebookProvider); - serviceManager.add(IPlotViewer, PlotViewer); - serviceManager.addSingleton(IKernelLauncher, KernelLauncher); - serviceManager.addSingleton(KernelEnvironmentVariablesService, KernelEnvironmentVariablesService); - serviceManager.addSingleton(ILocalKernelFinder, LocalKernelFinder); - serviceManager.addSingleton(JupyterPaths, JupyterPaths); - serviceManager.addSingleton(LocalKnownPathKernelSpecFinder, LocalKnownPathKernelSpecFinder); - serviceManager.addSingleton(LocalPythonAndRelatedNonPythonKernelSpecFinder, LocalPythonAndRelatedNonPythonKernelSpecFinder); - serviceManager.addSingleton(IRemoteKernelFinder, RemoteKernelFinder); - serviceManager.addSingleton(DataViewerDependencyService, DataViewerDependencyService); - serviceManager.addSingleton(ICodeCssGenerator, CodeCssGenerator); - serviceManager.addSingleton(IDataScience, GlobalActivation); - serviceManager.addSingleton(IVariableViewProvider, VariableViewProvider); - serviceManager.addSingleton(IDataScienceCommandListener, GitHubIssueCommandListener); - serviceManager.addSingleton(IDataViewerFactory, DataViewerFactory); - serviceManager.addSingleton(IDebugLocationTracker, DebugLocationTrackerFactory); - serviceManager.addSingleton(IExtensionSingleActivationService, Activation); - serviceManager.addSingleton(IExtensionSingleActivationService, CellOutputMimeTypeTracker); - serviceManager.addSingleton(IExtensionSingleActivationService, JupyterInterpreterSelectionCommand); - serviceManager.addSingleton(IExtensionSingleActivationService, PreWarmActivatedJupyterEnvironmentVariables); - serviceManager.addSingleton(IExtensionSingleActivationService, MigrateJupyterInterpreterStateService); - serviceManager.addSingleton(IExtensionSingleActivationService, VariableViewActivationService); - if (isDevMode) { - serviceManager.addSingleton(IExtensionSingleActivationService, LogReplayService); - } - serviceManager.addSingleton(IDataScienceCommandListener, KernelCommandListener); - serviceManager.addSingleton(IInteractiveWindowDebugger, InteractiveWindowDebugger, undefined, [ICellHashListener]); - serviceManager.addSingleton(IJupyterExecution, HostJupyterExecution); - serviceManager.addSingleton(IJupyterPasswordConnect, JupyterPasswordConnect); - serviceManager.addSingleton(IJupyterSessionManagerFactory, JupyterSessionManagerFactory); - serviceManager.addSingleton(IExtensionSingleActivationService, DebuggerVariableRegistration); - serviceManager.addSingleton(IJupyterVariables, JupyterVariables, Identifiers.ALL_VARIABLES); - serviceManager.addSingleton(IJupyterVariables, KernelVariables, Identifiers.KERNEL_VARIABLES); - serviceManager.addSingleton(IJupyterVariables, DebuggerVariables, Identifiers.DEBUGGER_VARIABLES); - serviceManager.addSingleton(IKernelVariableRequester, PythonVariablesRequester, Identifiers.PYTHON_VARIABLES_REQUESTER); - serviceManager.addSingleton(IPlotViewerProvider, PlotViewerProvider); - serviceManager.addSingleton(IStatusProvider, StatusProvider); - serviceManager.addSingleton(IThemeFinder, ThemeFinder); - serviceManager.addSingleton(JupyterCommandLineSelector, JupyterCommandLineSelector); - serviceManager.addSingleton(JupyterCommandLineSelectorCommand, JupyterCommandLineSelectorCommand); - serviceManager.addSingleton(JupyterInterpreterDependencyService, JupyterInterpreterDependencyService); - serviceManager.addSingleton(INbConvertInterpreterDependencyChecker, NbConvertInterpreterDependencyChecker); - serviceManager.addSingleton(INbConvertExportToPythonService, NbConvertExportToPythonService); - serviceManager.addSingleton(JupyterInterpreterOldCacheStateStore, JupyterInterpreterOldCacheStateStore); - serviceManager.addSingleton(JupyterInterpreterSelector, JupyterInterpreterSelector); - serviceManager.addSingleton(JupyterInterpreterService, JupyterInterpreterService); - serviceManager.addSingleton(JupyterInterpreterStateStore, JupyterInterpreterStateStore); - serviceManager.addSingleton(JupyterServerSelector, JupyterServerSelector); - serviceManager.addSingleton(JupyterServerSelectorCommand, JupyterServerSelectorCommand); - serviceManager.addSingleton(JupyterKernelService, JupyterKernelService); - serviceManager.addSingleton(NotebookStarter, NotebookStarter); - serviceManager.addSingleton(ProgressReporter, ProgressReporter); - serviceManager.addSingleton(INotebookProvider, NotebookProvider); - serviceManager.addSingleton(IJupyterServerProvider, NotebookServerProvider); - serviceManager.addSingleton(IPyWidgetMessageDispatcherFactory, IPyWidgetMessageDispatcherFactory); - serviceManager.addSingleton(IJupyterInterpreterDependencyManager, JupyterInterpreterSubCommandExecutionService); - serviceManager.addSingleton(IJupyterSubCommandExecutionService, JupyterInterpreterSubCommandExecutionService); - serviceManager.addSingleton(IKernelDependencyService, KernelDependencyService); - serviceManager.add(IProtocolParser, ProtocolParser); - serviceManager.addSingleton(IJupyterDebugService, MultiplexingDebugService, Identifiers.MULTIPLEXING_DEBUGSERVICE); - serviceManager.addSingleton(IJupyterDebugService, JupyterDebugService, Identifiers.RUN_BY_LINE_DEBUGSERVICE); - serviceManager.add(IJupyterVariableDataProvider, JupyterVariableDataProvider); - serviceManager.addSingleton(IJupyterVariableDataProviderFactory, JupyterVariableDataProviderFactory); - serviceManager.addSingleton(IFileConverter, FileConverter); - serviceManager.addSingleton(ExportInterpreterFinder, ExportInterpreterFinder); - serviceManager.addSingleton(ExportFileOpener, ExportFileOpener); - serviceManager.addSingleton(INbConvertExport, ExportToPDF, ExportFormat.pdf); - serviceManager.addSingleton(INbConvertExport, ExportToHTML, ExportFormat.html); - serviceManager.addSingleton(INbConvertExport, ExportToPython, ExportFormat.python); - serviceManager.addSingleton(INbConvertExport, ExportBase, 'Export Base'); - serviceManager.addSingleton(IExport, ExportToPythonPlain, ExportFormat.python); - serviceManager.addSingleton(ExportUtil, ExportUtil); - serviceManager.addSingleton(IExportDialog, ExportDialog); - serviceManager.addSingleton(IJupyterUriProviderRegistration, JupyterUriProviderRegistration); - serviceManager.addSingleton(IFileSystemPathUtils, FileSystemPathUtils); - serviceManager.addSingleton(IJupyterServerUriStorage, JupyterServerUriStorage); - serviceManager.addSingleton(INotebookWatcher, NotebookWatcher); - serviceManager.addSingleton(IExtensionSyncActivationService, ExtensionRecommendationService); - serviceManager.addSingleton(IExtensionSyncActivationService, KernelProgressReporter); - serviceManager.addSingleton(IDebuggingManager, DebuggingManager, undefined, [IExtensionSingleActivationService]); - serviceManager.addSingleton(IExtensionSingleActivationService, PreReleaseChecker); - - registerNotebookTypes(serviceManager); - registerContextTypes(serviceManager); - registerInteractiveTypes(serviceManager); - registerExtensionTypes(serviceManager); -} diff --git a/src/client/extension.ts b/src/client/extension.ts deleted file mode 100644 index 49d408a6c08..00000000000 --- a/src/client/extension.ts +++ /dev/null @@ -1,167 +0,0 @@ -'use strict'; - -/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */ - -// This line should always be right on top. -/* eslint-disable @typescript-eslint/no-explicit-any */ -if ((Reflect as any).metadata === undefined) { - require('reflect-metadata'); -} - -// Initialize the logger first. -require('./common/logger'); - -//=============================================== -// We start tracking the extension's startup time at this point. The -// locations at which we record various Intervals are marked below in -// the same way as this. - -const durations: Record = {}; -import { StopWatch } from './common/utils/stopWatch'; -// Do not move this line of code (used to measure extension load times). -const stopWatch = new StopWatch(); - -//=============================================== -// loading starts here - -import { ProgressLocation, ProgressOptions, window } from 'vscode'; - -import { buildApi, IExtensionApi } from './api'; -import { IApplicationShell } from './common/application/types'; -import { traceError } from './common/logger'; -import { IAsyncDisposableRegistry, IExtensionContext } from './common/types'; -import { createDeferred } from './common/utils/async'; -import { Common } from './common/utils/localize'; -import { activateComponents } from './extensionActivation'; -import { initializeGlobals } from './extensionInit'; -import { IServiceContainer } from './ioc/types'; -import { sendErrorTelemetry, sendStartupTelemetry } from './startupTelemetry'; -import { noop } from './common/utils/misc'; - -durations.codeLoadingTime = stopWatch.elapsedTime; - -//=============================================== -// loading ends here - -// These persist between activations: -let activatedServiceContainer: IServiceContainer | undefined; - -///////////////////////////// -// public functions - -export async function activate(context: IExtensionContext): Promise { - try { - let api: IExtensionApi; - let ready: Promise; - let serviceContainer: IServiceContainer; - [api, ready, serviceContainer] = await activateUnsafe(context, stopWatch, durations); - // Send the "success" telemetry only if activation did not fail. - // Otherwise Telemetry is send via the error handler. - sendStartupTelemetry(ready, durations, stopWatch, serviceContainer) - // Run in the background. - .ignoreErrors(); - await ready; - return api; - } catch (ex) { - // We want to completely handle the error - // before notifying VS Code. - await handleError(ex, durations); - traceError('Failed to active the Jupyter Extension', ex); - // Disable this, as we don't want Python extension or any other extensions that depend on this to fall over. - // Return a dummy object, to ensure other extension do not fall over. - return { - createBlankNotebook: () => Promise.resolve(), - ready: Promise.resolve(), - registerPythonApi: noop, - registerRemoteServerProvider: noop, - showDataViewer: () => Promise.resolve(), - getKernelService: () => Promise.resolve(undefined) - }; - } -} - -export function deactivate(): Thenable { - // Make sure to shutdown anybody who needs it. - if (activatedServiceContainer) { - const registry = activatedServiceContainer.get(IAsyncDisposableRegistry); - if (registry) { - return registry.dispose(); - } - } - - return Promise.resolve(); -} - -///////////////////////////// -// activation helpers - -// eslint-disable-next-line -async function activateUnsafe( - context: IExtensionContext, - startupStopWatch: StopWatch, - startupDurations: Record -): Promise<[IExtensionApi, Promise, IServiceContainer]> { - const activationDeferred = createDeferred(); - try { - displayProgress(activationDeferred.promise); - startupDurations.startActivateTime = startupStopWatch.elapsedTime; - - //=============================================== - // activation starts here - - const [serviceManager, serviceContainer] = initializeGlobals(context); - activatedServiceContainer = serviceContainer; - const { activationPromise } = await activateComponents(context, serviceManager, serviceContainer); - - //=============================================== - // activation ends here - - startupDurations.endActivateTime = startupStopWatch.elapsedTime; - activationDeferred.resolve(); - - const api = buildApi(activationPromise, serviceManager, serviceContainer, context); - return [api, activationPromise, serviceContainer]; - } finally { - // Make sure that we clear our status message - if (!activationDeferred.completed) { - activationDeferred.reject(); - } - } -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function displayProgress(promise: Promise) { - const progressOptions: ProgressOptions = { location: ProgressLocation.Window, title: Common.loadingExtension() }; - window.withProgress(progressOptions, () => promise).then(noop, noop); -} - -///////////////////////////// -// error handling - -async function handleError(ex: Error, startupDurations: Record) { - notifyUser( - "Extension activation failed, run the 'Developer: Toggle Developer Tools' command for more information." - ); - // Possible logger hasn't initialized either. - console.error('extension activation failed', ex); - traceError('extension activation failed', ex); - await sendErrorTelemetry(ex, startupDurations, activatedServiceContainer); -} - -interface IAppShell { - showErrorMessage(string: string): Promise; -} - -function notifyUser(msg: string) { - try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let appShell: IAppShell = (window as any) as IAppShell; - if (activatedServiceContainer) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - appShell = (activatedServiceContainer.get(IApplicationShell) as any) as IAppShell; - } - appShell.showErrorMessage(msg).ignoreErrors(); - } catch (ex) { - traceError('failed to notify user', ex); - } -} diff --git a/src/client/extensionActivation.ts b/src/client/extensionActivation.ts deleted file mode 100644 index e6a3de9a883..00000000000 --- a/src/client/extensionActivation.ts +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -/* eslint-disable */ -import * as path from 'path'; -import * as fsExtra from 'fs-extra'; -import { commands, env, ExtensionMode, extensions, OutputChannel, UIKind, version, window, workspace } from 'vscode'; - -import { registerTypes as activationRegisterTypes } from './activation/serviceRegistry'; -import { IExtensionActivationManager } from './activation/types'; -import { registerTypes as registerApiTypes } from './api/serviceRegistry'; -import { IApplicationEnvironment, ICommandManager } from './common/application/types'; -import { isTestExecution, STANDARD_OUTPUT_CHANNEL } from './common/constants'; -import { registerTypes as platformRegisterTypes } from './common/platform/serviceRegistry'; -import { IFileSystem } from './common/platform/types'; -import { registerTypes as processRegisterTypes } from './common/process/serviceRegistry'; -import { registerTypes as commonRegisterTypes } from './common/serviceRegistry'; -import { - IConfigurationService, - IExperimentService, - IExtensionContext, - IFeatureDeprecationManager, - IOutputChannel, - IsCodeSpace, - IsDevMode, - IsPreRelease -} from './common/types'; -import * as localize from './common/utils/localize'; -import { noop } from './common/utils/misc'; -import { registerTypes as variableRegisterTypes } from './common/variables/serviceRegistry'; -import { JUPYTER_OUTPUT_CHANNEL, PythonExtension } from './datascience/constants'; -import { addClearCacheCommand } from './datascience/devTools/clearCache'; -import { getJupyterOutputChannel } from './datascience/devTools/jupyterOutputChannel'; -import { registerTypes as dataScienceRegisterTypes } from './datascience/serviceRegistry'; -import { IDataScience } from './datascience/types'; -import { IServiceContainer, IServiceManager } from './ioc/types'; -import { addOutputChannelLogging, setLoggingLevel } from './logging'; -import { registerLoggerTypes } from './logging/serviceRegistry'; -import { setExtensionInstallTelemetryProperties } from './telemetry/extensionInstallTelemetry'; -import { registerTypes as commonRegisterTerminalTypes } from './terminals/serviceRegistry'; -import { registerInstallerTypes } from '../kernels/installer/serviceRegistry'; -import { getDisplayPath } from './common/platform/fs-paths'; - -export async function activateComponents( - context: IExtensionContext, - serviceManager: IServiceManager, - serviceContainer: IServiceContainer -) { - // We will be pulling code over from activateLegacy(). - - return activateLegacy(context, serviceManager, serviceContainer); -} - -///////////////////////////// -// old activation code - -// eslint-disable-next-line -// TODO: Gradually move simple initialization -// and DI registration currently in this function over -// to initializeComponents(). Likewise with complex -// init and activation: move them to activateComponents(). -// See https://github.com/microsoft/vscode-python/issues/10454. - -async function activateLegacy( - context: IExtensionContext, - serviceManager: IServiceManager, - serviceContainer: IServiceContainer -) { - // register "services" - const isDevMode = - !isTestExecution() && - (context.extensionMode === ExtensionMode.Development || - workspace.getConfiguration('jupyter').get('development', false)); - serviceManager.addSingletonInstance(IsDevMode, isDevMode); - const isPreReleasePromise = fsExtra - .readFile(path.join(context.extensionPath, 'package.json'), { encoding: 'utf-8' }) - .then((contents) => { - const packageJSONLive = JSON.parse(contents); - return isDevMode || packageJSONLive?.__metadata?.preRelease; - }); - serviceManager.addSingletonInstance>(IsPreRelease, isPreReleasePromise); - if (isDevMode) { - void commands.executeCommand('setContext', 'jupyter.development', true); - } - addClearCacheCommand(context, isDevMode); - const standardOutputChannel = window.createOutputChannel(localize.OutputChannelNames.jupyter()); - addOutputChannelLogging(standardOutputChannel); - serviceManager.addSingletonInstance(IOutputChannel, standardOutputChannel, STANDARD_OUTPUT_CHANNEL); - serviceManager.addSingletonInstance( - IOutputChannel, - getJupyterOutputChannel(isDevMode, context.subscriptions, standardOutputChannel), - JUPYTER_OUTPUT_CHANNEL - ); - serviceManager.addSingletonInstance(IsCodeSpace, env.uiKind == UIKind.Web); - - // Log env info. - standardOutputChannel.appendLine(`${env.appName} (${version}, ${env.remoteName}, ${env.appHost})`); - standardOutputChannel.appendLine(`Jupyter Extension Version: ${context.extension.packageJSON['version']}.`); - const pythonExtension = extensions.getExtension(PythonExtension); - if (pythonExtension) { - standardOutputChannel.appendLine(`Python Extension Version: ${pythonExtension.packageJSON['version']}.`); - } else { - standardOutputChannel.appendLine('Python Extension not installed.'); - } - if (!workspace.workspaceFolders || workspace.workspaceFolders.length === 0) { - standardOutputChannel.appendLine(`No workspace folder opened.`); - } else if (workspace.workspaceFolders.length === 1) { - standardOutputChannel.appendLine( - `Workspace folder ${getDisplayPath(workspace.workspaceFolders[0].uri.fsPath)}` - ); - } else { - standardOutputChannel.appendLine( - `Multiple Workspace folders opened ${workspace.workspaceFolders - .map((item) => getDisplayPath(item.uri.fsPath)) - .join(', ')}` - ); - } - - // Initialize logging to file if necessary as early as possible - registerLoggerTypes(serviceManager); - - // Core registrations (non-feature specific). - registerApiTypes(serviceManager); - commonRegisterTypes(serviceManager); - platformRegisterTypes(serviceManager); - processRegisterTypes(serviceManager); - - // We need to setup this property before any telemetry is sent - const fs = serviceManager.get(IFileSystem); - await setExtensionInstallTelemetryProperties(fs); - - // Load the two data science experiments that we need to register types - // Await here to keep the register method sync - const experimentService = serviceContainer.get(IExperimentService); - // This must be done first, this guarantees all experiment information has loaded & all telemetry will contain experiment info. - await experimentService.activate(); - experimentService.logExperiments(); - - let useVSCodeNotebookAPI = true; - - const applicationEnv = serviceManager.get(IApplicationEnvironment); - // Feature specific registrations. - variableRegisterTypes(serviceManager); - registerInstallerTypes(serviceManager); - commonRegisterTerminalTypes(serviceManager); - - const configuration = serviceManager.get(IConfigurationService); - // We should start logging using the log level as soon as possible, so set it as soon as we can access the level. - // `IConfigurationService` may depend any of the registered types, so doing it after all registrations are finished. - // XXX Move this *after* abExperiments is activated? - const settings = configuration.getSettings(); - setLoggingLevel(settings.logging.level); - settings.onDidChange(() => { - setLoggingLevel(settings.logging.level); - }); - - // Register datascience types after experiments have loaded. - // To ensure we can register types based on experiments. - dataScienceRegisterTypes(serviceManager, useVSCodeNotebookAPI, isDevMode); - - // Language feature registrations. - activationRegisterTypes(serviceManager); - - // "initialize" "services" - const cmdManager = serviceContainer.get(ICommandManager); - cmdManager.executeCommand('setContext', 'jupyter.vscode.channel', applicationEnv.channel).then(noop, noop); - - // "activate" everything else - - const manager = serviceContainer.get(IExtensionActivationManager); - context.subscriptions.push(manager); - manager.activateSync(); - const activationPromise = manager.activate(); - - // Activate data science features after base features. - const dataScience = serviceManager.get(IDataScience); - const dsActivationPromise = dataScience.activate(); - - const deprecationMgr = serviceContainer.get(IFeatureDeprecationManager); - deprecationMgr.initialize(); - context.subscriptions.push(deprecationMgr); - - return { activationPromise: activationPromise.then(() => dsActivationPromise) }; -} diff --git a/src/client/extensionInit.ts b/src/client/extensionInit.ts deleted file mode 100644 index 28f7594ad82..00000000000 --- a/src/client/extensionInit.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -/* eslint-disable */ - -import { Container } from 'inversify'; -import { Disposable, Memento } from 'vscode'; - -import { GLOBAL_MEMENTO, IDisposableRegistry, IExtensionContext, IMemento, WORKSPACE_MEMENTO } from './common/types'; -import { ServiceContainer } from './ioc/container'; -import { ServiceManager } from './ioc/serviceManager'; -import { IServiceContainer, IServiceManager } from './ioc/types'; - -// The code in this module should do nothing more complex than register -// objects to DI and simple init (e.g. no side effects). That implies -// that constructors are likewise simple and do no work. It also means -// that it is inherently synchronous. - -export function initializeGlobals(context: IExtensionContext): [IServiceManager, IServiceContainer] { - const cont = new Container({ skipBaseClassChecks: true }); - const serviceManager = new ServiceManager(cont); - const serviceContainer = new ServiceContainer(cont); - - serviceManager.addSingletonInstance(IServiceContainer, serviceContainer); - serviceManager.addSingletonInstance(IServiceManager, serviceManager); - - serviceManager.addSingletonInstance(IDisposableRegistry, context.subscriptions); - serviceManager.addSingletonInstance(IMemento, context.globalState, GLOBAL_MEMENTO); - serviceManager.addSingletonInstance(IMemento, context.workspaceState, WORKSPACE_MEMENTO); - serviceManager.addSingletonInstance(IExtensionContext, context); - - return [serviceManager, serviceContainer]; -} diff --git a/src/client/telemetry/types.ts b/src/client/telemetry/types.ts deleted file mode 100644 index 8fd224913f4..00000000000 --- a/src/client/telemetry/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -'use strict'; - -import { IEventNamePropertyMapping } from '../telemetry/index'; -import { EventName } from './constants'; - -export type EditorLoadTelemetry = IEventNamePropertyMapping[EventName.EXTENSION_LOAD]; -export const IImportTracker = Symbol('IImportTracker'); -export interface IImportTracker {} diff --git a/src/datascience-ui/common/cellFactory.ts b/src/datascience-ui/common/cellFactory.ts index da864b316b7..399853b4d2a 100644 --- a/src/datascience-ui/common/cellFactory.ts +++ b/src/datascience-ui/common/cellFactory.ts @@ -4,12 +4,12 @@ 'use strict'; import type * as nbformat from '@jupyterlab/nbformat'; -import { KernelFailure } from '../../client/../extension/errors/errorUtils'; +import { KernelFailure } from '../../platform/errors/errorUtils'; // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires const cloneDeep = require('lodash/cloneDeep'); -import '../../client/common/extensions'; -import { IJupyterSettings } from '../../client/common/types'; -import { CellMatcher } from '../../client/datascience/cellMatcher'; +import '../../platform/common/extensions'; +import { IJupyterSettings } from '../../platform/common/types'; +import { CellMatcher } from '../../platform/datascience/cellMatcher'; import { appendLineFeed, generateMarkdownFromCodeLines, removeLinesFromFrontAndBackNoConcat } from './index'; export function uncommentMagicCommands(line: string): string { @@ -69,7 +69,7 @@ export function createCodeCell(code?: string | string[], options?: boolean | nbf // If we get a string, then no need to append line feeds. Leave as is (to preserve existing functionality). // If we get an array, the append a linefeed. const source = Array.isArray(code) - ? appendLineFeed(code, magicCommandsAsComments ? uncommentMagicCommands : undefined) + ? appendLineFeed(code, '\n', magicCommandsAsComments ? uncommentMagicCommands : undefined) : code; return { cell_type: 'code', @@ -94,6 +94,7 @@ export function generateInteractiveCode(code: string, settings: IJupyterSettings // Uncomment magics while adding linefeeds const withMagicsAndLinefeeds = appendLineFeed( noLeadingOrTrailing, + '\n', settings.magicCommandsAsComments ? uncommentMagicCommands : undefined ); diff --git a/src/datascience-ui/common/index.ts b/src/datascience-ui/common/index.ts index 0f18053d6b1..9ce033ebc44 100644 --- a/src/datascience-ui/common/index.ts +++ b/src/datascience-ui/common/index.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. 'use strict'; import type * as nbformat from '@jupyterlab/nbformat'; -import { noop } from '../../client/common/utils/misc'; +import { noop } from '../../platform/common/utils/misc'; const SingleQuoteMultiline = "'''"; const DoubleQuoteMultiline = '"""'; @@ -105,10 +105,10 @@ export function formatStreamText(str: string): string { return fixCarriageReturn(fixBackspace(str)); } -export function appendLineFeed(arr: string[], modifier?: (s: string) => string) { +export function appendLineFeed(arr: string[], eol: string = '\n', modifier?: (s: string) => string) { return arr.map((s: string, i: number) => { const out = modifier ? modifier(s) : s; - return i === arr.length - 1 ? `${out}` : `${out}\n`; + return i === arr.length - 1 ? `${out}` : `${out}${eol}`; }); } diff --git a/src/datascience-ui/data-explorer/cellFormatter.tsx b/src/datascience-ui/data-explorer/cellFormatter.tsx index 601ad7bedaa..d840a610d7d 100644 --- a/src/datascience-ui/data-explorer/cellFormatter.tsx +++ b/src/datascience-ui/data-explorer/cellFormatter.tsx @@ -5,7 +5,7 @@ import './cellFormatter.css'; import * as React from 'react'; import * as ReactDOMServer from 'react-dom/server'; -import { ColumnType } from '../../client/datascience/data-viewing/types'; +import { ColumnType } from '../../platform/datascience/data-viewing/types'; import { ISlickRow } from './reactSlickGrid'; interface ICellFormatterProps { diff --git a/src/datascience-ui/data-explorer/mainPanel.tsx b/src/datascience-ui/data-explorer/mainPanel.tsx index 10c077357f7..4e6fa6f5cfe 100644 --- a/src/datascience-ui/data-explorer/mainPanel.tsx +++ b/src/datascience-ui/data-explorer/mainPanel.tsx @@ -16,9 +16,9 @@ import { IGetRowsResponse, IGetSliceRequest, IRowsResponse -} from '../../client/datascience/data-viewing/types'; -import { SharedMessages } from '../../client/datascience/messages'; -import { IJupyterExtraSettings } from '../../client/datascience/types'; +} from '../../platform/datascience/data-viewing/types'; +import { SharedMessages } from '../../platform/datascience/messages'; +import { IJupyterExtraSettings } from '../../platform/datascience/types'; import { getLocString, storeLocStrings } from '../react-common/locReactSide'; import { IMessageHandler, PostOffice } from '../react-common/postOffice'; import { Progress } from '../react-common/progress'; diff --git a/src/datascience-ui/data-explorer/reactSlickGrid.tsx b/src/datascience-ui/data-explorer/reactSlickGrid.tsx index 41d9ca5db20..2728625633b 100644 --- a/src/datascience-ui/data-explorer/reactSlickGrid.tsx +++ b/src/datascience-ui/data-explorer/reactSlickGrid.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { ColumnType, IGetSliceRequest, MaxStringCompare } from '../../client/datascience/data-viewing/types'; +import { ColumnType, IGetSliceRequest, MaxStringCompare } from '../../platform/datascience/data-viewing/types'; import { KeyCodes } from '../react-common/constants'; import { measureText } from '../react-common/textMeasure'; import './globalJQueryImports'; @@ -39,7 +39,7 @@ import 'slickgrid/slick.grid.css'; import './reactSlickGrid.css'; import { generateDisplayValue } from './cellFormatter'; import { getLocString } from '../react-common/locReactSide'; -import { buildDataViewerFilterRegex } from '../../client/common/utils/regexp'; +import { buildDataViewerFilterRegex } from '../../platform/common/utils/regexp'; /* WARNING: Do not change the order of these imports. Slick grid MUST be imported after we load jQuery and other stuff from `./globalJQueryImports` diff --git a/src/datascience-ui/data-explorer/sliceControl.tsx b/src/datascience-ui/data-explorer/sliceControl.tsx index b688f6b8b3c..07de9ee99ce 100644 --- a/src/datascience-ui/data-explorer/sliceControl.tsx +++ b/src/datascience-ui/data-explorer/sliceControl.tsx @@ -1,7 +1,7 @@ import { Dropdown, IDropdownOption, ResponsiveMode } from '@fluentui/react'; import * as React from 'react'; -import { IGetSliceRequest } from '../../client/datascience/data-viewing/types'; -import { SliceOperationSource } from '../../client/telemetry/constants'; +import { IGetSliceRequest } from '../../platform/datascience/data-viewing/types'; +import { SliceOperationSource } from '../../telemetry/constants'; import { getLocString } from '../react-common/locReactSide'; import { measureText } from '../react-common/textMeasure'; import { diff --git a/src/datascience-ui/interactive-common/buildSettingsCss.ts b/src/datascience-ui/interactive-common/buildSettingsCss.ts index 6f123e581ac..84db9f52d0d 100644 --- a/src/datascience-ui/interactive-common/buildSettingsCss.ts +++ b/src/datascience-ui/interactive-common/buildSettingsCss.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. 'use strict'; -import { IJupyterExtraSettings } from '../../client/datascience/types'; +import { IJupyterExtraSettings } from '../../platform/datascience/types'; // From a set of data science settings build up any settings that need to be // inserted into our StyleSetter divs some things like pseudo elements diff --git a/src/datascience-ui/interactive-common/mainState.ts b/src/datascience-ui/interactive-common/mainState.ts index 3186434617a..890fdf9c4ba 100644 --- a/src/datascience-ui/interactive-common/mainState.ts +++ b/src/datascience-ui/interactive-common/mainState.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { IJupyterExtraSettings } from '../../client/datascience/types'; +import { IJupyterExtraSettings } from '../../platform/datascience/types'; import { getDefaultSettings } from '../react-common/settingsReactSide'; export enum CursorPos { diff --git a/src/datascience-ui/interactive-common/redux/helpers.ts b/src/datascience-ui/interactive-common/redux/helpers.ts index 9fa5ccc96e8..cb81bc33f44 100644 --- a/src/datascience-ui/interactive-common/redux/helpers.ts +++ b/src/datascience-ui/interactive-common/redux/helpers.ts @@ -4,8 +4,8 @@ 'use strict'; import * as Redux from 'redux'; -import { CssMessages, SharedMessages } from '../../../client/datascience/messages'; -import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../extension/messageTypes'; +import { CssMessages, SharedMessages } from '../../../platform/datascience/messages'; +import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../platform/messageTypes'; import { BaseReduxActionPayload } from '../../../webviews/types'; import { QueueAnotherFunc } from '../../react-common/reduxUtils'; import { CommonActionType, CommonActionTypeMapping } from './reducers/types'; diff --git a/src/datascience-ui/interactive-common/redux/postOffice.ts b/src/datascience-ui/interactive-common/redux/postOffice.ts index fbe36f2009a..069043466a1 100644 --- a/src/datascience-ui/interactive-common/redux/postOffice.ts +++ b/src/datascience-ui/interactive-common/redux/postOffice.ts @@ -3,7 +3,7 @@ 'use strict'; import * as Redux from 'redux'; -import { IInteractiveWindowMapping, IPyWidgetMessages } from '../../../extension/messageTypes'; +import { IInteractiveWindowMapping, IPyWidgetMessages } from '../../../platform/messageTypes'; import { PostOffice } from '../../react-common/postOffice'; import { isAllowedAction, unwrapPostableAction } from './helpers'; import { CommonActionType } from './reducers/types'; diff --git a/src/datascience-ui/interactive-common/redux/reducers/commonEffects.ts b/src/datascience-ui/interactive-common/redux/reducers/commonEffects.ts index 9ae19170bc9..fab40ed7001 100644 --- a/src/datascience-ui/interactive-common/redux/reducers/commonEffects.ts +++ b/src/datascience-ui/interactive-common/redux/reducers/commonEffects.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { InteractiveWindowMessages } from '../../../../extension/messageTypes'; -import { IGetCssResponse } from '../../../../client/datascience/messages'; +import { InteractiveWindowMessages } from '../../../../platform/messageTypes'; +import { IGetCssResponse } from '../../../../platform/datascience/messages'; import { IMainState } from '../../../interactive-common/mainState'; import { storeLocStrings } from '../../../react-common/locReactSide'; import { postActionToExtension } from '../helpers'; diff --git a/src/datascience-ui/interactive-common/redux/reducers/helpers.ts b/src/datascience-ui/interactive-common/redux/reducers/helpers.ts index 558ab70def0..1e63121ef68 100644 --- a/src/datascience-ui/interactive-common/redux/reducers/helpers.ts +++ b/src/datascience-ui/interactive-common/redux/reducers/helpers.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { IJupyterExtraSettings } from '../../../../client/datascience/types'; +import { IJupyterExtraSettings } from '../../../../platform/datascience/types'; import { detectBaseTheme } from '../../../react-common/themeDetector'; export namespace Helpers { diff --git a/src/datascience-ui/interactive-common/redux/reducers/transfer.ts b/src/datascience-ui/interactive-common/redux/reducers/transfer.ts index 2b505f307df..9539df51629 100644 --- a/src/datascience-ui/interactive-common/redux/reducers/transfer.ts +++ b/src/datascience-ui/interactive-common/redux/reducers/transfer.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { InteractiveWindowMessages } from '../../../../extension/messageTypes'; -import { CssMessages } from '../../../../client/datascience/messages'; +import { InteractiveWindowMessages } from '../../../../platform/messageTypes'; +import { CssMessages } from '../../../../platform/datascience/messages'; import { IMainState } from '../../mainState'; import { postActionToExtension } from '../helpers'; import { CommonActionType, CommonReducerArg, ILinkClickAction, IShowDataViewerAction } from './types'; diff --git a/src/datascience-ui/interactive-common/redux/reducers/types.ts b/src/datascience-ui/interactive-common/redux/reducers/types.ts index 7c65f791c49..3d4fd554a1b 100644 --- a/src/datascience-ui/interactive-common/redux/reducers/types.ts +++ b/src/datascience-ui/interactive-common/redux/reducers/types.ts @@ -2,10 +2,13 @@ // Licensed under the MIT License. 'use strict'; -import { NativeKeyboardCommandTelemetry, NativeMouseCommandTelemetry } from '../../../../client/datascience/constants'; -import { IEditorContentChange, InteractiveWindowMessages, IShowDataViewer } from '../../../../extension/messageTypes'; +import { + NativeKeyboardCommandTelemetry, + NativeMouseCommandTelemetry +} from '../../../../platform/datascience/constants'; +import { IEditorContentChange, InteractiveWindowMessages, IShowDataViewer } from '../../../../platform/messageTypes'; import { BaseReduxActionPayload } from '../../../../webviews/types'; -import { IJupyterVariablesRequest } from '../../../../client/datascience/types'; +import { IJupyterVariablesRequest } from '../../../../platform/datascience/types'; import { ActionWithPayload, ReducerArg } from '../../../react-common/reduxUtils'; import { CursorPos, IMainState } from '../../mainState'; diff --git a/src/datascience-ui/interactive-common/redux/reducers/variables.ts b/src/datascience-ui/interactive-common/redux/reducers/variables.ts index 15dbf590c49..e06ec101b73 100644 --- a/src/datascience-ui/interactive-common/redux/reducers/variables.ts +++ b/src/datascience-ui/interactive-common/redux/reducers/variables.ts @@ -2,13 +2,13 @@ // Licensed under the MIT License. 'use strict'; import { Reducer } from 'redux'; -import { IFinishCell, IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../../extension/messageTypes'; +import { IFinishCell, IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../../platform/messageTypes'; import { BaseReduxActionPayload } from '../../../../webviews/types'; import { IJupyterVariable, IJupyterVariablesRequest, IJupyterVariablesResponse -} from '../../../../client/datascience/types'; +} from '../../../../platform/datascience/types'; import { combineReducers, QueuableAction, ReducerArg, ReducerFunc } from '../../../react-common/reduxUtils'; import { postActionToExtension } from '../helpers'; import { diff --git a/src/datascience-ui/interactive-common/redux/store.ts b/src/datascience-ui/interactive-common/redux/store.ts index 5d5f6645b17..f0ac11cec7d 100644 --- a/src/datascience-ui/interactive-common/redux/store.ts +++ b/src/datascience-ui/interactive-common/redux/store.ts @@ -4,7 +4,7 @@ import * as fastDeepEqual from 'fast-deep-equal'; import * as Redux from 'redux'; -import { InteractiveWindowMessages } from '../../../extension/messageTypes'; +import { InteractiveWindowMessages } from '../../../platform/messageTypes'; import { BaseReduxActionPayload } from '../../../webviews/types'; import { IMainState } from '../../interactive-common/mainState'; import { PostOffice } from '../../react-common/postOffice'; diff --git a/src/datascience-ui/interactive-common/variableExplorer.tsx b/src/datascience-ui/interactive-common/variableExplorer.tsx index 555cca0b2e3..07a812c3c8b 100644 --- a/src/datascience-ui/interactive-common/variableExplorer.tsx +++ b/src/datascience-ui/interactive-common/variableExplorer.tsx @@ -7,7 +7,7 @@ import * as fastDeepEqual from 'fast-deep-equal'; import * as React from 'react'; import { RegExpValues } from '../common/constants'; -import { IJupyterVariable } from '../../client/datascience/types'; +import { IJupyterVariable } from '../../platform/datascience/types'; import { getLocString } from '../react-common/locReactSide'; import { IButtonCellValue, VariableExplorerButtonCellFormatter } from './variableExplorerButtonCellFormatter'; import { CellStyle, VariableExplorerCellFormatter } from './variableExplorerCellFormatter'; diff --git a/src/datascience-ui/interactive-common/variableExplorerButtonCellFormatter.tsx b/src/datascience-ui/interactive-common/variableExplorerButtonCellFormatter.tsx index cda13175141..ffe07ceb526 100644 --- a/src/datascience-ui/interactive-common/variableExplorerButtonCellFormatter.tsx +++ b/src/datascience-ui/interactive-common/variableExplorerButtonCellFormatter.tsx @@ -7,7 +7,7 @@ import { Image, ImageName } from '../react-common/image'; import { ImageButton } from '../react-common/imageButton'; import { getLocString } from '../react-common/locReactSide'; -import { IJupyterVariable } from '../../client/datascience/types'; +import { IJupyterVariable } from '../../platform/datascience/types'; import './variableExplorerButtonCellFormatter.css'; export interface IButtonCellValue { diff --git a/src/datascience-ui/interactive-common/variablePanel.tsx b/src/datascience-ui/interactive-common/variablePanel.tsx index 1cb1226f4f6..17b906a9ee1 100644 --- a/src/datascience-ui/interactive-common/variablePanel.tsx +++ b/src/datascience-ui/interactive-common/variablePanel.tsx @@ -4,7 +4,7 @@ import * as React from 'react'; -import { IJupyterVariable } from '../../client/datascience/types'; +import { IJupyterVariable } from '../../platform/datascience/types'; import { VariableExplorer } from './variableExplorer'; export interface IVariablePanelProps { diff --git a/src/datascience-ui/ipywidgets/common/kernel.ts b/src/datascience-ui/ipywidgets/common/kernel.ts index e8b77ac2ef2..b02f021e3af 100644 --- a/src/datascience-ui/ipywidgets/common/kernel.ts +++ b/src/datascience-ui/ipywidgets/common/kernel.ts @@ -7,10 +7,10 @@ import { Kernel, KernelMessage, ServerConnection } from '@jupyterlab/services'; import { KernelConnection } from '@jupyterlab/services/lib/kernel/default'; import type { ISignal, Signal } from '@lumino/signaling'; import * as WebSocketWS from 'ws'; -import { createDeferred, Deferred } from '../../../client/common/utils/async'; -import { deserializeDataViews, serializeDataViews } from '../../../client/common/utils/serializers'; -import { IInteractiveWindowMapping, IPyWidgetMessages } from '../../../extension/messageTypes'; -import { KernelSocketOptions } from '../../../client/datascience/types'; +import { createDeferred, Deferred } from '../../../platform/common/utils/async'; +import { deserializeDataViews, serializeDataViews } from '../../../platform/common/utils/serializers'; +import { IInteractiveWindowMapping, IPyWidgetMessages } from '../../../platform/messageTypes'; +import { KernelSocketOptions } from '../../../platform/datascience/types'; import { logMessageOnlyOnCI } from '../../react-common/logger'; import { IMessageHandler, PostOffice } from '../../react-common/postOffice'; diff --git a/src/datascience-ui/ipywidgets/common/manager.ts b/src/datascience-ui/ipywidgets/common/manager.ts index 9b83b00881e..51116a39b24 100644 --- a/src/datascience-ui/ipywidgets/common/manager.ts +++ b/src/datascience-ui/ipywidgets/common/manager.ts @@ -12,13 +12,13 @@ import * as fastDeepEqual from 'fast-deep-equal'; import 'rxjs/add/operator/concatMap'; import { Observable } from 'rxjs/Observable'; import { ReplaySubject } from 'rxjs/ReplaySubject'; -import { createDeferred, Deferred } from '../../../client/common/utils/async'; +import { createDeferred, Deferred } from '../../../platform/common/utils/async'; import { IInteractiveWindowMapping, InteractiveWindowMessages, IPyWidgetMessages -} from '../../../extension/messageTypes'; -import { KernelSocketOptions } from '../../../client/datascience/types'; +} from '../../../platform/messageTypes'; +import { KernelSocketOptions } from '../../../platform/datascience/types'; import { logMessage, setLogger } from '../../react-common/logger'; import { IMessageHandler, PostOffice } from '../../react-common/postOffice'; import { create as createKernel } from './kernel'; diff --git a/src/datascience-ui/ipywidgets/common/scriptManager.ts b/src/datascience-ui/ipywidgets/common/scriptManager.ts index f51e89b44f5..c6a06663184 100644 --- a/src/datascience-ui/ipywidgets/common/scriptManager.ts +++ b/src/datascience-ui/ipywidgets/common/scriptManager.ts @@ -6,11 +6,11 @@ import * as fastDeepEqual from 'fast-deep-equal'; import { EventEmitter } from 'events'; import * as isonline from 'is-online'; -import '../../../client/common/extensions'; -import { createDeferred, Deferred } from '../../../client/common/utils/async'; -import { IInteractiveWindowMapping, IPyWidgetMessages } from '../../../extension/messageTypes'; -import { SharedMessages } from '../../../client/datascience/messages'; -import { IJupyterExtraSettings } from '../../../client/datascience/types'; +import '../../../platform/common/extensions'; +import { createDeferred, Deferred } from '../../../platform/common/utils/async'; +import { IInteractiveWindowMapping, IPyWidgetMessages } from '../../../platform/messageTypes'; +import { SharedMessages } from '../../../platform/datascience/messages'; +import { IJupyterExtraSettings } from '../../../platform/datascience/types'; import { PostOffice } from '../../react-common/postOffice'; import { warnAboutWidgetVersionsThatAreNotSupported } from '../common/incompatibleWidgetHandler'; import { registerScripts } from '../common/requirejsRegistry'; diff --git a/src/datascience-ui/ipywidgets/common/types.ts b/src/datascience-ui/ipywidgets/common/types.ts index 12dca97daf9..20d1b5bd251 100644 --- a/src/datascience-ui/ipywidgets/common/types.ts +++ b/src/datascience-ui/ipywidgets/common/types.ts @@ -7,7 +7,7 @@ import * as jupyterlab from '@jupyter-widgets/base/lib'; import type { Kernel, KernelMessage } from '@jupyterlab/services'; import type * as nbformat from '@jupyterlab/nbformat'; import { ISignal } from '@lumino/signaling'; -import { IInteractiveWindowMapping } from '../../../extension/messageTypes'; +import { IInteractiveWindowMapping } from '../../../platform/messageTypes'; import { Widget } from '@lumino/widgets'; export interface IMessageSender { diff --git a/src/datascience-ui/ipywidgets/kernel/index.ts b/src/datascience-ui/ipywidgets/kernel/index.ts index ef334ed1e9a..9d543aff741 100644 --- a/src/datascience-ui/ipywidgets/kernel/index.ts +++ b/src/datascience-ui/ipywidgets/kernel/index.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. /* eslint-disable no-console */ import type * as nbformat from '@jupyterlab/nbformat'; -import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../extension/messageTypes'; -import { SharedMessages } from '../../../client/datascience/messages'; +import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../platform/messageTypes'; +import { SharedMessages } from '../../../platform/datascience/messages'; import { logMessage } from '../../react-common/logger'; import { KernelMessagingApi, PostOffice } from '../../react-common/postOffice'; import { WidgetManager } from '../common/manager'; diff --git a/src/datascience-ui/ipywidgets/webViews/container.tsx b/src/datascience-ui/ipywidgets/webViews/container.tsx index d928efe6eee..520d42c7f93 100644 --- a/src/datascience-ui/ipywidgets/webViews/container.tsx +++ b/src/datascience-ui/ipywidgets/webViews/container.tsx @@ -5,9 +5,9 @@ import * as React from 'react'; import { Store } from 'redux'; -import '../../../client/common/extensions'; -import { SharedMessages } from '../../../client/datascience/messages'; -import { IJupyterExtraSettings } from '../../../client/datascience/types'; +import '../../../platform/common/extensions'; +import { SharedMessages } from '../../../platform/datascience/messages'; +import { IJupyterExtraSettings } from '../../../platform/datascience/types'; import { CommonAction, CommonActionType, diff --git a/src/datascience-ui/plot/mainPanel.tsx b/src/datascience-ui/plot/mainPanel.tsx index 0adbe702cae..8cc79d44f94 100644 --- a/src/datascience-ui/plot/mainPanel.tsx +++ b/src/datascience-ui/plot/mainPanel.tsx @@ -7,11 +7,11 @@ import * as React from 'react'; import { Tool, Value } from 'react-svg-pan-zoom'; import * as uuid from 'uuid/v4'; -import { createDeferred } from '../../client/common/utils/async'; -import { RegExpValues } from '../../client/datascience/constants'; -import { SharedMessages } from '../../client/datascience/messages'; -import { IPlotViewerMapping, PlotViewerMessages } from '../../client/datascience/plotting/types'; -import { IJupyterExtraSettings } from '../../client/datascience/types'; +import { createDeferred } from '../../platform/common/utils/async'; +import { RegExpValues } from '../../platform/datascience/constants'; +import { SharedMessages } from '../../platform/datascience/messages'; +import { IPlotViewerMapping, PlotViewerMessages } from '../../platform/datascience/plotting/types'; +import { IJupyterExtraSettings } from '../../platform/datascience/types'; import { storeLocStrings } from '../react-common/locReactSide'; import { IMessageHandler, PostOffice } from '../react-common/postOffice'; import { getDefaultSettings } from '../react-common/settingsReactSide'; diff --git a/src/datascience-ui/react-common/constants.ts b/src/datascience-ui/react-common/constants.ts index 87f269f2e02..ec26f3ddb3f 100644 --- a/src/datascience-ui/react-common/constants.ts +++ b/src/datascience-ui/react-common/constants.ts @@ -1,4 +1,4 @@ -import { OSType } from '../../client/common/utils/platform'; +import { OSType } from '../../platform/common/utils/platform'; // Javascript keyCodes export const KeyCodes = { diff --git a/src/datascience-ui/react-common/postOffice.ts b/src/datascience-ui/react-common/postOffice.ts index 3709fc91bac..dd40d338725 100644 --- a/src/datascience-ui/react-common/postOffice.ts +++ b/src/datascience-ui/react-common/postOffice.ts @@ -5,8 +5,8 @@ import { Observable } from 'rxjs/Observable'; import { Subject } from 'rxjs/Subject'; import { VSCodeEvent } from 'vscode-notebook-renderer/events'; -import { WebviewMessage } from '../../client/common/application/types'; -import { IDisposable } from '../../client/common/types'; +import { WebviewMessage } from '../../platform/common/application/types'; +import { IDisposable } from '../../platform/common/types'; import { logMessage, logMessageOnlyOnCI } from './logger'; export interface IVsCodeApi { diff --git a/src/datascience-ui/react-common/settingsReactSide.ts b/src/datascience-ui/react-common/settingsReactSide.ts index 8e9898c86a6..c88f349bdc7 100644 --- a/src/datascience-ui/react-common/settingsReactSide.ts +++ b/src/datascience-ui/react-common/settingsReactSide.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { IJupyterExtraSettings } from '../../client/datascience/types'; +import { IJupyterExtraSettings } from '../../platform/datascience/types'; export function getDefaultSettings(): IJupyterExtraSettings { // Default settings for tests diff --git a/src/datascience-ui/react-common/styleInjector.tsx b/src/datascience-ui/react-common/styleInjector.tsx index c604ef0049d..530b6f1bf6e 100644 --- a/src/datascience-ui/react-common/styleInjector.tsx +++ b/src/datascience-ui/react-common/styleInjector.tsx @@ -3,8 +3,8 @@ 'use strict'; import * as React from 'react'; -import { CssMessages, IGetCssResponse, SharedMessages } from '../../client/datascience/messages'; -import { IJupyterExtraSettings } from '../../client/datascience/types'; +import { CssMessages, IGetCssResponse, SharedMessages } from '../../platform/datascience/messages'; +import { IJupyterExtraSettings } from '../../platform/datascience/types'; import { IMessageHandler, PostOffice } from './postOffice'; import { detectBaseTheme } from './themeDetector'; diff --git a/src/datascience-ui/variable-view/redux/actions.ts b/src/datascience-ui/variable-view/redux/actions.ts index 50513db480e..b0f356a8a15 100644 --- a/src/datascience-ui/variable-view/redux/actions.ts +++ b/src/datascience-ui/variable-view/redux/actions.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. 'use strict'; -import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../extension/messageTypes'; -import { IJupyterVariable, IJupyterVariablesRequest } from '../../../client/datascience/types'; +import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../platform/messageTypes'; +import { IJupyterVariable, IJupyterVariablesRequest } from '../../../platform/datascience/types'; import { CommonAction, CommonActionType, diff --git a/src/datascience-ui/variable-view/redux/mapping.ts b/src/datascience-ui/variable-view/redux/mapping.ts index bffc5bebc78..538a052862d 100644 --- a/src/datascience-ui/variable-view/redux/mapping.ts +++ b/src/datascience-ui/variable-view/redux/mapping.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../extension/messageTypes'; +import { IInteractiveWindowMapping, InteractiveWindowMessages } from '../../../platform/messageTypes'; import { BaseReduxActionPayload } from '../../../webviews/types'; import { IMainState } from '../../interactive-common/mainState'; import { CommonActionType, CommonActionTypeMapping } from '../../interactive-common/redux/reducers/types'; diff --git a/src/datascience-ui/variable-view/redux/reducers/index.ts b/src/datascience-ui/variable-view/redux/reducers/index.ts index 597d4750654..8e1d4e14a9b 100644 --- a/src/datascience-ui/variable-view/redux/reducers/index.ts +++ b/src/datascience-ui/variable-view/redux/reducers/index.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { InteractiveWindowMessages } from '../../../../extension/messageTypes'; -import { CssMessages, SharedMessages } from '../../../../client/datascience/messages'; +import { InteractiveWindowMessages } from '../../../../platform/messageTypes'; +import { CssMessages, SharedMessages } from '../../../../platform/datascience/messages'; import { CommonEffects } from '../../../interactive-common/redux/reducers/commonEffects'; import { Transfer } from '../../../interactive-common/redux/reducers/transfer'; import { CommonActionType } from '../../../interactive-common/redux/reducers/types'; diff --git a/src/extension.ts b/src/extension.ts new file mode 100644 index 00000000000..03b274e862c --- /dev/null +++ b/src/extension.ts @@ -0,0 +1,351 @@ +'use strict'; + +/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */ + +// This line should always be right on top. +/* eslint-disable @typescript-eslint/no-explicit-any */ +if ((Reflect as any).metadata === undefined) { + require('reflect-metadata'); +} + +// Initialize the logger first. +require('./platform/common/logger'); + +//=============================================== +// We start tracking the extension's startup time at this point. The +// locations at which we record various Intervals are marked below in +// the same way as this. + +const durations: Record = {}; +import { StopWatch } from './platform/common/utils/stopWatch'; +// Do not move this line of code (used to measure extension load times). +const stopWatch = new StopWatch(); + +//=============================================== +// loading starts here + +import { + commands, + Disposable, + env, + ExtensionMode, + extensions, + Memento, + OutputChannel, + ProgressLocation, + ProgressOptions, + UIKind, + version, + window, + workspace +} from 'vscode'; +import * as fsExtra from 'fs-extra'; +import * as path from 'path'; +import { buildApi, IExtensionApi } from './platform/api'; +import { IApplicationEnvironment, ICommandManager } from './platform/common/application/types'; +import { traceError } from './platform/common/logger'; +import { + GLOBAL_MEMENTO, + IAsyncDisposableRegistry, + IConfigurationService, + IDisposableRegistry, + IExperimentService, + IExtensionContext, + IFeatureDeprecationManager, + IMemento, + IOutputChannel, + IsCodeSpace, + IsDevMode, + IsPreRelease, + WORKSPACE_MEMENTO +} from './platform/common/types'; +import { createDeferred } from './platform/common/utils/async'; +import { Common, OutputChannelNames } from './platform/common/utils/localize'; +import { IServiceContainer, IServiceManager } from './platform/ioc/types'; +import { sendErrorTelemetry, sendStartupTelemetry } from './platform/startupTelemetry'; +import { noop } from './platform/common/utils/misc'; +import { JUPYTER_OUTPUT_CHANNEL, PythonExtension } from './datascience-ui/common/constants'; +import { registerTypes as registerPlatformTypes } from './platform/serviceRegistry'; +import { registerTypes as registerKernelTypes } from './kernels/serviceRegistry'; +import { registerTypes as registerNotebookTypes } from './notebooks/serviceRegistry'; +import { registerTypes as registerInteractiveTypes } from './interactive-window/serviceRegistry'; +import { registerTypes as registerWebviewTypes } from './webviews/serviceRegistry'; +import { registerTypes as registerTelemetryTypes } from './telemetry/serviceRegistry'; +import { registerTypes as registerIntellisenseTypes } from './intellisense/serviceRegistry'; +import { IExtensionActivationManager } from './platform/activation/types'; +import { isTestExecution, STANDARD_OUTPUT_CHANNEL } from './platform/common/constants'; +import { getDisplayPath } from './platform/common/platform/fs-paths'; +import { IFileSystem } from './platform/common/platform/types'; +import { getJupyterOutputChannel } from './platform/devTools/jupyterOutputChannel'; +import { IDataScience } from './platform/datascience/types'; +import { addOutputChannelLogging, setLoggingLevel } from './platform/logging'; +import { setExtensionInstallTelemetryProperties } from './telemetry/extensionInstallTelemetry'; +import { Container } from 'inversify/lib/container/container'; +import { ServiceContainer } from './platform/ioc/container'; +import { ServiceManager } from './platform/ioc/serviceManager'; + +durations.codeLoadingTime = stopWatch.elapsedTime; + +//=============================================== +// loading ends here + +// These persist between activations: +let activatedServiceContainer: IServiceContainer | undefined; + +///////////////////////////// +// public functions + +export async function activate(context: IExtensionContext): Promise { + try { + let api: IExtensionApi; + let ready: Promise; + let serviceContainer: IServiceContainer; + [api, ready, serviceContainer] = await activateUnsafe(context, stopWatch, durations); + // Send the "success" telemetry only if activation did not fail. + // Otherwise Telemetry is send via the error handler. + sendStartupTelemetry(ready, durations, stopWatch, serviceContainer) + // Run in the background. + .ignoreErrors(); + await ready; + return api; + } catch (ex) { + // We want to completely handle the error + // before notifying VS Code. + await handleError(ex, durations); + traceError('Failed to active the Jupyter Extension', ex); + // Disable this, as we don't want Python extension or any other extensions that depend on this to fall over. + // Return a dummy object, to ensure other extension do not fall over. + return { + createBlankNotebook: () => Promise.resolve(), + ready: Promise.resolve(), + registerPythonApi: noop, + registerRemoteServerProvider: noop, + showDataViewer: () => Promise.resolve(), + getKernelService: () => Promise.resolve(undefined) + }; + } +} + +export function deactivate(): Thenable { + // Make sure to shutdown anybody who needs it. + if (activatedServiceContainer) { + const registry = activatedServiceContainer.get(IAsyncDisposableRegistry); + if (registry) { + return registry.dispose(); + } + } + + return Promise.resolve(); +} + +///////////////////////////// +// activation helpers + +// eslint-disable-next-line +async function activateUnsafe( + context: IExtensionContext, + startupStopWatch: StopWatch, + startupDurations: Record +): Promise<[IExtensionApi, Promise, IServiceContainer]> { + const activationDeferred = createDeferred(); + try { + displayProgress(activationDeferred.promise); + startupDurations.startActivateTime = startupStopWatch.elapsedTime; + + //=============================================== + // activation starts here + + const [serviceManager, serviceContainer] = initializeGlobals(context); + activatedServiceContainer = serviceContainer; + const { activationPromise } = await activateComponents(context, serviceManager, serviceContainer); + + //=============================================== + // activation ends here + + startupDurations.endActivateTime = startupStopWatch.elapsedTime; + activationDeferred.resolve(); + + const api = buildApi(activationPromise, serviceManager, serviceContainer, context); + return [api, activationPromise, serviceContainer]; + } finally { + // Make sure that we clear our status message + if (!activationDeferred.completed) { + activationDeferred.reject(); + } + } +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function displayProgress(promise: Promise) { + const progressOptions: ProgressOptions = { location: ProgressLocation.Window, title: Common.loadingExtension() }; + window.withProgress(progressOptions, () => promise).then(noop, noop); +} + +///////////////////////////// +// error handling + +async function handleError(ex: Error, startupDurations: Record) { + notifyUser( + "Extension activation failed, run the 'Developer: Toggle Developer Tools' command for more information." + ); + // Possible logger hasn't initialized either. + console.error('extension activation failed', ex); + traceError('extension activation failed', ex); + await sendErrorTelemetry(ex, startupDurations, activatedServiceContainer); +} + +function notifyUser(msg: string) { + try { + void window.showErrorMessage(msg); + } catch (ex) { + traceError('failed to notify user', ex); + } +} + +async function activateComponents( + context: IExtensionContext, + serviceManager: IServiceManager, + serviceContainer: IServiceContainer +) { + // We will be pulling code over from activateLegacy(). + return activateLegacy(context, serviceManager, serviceContainer); +} + +function addOutputChannel(context: IExtensionContext, serviceManager: IServiceManager, isDevMode: boolean) { + const standardOutputChannel = window.createOutputChannel(OutputChannelNames.jupyter()); + addOutputChannelLogging(standardOutputChannel); + serviceManager.addSingletonInstance(IOutputChannel, standardOutputChannel, STANDARD_OUTPUT_CHANNEL); + serviceManager.addSingletonInstance( + IOutputChannel, + getJupyterOutputChannel(isDevMode, context.subscriptions, standardOutputChannel), + JUPYTER_OUTPUT_CHANNEL + ); + serviceManager.addSingletonInstance(IsCodeSpace, env.uiKind == UIKind.Web); + + // Log env info. + standardOutputChannel.appendLine(`${env.appName} (${version}, ${env.remoteName}, ${env.appHost})`); + standardOutputChannel.appendLine(`Jupyter Extension Version: ${context.extension.packageJSON['version']}.`); + const pythonExtension = extensions.getExtension(PythonExtension); + if (pythonExtension) { + standardOutputChannel.appendLine(`Python Extension Version: ${pythonExtension.packageJSON['version']}.`); + } else { + standardOutputChannel.appendLine('Python Extension not installed.'); + } + if (!workspace.workspaceFolders || workspace.workspaceFolders.length === 0) { + standardOutputChannel.appendLine(`No workspace folder opened.`); + } else if (workspace.workspaceFolders.length === 1) { + standardOutputChannel.appendLine( + `Workspace folder ${getDisplayPath(workspace.workspaceFolders[0].uri.fsPath)}` + ); + } else { + standardOutputChannel.appendLine( + `Multiple Workspace folders opened ${workspace.workspaceFolders + .map((item) => getDisplayPath(item.uri.fsPath)) + .join(', ')}` + ); + } +} + +///////////////////////////// +// old activation code + +// eslint-disable-next-line +// TODO: Gradually move simple initialization +// and DI registration currently in this function over +// to initializeComponents(). Likewise with complex +// init and activation: move them to activateComponents(). +// See https://github.com/microsoft/vscode-python/issues/10454. + +async function activateLegacy( + context: IExtensionContext, + serviceManager: IServiceManager, + serviceContainer: IServiceContainer +) { + // register "services" + const isDevMode = + !isTestExecution() && + (context.extensionMode === ExtensionMode.Development || + workspace.getConfiguration('jupyter').get('development', false)); + serviceManager.addSingletonInstance(IsDevMode, isDevMode); + const isPreReleasePromise = fsExtra + .readFile(path.join(context.extensionPath, 'package.json'), { encoding: 'utf-8' }) + .then((contents) => { + const packageJSONLive = JSON.parse(contents); + return isDevMode || packageJSONLive?.__metadata?.preRelease; + }); + serviceManager.addSingletonInstance>(IsPreRelease, isPreReleasePromise); + if (isDevMode) { + void commands.executeCommand('setContext', 'jupyter.development', true); + } + + // Output channel is special. We need it before everything else + addOutputChannel(context, serviceManager, isDevMode); + + // Register the rest of the types (platform is first because it's needed by others) + registerPlatformTypes(serviceManager, isDevMode); + registerTelemetryTypes(serviceManager); + registerKernelTypes(serviceManager, isDevMode); + registerNotebookTypes(serviceManager); + registerInteractiveTypes(serviceManager); + registerWebviewTypes(serviceManager, isDevMode); + registerIntellisenseTypes(serviceManager, isDevMode); + + // We need to setup this property before any telemetry is sent + const fs = serviceManager.get(IFileSystem); + await setExtensionInstallTelemetryProperties(fs); + + // Load the two data science experiments that we need to register types + // Await here to keep the register method sync + const experimentService = serviceContainer.get(IExperimentService); + // This must be done first, this guarantees all experiment information has loaded & all telemetry will contain experiment info. + await experimentService.activate(); + experimentService.logExperiments(); + + const applicationEnv = serviceManager.get(IApplicationEnvironment); + const configuration = serviceManager.get(IConfigurationService); + + // We should start logging using the log level as soon as possible, so set it as soon as we can access the level. + // `IConfigurationService` may depend any of the registered types, so doing it after all registrations are finished. + // XXX Move this *after* abExperiments is activated? + const settings = configuration.getSettings(); + setLoggingLevel(settings.logging.level); + settings.onDidChange(() => { + setLoggingLevel(settings.logging.level); + }); + + // "initialize" "services" + const cmdManager = serviceContainer.get(ICommandManager); + cmdManager.executeCommand('setContext', 'jupyter.vscode.channel', applicationEnv.channel).then(noop, noop); + + // "activate" everything else + const manager = serviceContainer.get(IExtensionActivationManager); + context.subscriptions.push(manager); + manager.activateSync(); + const activationPromise = manager.activate(); + + // Activate data science features after base features. + const dataScience = serviceManager.get(IDataScience); + const dsActivationPromise = dataScience.activate(); + + const deprecationMgr = serviceContainer.get(IFeatureDeprecationManager); + deprecationMgr.initialize(); + context.subscriptions.push(deprecationMgr); + + return { activationPromise: activationPromise.then(() => dsActivationPromise) }; +} + +function initializeGlobals(context: IExtensionContext): [IServiceManager, IServiceContainer] { + const cont = new Container({ skipBaseClassChecks: true }); + const serviceManager = new ServiceManager(cont); + const serviceContainer = new ServiceContainer(cont); + + serviceManager.addSingletonInstance(IServiceContainer, serviceContainer); + serviceManager.addSingletonInstance(IServiceManager, serviceManager); + + serviceManager.addSingletonInstance(IDisposableRegistry, context.subscriptions); + serviceManager.addSingletonInstance(IMemento, context.globalState, GLOBAL_MEMENTO); + serviceManager.addSingletonInstance(IMemento, context.workspaceState, WORKSPACE_MEMENTO); + serviceManager.addSingletonInstance(IExtensionContext, context); + + return [serviceManager, serviceContainer]; +} diff --git a/src/extension/serviceRegistry.ts b/src/extension/serviceRegistry.ts deleted file mode 100644 index 2e99fa03e34..00000000000 --- a/src/extension/serviceRegistry.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -'use strict'; - -import { IServiceManager } from '../client/ioc/types'; -import { CommandRegistry } from './commands/commandRegistry'; - -export function registerTypes(serviceManager: IServiceManager) { - serviceManager.addSingleton(CommandRegistry, CommandRegistry); -} diff --git a/src/intellisense/cellLanguageService.ts b/src/intellisense/cellLanguageService.ts index a4aa542e51f..223cbb54449 100644 --- a/src/intellisense/cellLanguageService.ts +++ b/src/intellisense/cellLanguageService.ts @@ -6,15 +6,15 @@ import type * as nbformat from '@jupyterlab/nbformat'; import { inject, injectable, named } from 'inversify'; import { Memento, NotebookCellKind, NotebookDocument } from 'vscode'; -import { IExtensionSingleActivationService } from '../client/activation/types'; -import { IJupyterKernelSpec } from '../client/api/extension'; -import { IPythonExtensionChecker } from '../client/api/types'; -import { IVSCodeNotebook } from '../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../client/common/constants'; -import { traceWarning } from '../client/common/logger'; -import { IDisposableRegistry, IMemento, GLOBAL_MEMENTO } from '../client/common/types'; -import { swallowExceptions } from '../client/common/utils/decorators'; -import { translateKernelLanguageToMonaco } from '../client/datascience/common'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { IJupyterKernelSpec } from '../platform/api/extension'; +import { IPythonExtensionChecker } from '../platform/api/types'; +import { IVSCodeNotebook } from '../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../platform/common/constants'; +import { traceWarning } from '../platform/common/logger'; +import { IDisposableRegistry, IMemento, GLOBAL_MEMENTO } from '../platform/common/types'; +import { swallowExceptions } from '../platform/common/utils/decorators'; +import { translateKernelLanguageToMonaco } from '../platform/datascience/common'; import { LanguagesSupportedByPythonkernel, VSCodeKnownNotebookLanguages } from '../datascience-ui/common/constants'; import { isPythonKernelConnection, diff --git a/src/intellisense/conversion.ts b/src/intellisense/conversion.ts index 9dd6201b06e..4cca367696b 100644 --- a/src/intellisense/conversion.ts +++ b/src/intellisense/conversion.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../client/common/extensions'; +import '../platform/common/extensions'; // See the comment on convertCompletionItemKind below // Here's the monaco enum: diff --git a/src/intellisense/diagnosticsProvider.ts b/src/intellisense/diagnosticsProvider.ts index 4b9f002ab0e..d2a19cf02af 100644 --- a/src/intellisense/diagnosticsProvider.ts +++ b/src/intellisense/diagnosticsProvider.ts @@ -25,12 +25,12 @@ import { HoverProvider, Diagnostic } from 'vscode'; -import { IExtensionSyncActivationService } from '../client/activation/types'; -import { IVSCodeNotebook, IDocumentManager } from '../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../client/common/constants'; -import { disposeAllDisposables } from '../client/common/helpers'; -import { IDisposableRegistry } from '../client/common/types'; -import { DataScience } from '../client/common/utils/localize'; +import { IExtensionSyncActivationService } from '../platform/activation/types'; +import { IVSCodeNotebook, IDocumentManager } from '../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../platform/common/constants'; +import { disposeAllDisposables } from '../platform/common/helpers'; +import { IDisposableRegistry } from '../platform/common/types'; +import { DataScience } from '../platform/common/utils/localize'; import { JupyterNotebookView } from '../notebooks/constants'; import { getAssociatedJupyterNotebook } from '../notebooks/helpers'; diff --git a/src/intellisense/emptyNotebookCellLanguageService.ts b/src/intellisense/emptyNotebookCellLanguageService.ts index 421dc4f2f07..3522b13600c 100644 --- a/src/intellisense/emptyNotebookCellLanguageService.ts +++ b/src/intellisense/emptyNotebookCellLanguageService.ts @@ -3,13 +3,13 @@ import { inject, injectable } from 'inversify'; import { languages, NotebookCellKind, NotebookDocument } from 'vscode'; -import { IExtensionSingleActivationService } from '../client/activation/types'; -import { IVSCodeNotebook } from '../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../client/common/constants'; -import { traceError } from '../client/common/logger'; -import { IDisposableRegistry } from '../client/common/types'; -import { noop } from '../client/common/utils/misc'; -import { translateKernelLanguageToMonaco } from '../client/datascience/common'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { IVSCodeNotebook } from '../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../platform/common/constants'; +import { traceError } from '../platform/common/logger'; +import { IDisposableRegistry } from '../platform/common/types'; +import { noop } from '../platform/common/utils/misc'; +import { translateKernelLanguageToMonaco } from '../platform/datascience/common'; import { VSCodeNotebookController } from '../notebooks/controllers/vscodeNotebookController'; import { chainWithPendingUpdates } from '../notebooks/execution/notebookUpdater'; import { isJupyterNotebook } from '../notebooks/helpers'; diff --git a/src/intellisense/intellisenseProvider.ts b/src/intellisense/intellisenseProvider.ts index 4ea89a4e58a..3acb24bdd64 100644 --- a/src/intellisense/intellisenseProvider.ts +++ b/src/intellisense/intellisenseProvider.ts @@ -3,14 +3,14 @@ 'use strict'; import { inject, injectable } from 'inversify'; import { ConfigurationChangeEvent, NotebookDocument, Uri } from 'vscode'; -import { IExtensionSyncActivationService } from '../client/activation/types'; -import { IPythonExtensionChecker } from '../client/api/types'; -import { IVSCodeNotebook, IWorkspaceService } from '../client/common/application/types'; -import { IDisposableRegistry, IConfigurationService, IsPreRelease } from '../client/common/types'; -import { IInteractiveWindowProvider } from '../client/datascience/types'; -import { IInterpreterService } from '../client/interpreter/contracts'; -import { PythonEnvironment } from '../client/pythonEnvironments/info'; -import { getInterpreterId } from '../client/pythonEnvironments/info/interpreter'; +import { IExtensionSyncActivationService } from '../platform/activation/types'; +import { IPythonExtensionChecker } from '../platform/api/types'; +import { IVSCodeNotebook, IWorkspaceService } from '../platform/common/application/types'; +import { IDisposableRegistry, IConfigurationService, IsPreRelease } from '../platform/common/types'; +import { IInteractiveWindowProvider } from '../platform/datascience/types'; +import { IInterpreterService } from '../platform/interpreter/contracts'; +import { PythonEnvironment } from '../platform/pythonEnvironments/info'; +import { getInterpreterId } from '../platform/pythonEnvironments/info/interpreter'; import { VSCodeNotebookController } from '../notebooks/controllers/vscodeNotebookController'; import { isJupyterNotebook, findAssociatedNotebookDocument } from '../notebooks/helpers'; import { INotebookLanguageClientProvider, INotebookControllerManager } from '../notebooks/types'; diff --git a/src/intellisense/languageServer.ts b/src/intellisense/languageServer.ts index 64103fb4afa..622630e3454 100644 --- a/src/intellisense/languageServer.ts +++ b/src/intellisense/languageServer.ts @@ -31,12 +31,12 @@ import * as fs from 'fs-extra'; import { FileBasedCancellationStrategy } from './fileBasedCancellationStrategy'; import { createNotebookMiddleware, createPylanceMiddleware, NotebookMiddleware } from '@vscode/jupyter-lsp-middleware'; import * as uuid from 'uuid/v4'; -import { PythonEnvironment } from '../client/api/extension'; -import { NOTEBOOK_SELECTOR, PYTHON_LANGUAGE } from '../client/common/constants'; -import { traceInfo } from '../client/common/logger'; -import { getInterpreterId } from '../client/pythonEnvironments/info/interpreter'; -import { noop } from '../client/common/utils/misc'; -import { sleep } from '../client/common/utils/async'; +import { PythonEnvironment } from '../platform/api/extension'; +import { NOTEBOOK_SELECTOR, PYTHON_LANGUAGE } from '../platform/common/constants'; +import { traceInfo } from '../platform/common/logger'; +import { getInterpreterId } from '../platform/pythonEnvironments/info/interpreter'; +import { noop } from '../platform/common/utils/misc'; +import { sleep } from '../platform/common/utils/async'; // eslint-disable-next-line @typescript-eslint/no-explicit-any function ensure(target: any, key: string) { diff --git a/src/intellisense/logReplayService.ts b/src/intellisense/logReplayService.ts index 961b30407f7..b16f25a1ba8 100644 --- a/src/intellisense/logReplayService.ts +++ b/src/intellisense/logReplayService.ts @@ -7,15 +7,15 @@ import * as os from 'os'; import * as vscode from 'vscode'; import * as lspConcat from '@vscode/lsp-notebook-concat'; import * as protocol from 'vscode-languageserver-protocol'; -import { IExtensionSingleActivationService } from '../client/activation/types'; -import { ICommandManager, IApplicationShell } from '../client/common/application/types'; -import { PYTHON_LANGUAGE, NOTEBOOK_SELECTOR } from '../client/common/constants'; -import { ContextKey } from '../client/common/contextKey'; -import { traceInfo } from '../client/common/logger'; -import { IFileSystem } from '../client/common/platform/types'; -import { IDisposableRegistry, IConfigurationService } from '../client/common/types'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { ICommandManager, IApplicationShell } from '../platform/common/application/types'; +import { PYTHON_LANGUAGE, NOTEBOOK_SELECTOR } from '../platform/common/constants'; +import { ContextKey } from '../platform/common/contextKey'; +import { traceInfo } from '../platform/common/logger'; +import { IFileSystem } from '../platform/common/platform/types'; +import { IDisposableRegistry, IConfigurationService } from '../platform/common/types'; import { Commands, EditorContexts } from '../datascience-ui/common/constants'; -import { sleep, waitForCondition } from '../client/common/utils/async'; +import { sleep, waitForCondition } from '../platform/common/utils/async'; /** * Class used to replay pylance log output to regenerate a series of edits. diff --git a/src/intellisense/pythonKernelCompletionProvider.ts b/src/intellisense/pythonKernelCompletionProvider.ts index 6a34e9100aa..fd8b1f5d9e3 100644 --- a/src/intellisense/pythonKernelCompletionProvider.ts +++ b/src/intellisense/pythonKernelCompletionProvider.ts @@ -14,16 +14,16 @@ import { workspace } from 'vscode'; import * as lsp from 'vscode-languageclient'; -import { IVSCodeNotebook } from '../client/common/application/types'; -import { createPromiseFromCancellation } from '../client/common/cancellation'; -import { traceError, traceInfoIfCI, traceVerbose } from '../client/common/logger'; -import { getDisplayPath } from '../client/common/platform/fs-paths'; -import { IConfigurationService, IDisposableRegistry } from '../client/common/types'; -import { waitForPromise } from '../client/common/utils/async'; -import { isNotebookCell } from '../client/common/utils/misc'; -import { StopWatch } from '../client/common/utils/stopWatch'; -import { Settings } from '../client/datascience/constants'; -import { IInteractiveWindowProvider, IJupyterSession, INotebookCompletion } from '../client/datascience/types'; +import { IVSCodeNotebook } from '../platform/common/application/types'; +import { createPromiseFromCancellation } from '../platform/common/cancellation'; +import { traceError, traceInfoIfCI, traceVerbose } from '../platform/common/logger'; +import { getDisplayPath } from '../platform/common/platform/fs-paths'; +import { IConfigurationService, IDisposableRegistry } from '../platform/common/types'; +import { waitForPromise } from '../platform/common/utils/async'; +import { isNotebookCell } from '../platform/common/utils/misc'; +import { StopWatch } from '../platform/common/utils/stopWatch'; +import { Settings } from '../platform/datascience/constants'; +import { IInteractiveWindowProvider, IJupyterSession, INotebookCompletion } from '../platform/datascience/types'; import { IKernelProvider } from '../kernels/types'; import { findAssociatedNotebookDocument, getAssociatedJupyterNotebook } from '../notebooks/helpers'; import { INotebookLanguageClientProvider } from '../notebooks/types'; diff --git a/src/intellisense/pythonKernelCompletionProviderRegistration.ts b/src/intellisense/pythonKernelCompletionProviderRegistration.ts index 383f57d6b1f..676a0c95b16 100644 --- a/src/intellisense/pythonKernelCompletionProviderRegistration.ts +++ b/src/intellisense/pythonKernelCompletionProviderRegistration.ts @@ -3,9 +3,9 @@ 'use strict'; import { inject, injectable } from 'inversify'; import { languages } from 'vscode'; -import { IExtensionSingleActivationService } from '../client/activation/types'; -import { NOTEBOOK_SELECTOR } from '../client/common/constants'; -import { IDisposableRegistry, IConfigurationService } from '../client/common/types'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { NOTEBOOK_SELECTOR } from '../platform/common/constants'; +import { IDisposableRegistry, IConfigurationService } from '../platform/common/types'; import { PythonKernelCompletionProvider } from './pythonKernelCompletionProvider'; // Default set of trigger characters for jupyter diff --git a/src/intellisense/serviceRegistry.ts b/src/intellisense/serviceRegistry.ts new file mode 100644 index 00000000000..2d97b9a8416 --- /dev/null +++ b/src/intellisense/serviceRegistry.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; + +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { IServiceManager } from '../platform/ioc/types'; +import { PythonKernelCompletionProvider } from './pythonKernelCompletionProvider'; +import { PythonKernelCompletionProviderRegistration } from './pythonKernelCompletionProviderRegistration'; + +export function registerTypes(serviceManager: IServiceManager, _isDevMode: boolean) { + serviceManager.addSingleton( + PythonKernelCompletionProvider, + PythonKernelCompletionProvider + ); // Used in tests + serviceManager.addSingleton( + IExtensionSingleActivationService, + PythonKernelCompletionProviderRegistration + ); +} diff --git a/src/interactive-window/commands/activeEditorContext.ts b/src/interactive-window/commands/activeEditorContext.ts index 4f9b48b0378..69b171ca39e 100644 --- a/src/interactive-window/commands/activeEditorContext.ts +++ b/src/interactive-window/commands/activeEditorContext.ts @@ -6,17 +6,17 @@ import { inject, injectable } from 'inversify'; import { NotebookEditor, TextEditor } from 'vscode'; import { IKernel, IKernelProvider } from '../../kernels/types'; import { getNotebookMetadata, isJupyterNotebook, isPythonNotebook } from '../../notebooks/helpers'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; -import { ICommandManager, IDocumentManager, IVSCodeNotebook } from '../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../client/common/constants'; -import { ContextKey } from '../../client/common/contextKey'; -import { IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { isNotebookCell, noop } from '../../client/common/utils/misc'; -import { EditorContexts } from '../../client/datascience/constants'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; +import { ICommandManager, IDocumentManager, IVSCodeNotebook } from '../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../platform/common/constants'; +import { ContextKey } from '../../platform/common/contextKey'; +import { IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { isNotebookCell, noop } from '../../platform/common/utils/misc'; +import { EditorContexts } from '../../platform/datascience/constants'; import { getActiveInteractiveWindow } from '../helpers'; import { InteractiveWindowView, JupyterNotebookView } from '../../notebooks/constants'; import { INotebookControllerManager } from '../../notebooks/types'; -import { IInteractiveWindow, IInteractiveWindowProvider } from '../../client/datascience/types'; +import { IInteractiveWindow, IInteractiveWindowProvider } from '../../platform/datascience/types'; @injectable() export class ActiveEditorContextService implements IExtensionSingleActivationService, IDisposable { diff --git a/src/interactive-window/commands/commandRegistry.ts b/src/interactive-window/commands/commandRegistry.ts index 7d36b8ba103..c1fb9d11132 100644 --- a/src/interactive-window/commands/commandRegistry.ts +++ b/src/interactive-window/commands/commandRegistry.ts @@ -6,31 +6,31 @@ import { inject, injectable, multiInject, named, optional } from 'inversify'; import { CodeLens, ConfigurationTarget, env, Range, Uri, commands } from 'vscode'; import { DebugProtocol } from 'vscode-debugprotocol'; -import { IShowDataViewerFromVariablePanel } from '../../extension/messageTypes'; +import { IShowDataViewerFromVariablePanel } from '../../platform/messageTypes'; import { IKernelProvider } from '../../kernels/types'; import { convertDebugProtocolVariableToIJupyterVariable } from '../../kernels/variables/debuggerVariables'; import { DataViewerChecker } from '../../webviews/dataviewer/dataViewerChecker'; -import { ICommandNameArgumentTypeMapping } from '../../client/common/application/commands'; +import { ICommandNameArgumentTypeMapping } from '../../platform/common/application/commands'; import { IApplicationShell, ICommandManager, IDebugService, IDocumentManager, IWorkspaceService -} from '../../client/common/application/types'; -import { traceError } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; - -import { IConfigurationService, IDisposable, IOutputChannel } from '../../client/common/types'; -import { DataScience } from '../../client/common/utils/localize'; -import { isUri, noop } from '../../client/common/utils/misc'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { LogLevel } from '../../client/logging/levels'; -import { captureTelemetry, sendTelemetryEvent } from '../../client/telemetry'; -import { EventName } from '../../client/telemetry/constants'; -import { Commands, Identifiers, JUPYTER_OUTPUT_CHANNEL, Telemetry } from '../../client/datascience/constants'; -import { DataViewerDependencyService } from '../../client/datascience/data-viewing/dataViewerDependencyService'; -import { IDataViewerFactory } from '../../client/datascience/data-viewing/types'; +} from '../../platform/common/application/types'; +import { traceError } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; + +import { IConfigurationService, IDisposable, IOutputChannel } from '../../platform/common/types'; +import { DataScience } from '../../platform/common/utils/localize'; +import { isUri, noop } from '../../platform/common/utils/misc'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { LogLevel } from '../../platform/logging/levels'; +import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; +import { EventName } from '../../telemetry/constants'; +import { Commands, Identifiers, JUPYTER_OUTPUT_CHANNEL, Telemetry } from '../../platform/datascience/constants'; +import { DataViewerDependencyService } from '../../platform/datascience/data-viewing/dataViewerDependencyService'; +import { IDataViewerFactory } from '../../platform/datascience/data-viewing/types'; import { ICodeWatcher, IDataScienceCodeLensProvider, @@ -40,7 +40,7 @@ import { IJupyterServerUriStorage, IJupyterVariableDataProviderFactory, IJupyterVariables -} from '../../client/datascience/types'; +} from '../../platform/datascience/types'; import { ExportCommands } from './exportCommands'; @injectable() diff --git a/src/interactive-window/commands/exportCommands.ts b/src/interactive-window/commands/exportCommands.ts index 44f4e34fcb2..7983e9f7623 100644 --- a/src/interactive-window/commands/exportCommands.ts +++ b/src/interactive-window/commands/exportCommands.ts @@ -6,22 +6,22 @@ import { inject, injectable } from 'inversify'; import { NotebookDocument, QuickPickItem, QuickPickOptions, Uri } from 'vscode'; import { getLocString } from '../../datascience-ui/react-common/locReactSide'; -import { ICommandNameArgumentTypeMapping } from '../../client/common/application/commands'; -import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../client/common/application/types'; -import { traceInfo } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IDisposable } from '../../client/common/types'; -import { DataScience } from '../../client/common/utils/localize'; -import { isUri } from '../../client/common/utils/misc'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../client/telemetry'; -import { Commands, Telemetry } from '../../client/datascience/constants'; -import { FileConverter } from '../../client/datascience/export/fileConverter'; -import { ExportFormat, IFileConverter } from '../../client/datascience/export/types'; +import { ICommandNameArgumentTypeMapping } from '../../platform/common/application/commands'; +import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../platform/common/application/types'; +import { traceInfo } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IDisposable } from '../../platform/common/types'; +import { DataScience } from '../../platform/common/utils/localize'; +import { isUri } from '../../platform/common/utils/misc'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { sendTelemetryEvent } from '../../telemetry'; +import { Commands, Telemetry } from '../../platform/datascience/constants'; +import { FileConverter } from '../../platform/datascience/export/fileConverter'; +import { ExportFormat, IFileConverter } from '../../platform/datascience/export/types'; import { getActiveInteractiveWindow } from '../helpers'; import { getNotebookMetadata, isPythonNotebook } from '../../notebooks/helpers'; import { INotebookControllerManager } from '../../notebooks/types'; -import { IInteractiveWindowProvider } from '../../client/datascience/types'; +import { IInteractiveWindowProvider } from '../../platform/datascience/types'; interface IExportQuickPickItem extends QuickPickItem { handler(): void; diff --git a/src/interactive-window/editor-integration/cellHashProviderFactory.ts b/src/interactive-window/editor-integration/cellHashProviderFactory.ts index 5bccd5c6cd9..2aba563f5a4 100644 --- a/src/interactive-window/editor-integration/cellHashProviderFactory.ts +++ b/src/interactive-window/editor-integration/cellHashProviderFactory.ts @@ -2,12 +2,12 @@ // Licensed under the MIT License. import { inject, injectable, multiInject, optional } from 'inversify'; -import { IDocumentManager, IDebugService } from '../../client/common/application/types'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IConfigurationService } from '../../client/common/types'; -import { IServiceContainer } from '../../client/ioc/types'; +import { IDocumentManager, IDebugService } from '../../platform/common/application/types'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IConfigurationService } from '../../platform/common/types'; +import { IServiceContainer } from '../../platform/ioc/types'; import { IKernel, IKernelProvider } from '../../kernels/types'; -import { ICellHashListener } from '../../client/datascience/types'; +import { ICellHashListener } from '../../platform/datascience/types'; import { CellHashProvider } from './cellhashprovider'; @injectable() diff --git a/src/interactive-window/editor-integration/cellhashprovider.ts b/src/interactive-window/editor-integration/cellhashprovider.ts index a16e5cd82c9..e1af0e33546 100644 --- a/src/interactive-window/editor-integration/cellhashprovider.ts +++ b/src/interactive-window/editor-integration/cellhashprovider.ts @@ -2,7 +2,6 @@ // Licensed under the MIT License. 'use strict'; import * as hashjs from 'hash.js'; -import { inject, injectable, multiInject, optional } from 'inversify'; import { Disposable, Event, @@ -15,22 +14,22 @@ import { TextDocumentContentChangeEvent, Uri } from 'vscode'; -import * as localize from '../../client/common/utils/localize'; +import * as localize from '../../platform/common/utils/localize'; import { splitMultilineString } from '../../datascience-ui/common'; import { uncommentMagicCommands } from '../../datascience-ui/common/cellFactory'; -import { IDebugService, IDocumentManager } from '../../client/common/application/types'; -import { traceInfo, traceInfoIfCI } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; +import { IDebugService, IDocumentManager } from '../../platform/common/application/types'; +import { traceInfo, traceInfoIfCI } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; -import { IConfigurationService } from '../../client/common/types'; -import { getCellResource } from '../../client/datascience/cellFactory'; -import { CellMatcher } from '../../client/datascience/cellMatcher'; +import { IConfigurationService } from '../../platform/common/types'; +import { getCellResource } from '../../platform/datascience/cellFactory'; +import { CellMatcher } from '../../platform/datascience/cellMatcher'; import { getInteractiveCellMetadata } from '../interactiveWindow'; import { IKernel } from '../../kernels/types'; import { InteractiveWindowView } from '../../notebooks/constants'; -import { ICellHash, ICellHashListener, ICellHashProvider, IFileHashes } from '../../client/datascience/types'; -import { stripAnsi } from '../../client/common/utils/regexp'; +import { ICellHash, ICellHashListener, ICellHashProvider, IFileHashes } from '../../platform/datascience/types'; +import { stripAnsi } from '../../platform/common/utils/regexp'; // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports const untildify = require('untildify'); @@ -50,7 +49,6 @@ interface IRangedCellHash extends ICellHash { // This class provides hashes for debugging jupyter cells. Call getHashes just before starting debugging to compute all of the // hashes for cells. -@injectable() export class CellHashProvider implements ICellHashProvider { // eslint-disable-next-line @typescript-eslint/no-explicit-any private postEmitter: EventEmitter<{ message: string; payload: any }> = new EventEmitter<{ @@ -67,11 +65,11 @@ export class CellHashProvider implements ICellHashProvider { private executionCounts: Map = new Map(); constructor( - @inject(IDocumentManager) private documentManager: IDocumentManager, - @inject(IConfigurationService) private configService: IConfigurationService, - @inject(IDebugService) private debugService: IDebugService, - @inject(IFileSystem) private fs: IFileSystem, - @multiInject(ICellHashListener) @optional() private listeners: ICellHashListener[] | undefined, + private documentManager: IDocumentManager, + private configService: IConfigurationService, + private debugService: IDebugService, + private fs: IFileSystem, + private listeners: ICellHashListener[] | undefined, private readonly kernel: IKernel ) { // Watch document changes so we can update our hashes diff --git a/src/interactive-window/editor-integration/codeLensFactory.ts b/src/interactive-window/editor-integration/codeLensFactory.ts index 13c0dc113ae..8f339aa19b8 100644 --- a/src/interactive-window/editor-integration/codeLensFactory.ts +++ b/src/interactive-window/editor-integration/codeLensFactory.ts @@ -14,17 +14,17 @@ import { workspace } from 'vscode'; -import { IDocumentManager, IVSCodeNotebook, IWorkspaceService } from '../../client/common/application/types'; -import { traceWarning, traceInfoIfCI } from '../../client/common/logger'; +import { IDocumentManager, IVSCodeNotebook, IWorkspaceService } from '../../platform/common/application/types'; +import { traceWarning, traceInfoIfCI } from '../../platform/common/logger'; -import { IConfigurationService, IDisposableRegistry, Resource } from '../../client/common/types'; -import * as localize from '../../client/common/utils/localize'; -import { generateCellRangesFromDocument } from '../../client/datascience/cellFactory'; -import { CodeLensCommands, Commands } from '../../client/datascience/constants'; +import { IConfigurationService, IDisposableRegistry, Resource } from '../../platform/common/types'; +import * as localize from '../../platform/common/utils/localize'; +import { generateCellRangesFromDocument } from '../../platform/datascience/cellFactory'; +import { CodeLensCommands, Commands } from '../../platform/datascience/constants'; import { getInteractiveCellMetadata } from '../interactiveWindow'; import { IKernelProvider } from '../../kernels/types'; import { InteractiveWindowView } from '../../notebooks/constants'; -import { ICellHashProvider, ICellRange, ICodeLensFactory, IFileHashes } from '../../client/datascience/types'; +import { ICellHashProvider, ICellRange, ICodeLensFactory, IFileHashes } from '../../platform/datascience/types'; import { CellHashProviderFactory } from './cellHashProviderFactory'; type CodeLensCacheData = { diff --git a/src/interactive-window/editor-integration/codelensprovider.ts b/src/interactive-window/editor-integration/codelensprovider.ts index 43a4dabf4cd..1ffade8eac8 100644 --- a/src/interactive-window/editor-integration/codelensprovider.ts +++ b/src/interactive-window/editor-integration/codelensprovider.ts @@ -9,19 +9,19 @@ import { IDebugService, IDocumentManager, IWorkspaceService -} from '../../client/common/application/types'; -import { ContextKey } from '../../client/common/contextKey'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { IFileSystem } from '../../client/common/platform/types'; - -import { IConfigurationService, IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { noop } from '../../client/common/utils/misc'; -import { StopWatch } from '../../client/common/utils/stopWatch'; -import { IServiceContainer } from '../../client/ioc/types'; -import { sendTelemetryEvent } from '../../client/telemetry'; -import { CodeLensCommands, EditorContexts, Telemetry } from '../../client/datascience/constants'; -import { ICodeWatcher, IDataScienceCodeLensProvider, IDebugLocationTracker } from '../../client/datascience/types'; -import { traceInfoIfCI } from '../../client/common/logger'; +} from '../../platform/common/application/types'; +import { ContextKey } from '../../platform/common/contextKey'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { IFileSystem } from '../../platform/common/platform/types'; + +import { IConfigurationService, IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { noop } from '../../platform/common/utils/misc'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; +import { IServiceContainer } from '../../platform/ioc/types'; +import { sendTelemetryEvent } from '../../telemetry'; +import { CodeLensCommands, EditorContexts, Telemetry } from '../../platform/datascience/constants'; +import { ICodeWatcher, IDataScienceCodeLensProvider, IDebugLocationTracker } from '../../platform/datascience/types'; +import { traceInfoIfCI } from '../../platform/common/logger'; @injectable() export class DataScienceCodeLensProvider implements IDataScienceCodeLensProvider, IDisposable { diff --git a/src/interactive-window/editor-integration/codewatcher.ts b/src/interactive-window/editor-integration/codewatcher.ts index c8718e11fed..b52e73612d8 100644 --- a/src/interactive-window/editor-integration/codewatcher.ts +++ b/src/interactive-window/editor-integration/codewatcher.ts @@ -18,21 +18,21 @@ import { Uri } from 'vscode'; -import { IDocumentManager } from '../../client/common/application/types'; -import { IFileSystem } from '../../client/common/platform/types'; - -import { IConfigurationService, IDisposable, Resource } from '../../client/common/types'; -import { chainable } from '../../client/common/utils/decorators'; -import * as localize from '../../client/common/utils/localize'; -import { isUri } from '../../client/common/utils/misc'; -import { StopWatch } from '../../client/common/utils/stopWatch'; -import { traceDecorators } from '../../client/logging'; -import { TraceOptions } from '../../client/logging/trace'; -import { captureTelemetry, sendTelemetryEvent } from '../../client/telemetry'; -import { ICodeExecutionHelper } from '../../client/terminals/types'; -import { CellMatcher } from '../../client/datascience/cellMatcher'; -import { Commands, Identifiers, Telemetry } from '../../client/datascience/constants'; -import { InteractiveCellResultError } from '../../extension/errors/interactiveCellResultError'; +import { IDocumentManager } from '../../platform/common/application/types'; +import { IFileSystem } from '../../platform/common/platform/types'; + +import { IConfigurationService, IDisposable, Resource } from '../../platform/common/types'; +import { chainable } from '../../platform/common/utils/decorators'; +import * as localize from '../../platform/common/utils/localize'; +import { isUri } from '../../platform/common/utils/misc'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; +import { traceDecorators } from '../../platform/logging'; +import { TraceOptions } from '../../platform/logging/trace'; +import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; +import { ICodeExecutionHelper } from '../../platform/terminals/types'; +import { CellMatcher } from '../../platform/datascience/cellMatcher'; +import { Commands, Identifiers, Telemetry } from '../../platform/datascience/constants'; +import { InteractiveCellResultError } from '../../platform/errors/interactiveCellResultError'; import { ICellRange, ICodeLensFactory, @@ -40,7 +40,7 @@ import { IDataScienceErrorHandler, IInteractiveWindow, IInteractiveWindowProvider -} from '../../client/datascience/types'; +} from '../../platform/datascience/types'; function getIndex(index: number, length: number): number { // return index within the length range with negative indexing diff --git a/src/interactive-window/editor-integration/decorator.ts b/src/interactive-window/editor-integration/decorator.ts index c0b7839c928..b275b1a6c2b 100644 --- a/src/interactive-window/editor-integration/decorator.ts +++ b/src/interactive-window/editor-integration/decorator.ts @@ -4,12 +4,12 @@ import { inject, injectable } from 'inversify'; import * as vscode from 'vscode'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; -import { IPythonExtensionChecker } from '../../client/api/types'; -import { IDocumentManager } from '../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../client/common/constants'; -import { IConfigurationService, IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { generateCellRangesFromDocument } from '../../client/datascience/cellFactory'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; +import { IPythonExtensionChecker } from '../../platform/api/types'; +import { IDocumentManager } from '../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../platform/common/constants'; +import { IConfigurationService, IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { generateCellRangesFromDocument } from '../../platform/datascience/cellFactory'; import { getAssociatedJupyterNotebook } from '../../notebooks/helpers'; @injectable() diff --git a/src/interactive-window/editor-integration/hoverProvider.ts b/src/interactive-window/editor-integration/hoverProvider.ts index 939e21ef90a..0785599027f 100644 --- a/src/interactive-window/editor-integration/hoverProvider.ts +++ b/src/interactive-window/editor-integration/hoverProvider.ts @@ -4,22 +4,22 @@ import { inject, injectable, named } from 'inversify'; import * as vscode from 'vscode'; -import { IExtensionSyncActivationService } from '../../client/activation/types'; -import { IVSCodeNotebook } from '../../client/common/application/types'; -import { Cancellation } from '../../client/common/cancellation'; -import { PYTHON } from '../../client/common/constants'; -import { traceError } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IDisposableRegistry } from '../../client/common/types'; +import { IExtensionSyncActivationService } from '../../platform/activation/types'; +import { IVSCodeNotebook } from '../../platform/common/application/types'; +import { Cancellation } from '../../platform/common/cancellation'; +import { PYTHON } from '../../platform/common/constants'; +import { traceError } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IDisposableRegistry } from '../../platform/common/types'; -import { sleep } from '../../client/common/utils/async'; -import { StopWatch } from '../../client/common/utils/stopWatch'; -import { sendTelemetryEvent } from '../../client/telemetry'; -import { Identifiers, Telemetry } from '../../client/datascience/constants'; +import { sleep } from '../../platform/common/utils/async'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; +import { sendTelemetryEvent } from '../../telemetry'; +import { Identifiers, Telemetry } from '../../platform/datascience/constants'; import { getInteractiveCellMetadata } from '../interactiveWindow'; import { IKernel, IKernelProvider } from '../../kernels/types'; import { InteractiveWindowView } from '../../notebooks/constants'; -import { IInteractiveWindowProvider, IJupyterVariables } from '../../client/datascience/types'; +import { IInteractiveWindowProvider, IJupyterVariables } from '../../platform/datascience/types'; @injectable() export class HoverProvider implements IExtensionSyncActivationService, vscode.HoverProvider { private runFiles = new Set(); diff --git a/src/interactive-window/helpers.ts b/src/interactive-window/helpers.ts index 7d66a65c92b..4aa554e9b2f 100644 --- a/src/interactive-window/helpers.ts +++ b/src/interactive-window/helpers.ts @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { IInteractiveWindow, IInteractiveWindowProvider } from '../client/datascience/types'; +import { IInteractiveWindow, IInteractiveWindowProvider } from '../platform/datascience/types'; import { window } from 'vscode'; -import { NotebookCellScheme } from '../client/common/constants'; +import { NotebookCellScheme } from '../platform/common/constants'; export function getActiveInteractiveWindow( interactiveWindowProvider: IInteractiveWindowProvider diff --git a/src/interactive-window/identity.ts b/src/interactive-window/identity.ts index 38c8b1d39a4..b6b43359a95 100644 --- a/src/interactive-window/identity.ts +++ b/src/interactive-window/identity.ts @@ -3,8 +3,8 @@ import * as path from 'path'; import * as uuid from 'uuid/v4'; import { Uri } from 'vscode'; -import '../client/common/extensions'; -import * as localize from '../client/common/utils/localize'; +import '../platform/common/extensions'; +import * as localize from '../platform/common/utils/localize'; let identities: string[] = []; let createCount = 0; diff --git a/src/interactive-window/interactiveWindow.ts b/src/interactive-window/interactiveWindow.ts index 3e8bf8fe104..9f2c1d4f168 100644 --- a/src/interactive-window/interactiveWindow.ts +++ b/src/interactive-window/interactiveWindow.ts @@ -22,36 +22,40 @@ import { window, ThemeColor } from 'vscode'; -import { IPythonExtensionChecker } from '../client/api/types'; -import { ICommandManager, IDocumentManager, IWorkspaceService } from '../client/common/application/types'; -import { JVSC_EXTENSION_ID, MARKDOWN_LANGUAGE, PYTHON_LANGUAGE } from '../client/common/constants'; -import '../client/common/extensions'; -import { traceInfo, traceInfoIfCI } from '../client/common/logger'; -import { IFileSystem } from '../client/common/platform/types'; +import { IPythonExtensionChecker } from '../platform/api/types'; +import { ICommandManager, IDocumentManager, IWorkspaceService } from '../platform/common/application/types'; +import { JVSC_EXTENSION_ID, MARKDOWN_LANGUAGE, PYTHON_LANGUAGE } from '../platform/common/constants'; +import '../platform/common/extensions'; +import { traceInfo, traceInfoIfCI } from '../platform/common/logger'; +import { IFileSystem } from '../platform/common/platform/types'; import * as uuid from 'uuid/v4'; -import { IConfigurationService, InteractiveWindowMode, Resource } from '../client/common/types'; -import { noop } from '../client/common/utils/misc'; -import { generateCellsFromNotebookDocument } from '../client/datascience/cellFactory'; -import { CellMatcher } from '../client/datascience/cellMatcher'; -import { Commands, defaultNotebookFormat } from '../client/datascience/constants'; -import { ExportFormat, IExportDialog } from '../client/datascience/export/types'; +import { IConfigurationService, InteractiveWindowMode, Resource } from '../platform/common/types'; +import { noop } from '../platform/common/utils/misc'; +import { generateCellsFromNotebookDocument } from '../platform/datascience/cellFactory'; +import { CellMatcher } from '../platform/datascience/cellMatcher'; +import { Commands, defaultNotebookFormat } from '../platform/datascience/constants'; +import { ExportFormat, IExportDialog } from '../platform/datascience/export/types'; import { IKernel, KernelConnectionMetadata, NotebookCellRunState } from '../kernels/types'; import { INotebookControllerManager } from '../notebooks/types'; -import { IInteractiveWindowLoadable, IInteractiveWindowDebugger, INotebookExporter } from '../client/datascience/types'; +import { + IInteractiveWindowLoadable, + IInteractiveWindowDebugger, + INotebookExporter +} from '../platform/datascience/types'; import { getInteractiveWindowTitle } from './identity'; import { generateMarkdownFromCodeLines, parseForComments } from '../datascience-ui/common'; import { INativeInteractiveWindow } from './types'; import { generateInteractiveCode } from '../datascience-ui/common/cellFactory'; -import { initializeInteractiveOrNotebookTelemetryBasedOnUserAction } from '../client/datascience/telemetry/telemetry'; +import { initializeInteractiveOrNotebookTelemetryBasedOnUserAction } from '../telemetry/telemetry'; import { InteractiveWindowView } from '../notebooks/constants'; -import { chainable } from '../client/common/utils/decorators'; -import { InteractiveCellResultError } from '../extension/errors/interactiveCellResultError'; -import { DataScience } from '../client/common/utils/localize'; -import { createDeferred } from '../client/common/utils/async'; +import { chainable } from '../platform/common/utils/decorators'; +import { InteractiveCellResultError } from '../platform/errors/interactiveCellResultError'; +import { DataScience } from '../platform/common/utils/localize'; +import { createDeferred } from '../platform/common/utils/async'; import { connectToKernel } from '../kernels/helpers'; -import { IServiceContainer } from '../client/ioc/types'; -import { SysInfoReason } from '../extension/messageTypes'; +import { IServiceContainer } from '../platform/ioc/types'; +import { SysInfoReason } from '../platform/messageTypes'; import { VSCodeNotebookController } from '../notebooks/controllers/vscodeNotebookController'; import { chainWithPendingUpdates } from '../notebooks/execution/notebookUpdater'; import { updateNotebookMetadata } from '../notebooks/helpers'; diff --git a/src/interactive-window/interactiveWindowCommandListener.ts b/src/interactive-window/interactiveWindowCommandListener.ts index 8b7bd53dc9e..94750aef37a 100644 --- a/src/interactive-window/interactiveWindowCommandListener.ts +++ b/src/interactive-window/interactiveWindowCommandListener.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../client/common/extensions'; +import '../platform/common/extensions'; import { inject, injectable } from 'inversify'; import { @@ -21,18 +21,18 @@ import { ICommandManager, IDocumentManager, IVSCodeNotebook -} from '../client/common/application/types'; -import { JVSC_EXTENSION_ID, PYTHON_LANGUAGE } from '../client/common/constants'; -import { traceError, traceInfo } from '../client/common/logger'; -import { IFileSystem } from '../client/common/platform/types'; -import { IConfigurationService, IDisposableRegistry } from '../client/common/types'; -import * as localize from '../client/common/utils/localize'; -import { captureTelemetry } from '../client/telemetry'; -import { CommandSource } from '../client/testing/common/constants'; -import { generateCellsFromDocument } from '../client/datascience/cellFactory'; -import { Commands, Telemetry } from '../client/datascience/constants'; -import { ExportFormat, IExportDialog, IFileConverter } from '../client/datascience/export/types'; -import { JupyterInstallError } from '../extension/errors/jupyterInstallError'; +} from '../platform/common/application/types'; +import { JVSC_EXTENSION_ID, PYTHON_LANGUAGE } from '../platform/common/constants'; +import { traceError, traceInfo } from '../platform/common/logger'; +import { IFileSystem } from '../platform/common/platform/types'; +import { IConfigurationService, IDisposableRegistry } from '../platform/common/types'; +import * as localize from '../platform/common/utils/localize'; +import { captureTelemetry } from '../telemetry'; +import { CommandSource } from '../platform/testing/common/constants'; +import { generateCellsFromDocument } from '../platform/datascience/cellFactory'; +import { Commands, Telemetry } from '../platform/datascience/constants'; +import { ExportFormat, IExportDialog, IFileConverter } from '../platform/datascience/export/types'; +import { JupyterInstallError } from '../platform/errors/jupyterInstallError'; import { IDataScienceCommandListener, IDataScienceErrorHandler, @@ -41,7 +41,7 @@ import { INotebookEditorProvider, INotebookExporter, IStatusProvider -} from '../client/datascience/types'; +} from '../platform/datascience/types'; import { getActiveInteractiveWindow } from './helpers'; import { INotebookControllerManager } from '../notebooks/types'; import { JupyterNotebookView } from '../notebooks/constants'; diff --git a/src/interactive-window/interactiveWindowProvider.ts b/src/interactive-window/interactiveWindowProvider.ts index 86f17484cef..7ac15dd8d21 100644 --- a/src/interactive-window/interactiveWindowProvider.ts +++ b/src/interactive-window/interactiveWindowProvider.ts @@ -3,16 +3,16 @@ 'use strict'; import { inject, injectable, named } from 'inversify'; import { ConfigurationTarget, Event, EventEmitter, Memento, Uri, window } from 'vscode'; -import { IPythonExtensionChecker } from '../client/api/types'; +import { IPythonExtensionChecker } from '../platform/api/types'; import { IApplicationShell, ICommandManager, IDocumentManager, IWorkspaceService -} from '../client/common/application/types'; -import { traceInfo } from '../client/common/logger'; -import { IFileSystem } from '../client/common/platform/types'; +} from '../platform/common/application/types'; +import { traceInfo } from '../platform/common/logger'; +import { IFileSystem } from '../platform/common/platform/types'; import { GLOBAL_MEMENTO, @@ -23,12 +23,12 @@ import { IMemento, InteractiveWindowMode, Resource -} from '../client/common/types'; -import { chainable } from '../client/common/utils/decorators'; -import * as localize from '../client/common/utils/localize'; -import { noop } from '../client/common/utils/misc'; -import { IServiceContainer } from '../client/ioc/types'; -import { IExportDialog } from '../client/datascience/export/types'; +} from '../platform/common/types'; +import { chainable } from '../platform/common/utils/decorators'; +import * as localize from '../platform/common/utils/localize'; +import { noop } from '../platform/common/utils/misc'; +import { IServiceContainer } from '../platform/ioc/types'; +import { IExportDialog } from '../platform/datascience/export/types'; import { KernelConnectionMetadata } from '../kernels/types'; import { INotebookControllerManager } from '../notebooks/types'; import { @@ -36,7 +36,7 @@ import { IInteractiveWindowProvider, IInteractiveWindowDebugger, INotebookExporter -} from '../client/datascience/types'; +} from '../platform/datascience/types'; import { InteractiveWindow } from './interactiveWindow'; // Export for testing diff --git a/src/interactive-window/serviceRegistry.ts b/src/interactive-window/serviceRegistry.ts index bcd398bcde4..97b262c8a8c 100644 --- a/src/interactive-window/serviceRegistry.ts +++ b/src/interactive-window/serviceRegistry.ts @@ -2,15 +2,15 @@ // Licensed under the MIT License. 'use strict'; -import { IExtensionSyncActivationService, IExtensionSingleActivationService } from '../client/activation/types'; +import { IExtensionSyncActivationService, IExtensionSingleActivationService } from '../platform/activation/types'; import { IInteractiveWindowProvider, IDataScienceCommandListener, ICodeLensFactory, ICodeWatcher, IDataScienceCodeLensProvider -} from '../client/datascience/types'; -import { IServiceManager } from '../client/ioc/types'; +} from '../platform/datascience/types'; +import { IServiceManager } from '../platform/ioc/types'; import { CommandRegistry } from './commands/commandRegistry'; import { ExportCommands } from './commands/exportCommands'; import { CellHashProviderFactory } from './editor-integration/cellHashProviderFactory'; diff --git a/src/kernels/common/baseJupyterSession.ts b/src/kernels/common/baseJupyterSession.ts index 4cc085544c8..92116e28ec7 100644 --- a/src/kernels/common/baseJupyterSession.ts +++ b/src/kernels/common/baseJupyterSession.ts @@ -7,22 +7,22 @@ import type { Slot } from '@lumino/signaling'; import { Observable } from 'rxjs/Observable'; import { ReplaySubject } from 'rxjs/ReplaySubject'; import { CancellationTokenSource, Event, EventEmitter } from 'vscode'; -import { WrappedError } from '../../client/../extension/errors/types'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { traceInfo, traceVerbose, traceError, traceWarning, traceInfoIfCI } from '../../client/common/logger'; -import { IDisposable, Resource } from '../../client/common/types'; -import { createDeferred, sleep, waitForPromise } from '../../client/common/utils/async'; -import * as localize from '../../client/common/utils/localize'; -import { noop } from '../../client/common/utils/misc'; -import { getResourceType } from '../../client/datascience/common'; -import { KernelProgressReporter } from '../../client/datascience/progress/kernelProgressReporter'; -import { IJupyterSession, ISessionWithSocket, KernelSocketInformation } from '../../client/datascience/types'; -import { sendTelemetryEvent } from '../../client/telemetry'; +import { WrappedError } from '../../platform/errors/types'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { traceInfo, traceVerbose, traceError, traceWarning, traceInfoIfCI } from '../../platform/common/logger'; +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 { getResourceType } from '../../platform/datascience/common'; +import { KernelProgressReporter } from '../../platform/datascience/progress/kernelProgressReporter'; +import { IJupyterSession, ISessionWithSocket, KernelSocketInformation } from '../../platform/datascience/types'; +import { sendTelemetryEvent } from '../../telemetry'; import { Telemetry } from '../../datascience-ui/common/constants'; -import { JupyterInvalidKernelError } from '../../extension/errors/jupyterInvalidKernelError'; -import { JupyterWaitForIdleError } from '../../extension/errors/jupyterWaitForIdleError'; -import { KernelInterruptTimeoutError } from '../../extension/errors/kernelInterruptTimeoutError'; -import { SessionDisposedError } from '../../extension/errors/sessionDisposedError'; +import { JupyterInvalidKernelError } from '../../platform/errors/jupyterInvalidKernelError'; +import { JupyterWaitForIdleError } from '../../platform/errors/jupyterWaitForIdleError'; +import { KernelInterruptTimeoutError } from '../../platform/errors/kernelInterruptTimeoutError'; +import { SessionDisposedError } from '../../platform/errors/sessionDisposedError'; import { suppressShutdownErrors } from '../raw/session/rawKernel'; import { KernelConnectionMetadata } from '../types'; import { ChainingExecuteRequester } from './chainingExecuteRequester'; diff --git a/src/kernels/common/delayedFutureExecute.ts b/src/kernels/common/delayedFutureExecute.ts index c66c2d0e18b..957f0e94bef 100644 --- a/src/kernels/common/delayedFutureExecute.ts +++ b/src/kernels/common/delayedFutureExecute.ts @@ -3,9 +3,9 @@ 'use strict'; import type { JSONObject } from '@lumino/coreutils'; import type { Kernel, KernelMessage } from '@jupyterlab/services'; -import { CancellationError } from '../../client/common/cancellation'; -import { traceInfoIfCI } from '../../client/common/logger'; -import { createDeferred } from '../../client/common/utils/async'; +import { CancellationError } from '../../platform/common/cancellation'; +import { traceInfoIfCI } from '../../platform/common/logger'; +import { createDeferred } from '../../platform/common/utils/async'; // Wraps a future so that a requestExecute on a session will wait for the previous future to finish before actually executing export class DelayedFutureExecute diff --git a/src/kernels/common/kernelSocketWrapper.ts b/src/kernels/common/kernelSocketWrapper.ts index ced20cfeb3d..e03d2f682c4 100644 --- a/src/kernels/common/kernelSocketWrapper.ts +++ b/src/kernels/common/kernelSocketWrapper.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import * as WebSocketWS from 'ws'; -import { IKernelSocket } from '../../client/datascience/types'; -import { ClassType } from '../../client/ioc/types'; +import { IKernelSocket } from '../../platform/datascience/types'; +import { ClassType } from '../../platform/ioc/types'; /* eslint-disable @typescript-eslint/no-explicit-any */ export type IWebSocketLike = { diff --git a/src/kernels/debugging/interactiveWindowDebugger.ts b/src/kernels/debugging/interactiveWindowDebugger.ts index 832b34161d4..a4e0cca6aab 100644 --- a/src/kernels/debugging/interactiveWindowDebugger.ts +++ b/src/kernels/debugging/interactiveWindowDebugger.ts @@ -4,21 +4,21 @@ import type * as nbformat from '@jupyterlab/nbformat'; import { inject, injectable, named } from 'inversify'; import { DebugConfiguration, Disposable, NotebookDocument } from 'vscode'; -import { IPythonDebuggerPathProvider } from '../../client/api/types'; -import { traceInfo, traceInfoIfCI, traceWarning } from '../../client/common/logger'; -import { IPlatformService } from '../../client/common/platform/types'; -import { IConfigurationService } from '../../client/common/types'; -import { DataScience } from '../../client/common/utils/localize'; +import { IPythonDebuggerPathProvider } from '../../platform/api/types'; +import { traceInfo, traceInfoIfCI, traceWarning } from '../../platform/common/logger'; +import { IPlatformService } from '../../platform/common/platform/types'; +import { IConfigurationService } from '../../platform/common/types'; +import { DataScience } from '../../platform/common/utils/localize'; import { IInteractiveWindowDebugger, ICellHashListener, IJupyterDebugService, IFileHashes, ISourceMapRequest -} from '../../client/datascience/types'; +} from '../../platform/datascience/types'; import { Identifiers, Telemetry } from '../../datascience-ui/common/constants'; -import { JupyterDebuggerNotInstalledError } from '../../extension/errors/jupyterDebuggerNotInstalledError'; -import { JupyterDebuggerRemoteNotSupportedError } from '../../extension/errors/jupyterDebuggerRemoteNotSupportedError'; +import { JupyterDebuggerNotInstalledError } from '../../platform/errors/jupyterDebuggerNotInstalledError'; +import { JupyterDebuggerRemoteNotSupportedError } from '../../platform/errors/jupyterDebuggerRemoteNotSupportedError'; import { executeSilently } from '../helpers'; import { getPlainTextOrStreamOutput } from '../kernel'; import { IKernel, isLocalConnection } from '../types'; diff --git a/src/kernels/debugging/jupyterDebugService.ts b/src/kernels/debugging/jupyterDebugService.ts index b0ea37d1cda..13d4d0bd4f7 100644 --- a/src/kernels/debugging/jupyterDebugService.ts +++ b/src/kernels/debugging/jupyterDebugService.ts @@ -23,13 +23,13 @@ import { WorkspaceFolder } from 'vscode'; import { DebugProtocol } from 'vscode-debugprotocol'; -import { traceInfo, traceError } from '../../client/common/logger'; -import { IDisposableRegistry } from '../../client/common/types'; -import { createDeferred } from '../../client/common/utils/async'; -import { noop } from '../../client/common/utils/misc'; -import { EXTENSION_ROOT_DIR } from '../../client/constants'; -import { IJupyterDebugService } from '../../client/datascience/types'; -import { IProtocolParser } from '../../client/debugger/extension/types'; +import { traceInfo, traceError } from '../../platform/common/logger'; +import { IDisposableRegistry } from '../../platform/common/types'; +import { createDeferred } from '../../platform/common/utils/async'; +import { noop } from '../../platform/common/utils/misc'; +import { EXTENSION_ROOT_DIR } from '../../platform/constants'; +import { IJupyterDebugService } from '../../platform/datascience/types'; +import { IProtocolParser } from '../../platform/debugger/extension/types'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/kernels/helpers.ts b/src/kernels/helpers.ts index 9dc9216f5db..048084ffedd 100644 --- a/src/kernels/helpers.ts +++ b/src/kernels/helpers.ts @@ -25,18 +25,18 @@ import { ICommandManager, IVSCodeNotebook, IApplicationShell -} from '../client/common/application/types'; -import { PYTHON_LANGUAGE, isCI } from '../client/common/constants'; -import { traceError, traceInfo, traceInfoIfCI, traceVerbose, traceWarning } from '../client/common/logger'; -import { getDisplayPath } from '../client/common/platform/fs-paths'; -import { IPythonExecutionFactory } from '../client/common/process/types'; -import { IPathUtils, IConfigurationService, Resource, IMemento, GLOBAL_MEMENTO } from '../client/common/types'; -import { createDeferred, createDeferredFromPromise, Deferred } from '../client/common/utils/async'; -import { DataScience } from '../client/common/utils/localize'; -import { getResourceType } from '../client/datascience/common'; -import { Settings } from '../client/datascience/constants'; -import { SysInfoReason } from '../extension/messageTypes'; -import { trackKernelResourceInformation, sendKernelTelemetryEvent } from '../client/datascience/telemetry/telemetry'; +} from '../platform/common/application/types'; +import { PYTHON_LANGUAGE, isCI } from '../platform/common/constants'; +import { traceError, traceInfo, traceInfoIfCI, traceVerbose, traceWarning } from '../platform/common/logger'; +import { getDisplayPath } from '../platform/common/platform/fs-paths'; +import { IPythonExecutionFactory } from '../platform/common/process/types'; +import { IPathUtils, IConfigurationService, Resource, IMemento, GLOBAL_MEMENTO } from '../platform/common/types'; +import { createDeferred, createDeferredFromPromise, Deferred } from '../platform/common/utils/async'; +import { DataScience } from '../platform/common/utils/localize'; +import { getResourceType } from '../platform/datascience/common'; +import { Settings } from '../platform/datascience/constants'; +import { SysInfoReason } from '../platform/messageTypes'; +import { trackKernelResourceInformation, sendKernelTelemetryEvent } from '../telemetry/telemetry'; import { IJupyterSession, IInteractiveWindowProvider, @@ -46,15 +46,15 @@ import { KernelInterpreterDependencyResponse, IJupyterKernelSpec, IDisplayOptions -} from '../client/datascience/types'; -import { IServiceContainer } from '../client/ioc/types'; +} from '../platform/datascience/types'; +import { IServiceContainer } from '../platform/ioc/types'; import { getNormalizedInterpreterPath, getInterpreterHash, areInterpreterPathsSame -} from '../client/pythonEnvironments/info/interpreter'; -import { sendTelemetryEvent } from '../client/telemetry'; -import { getTelemetrySafeVersion } from '../client/telemetry/helpers'; +} from '../platform/pythonEnvironments/info/interpreter'; +import { sendTelemetryEvent } from '../telemetry'; +import { getTelemetrySafeVersion } from '../telemetry/helpers'; import { concatMultilineString } from '../datascience-ui/common'; import { Telemetry, Commands } from '../datascience-ui/common/constants'; import { clearInstalledIntoInterpreterMemento } from './installer/productInstaller'; @@ -66,14 +66,14 @@ import { isDefaultKernelSpec, isDefaultPythonKernelSpecName } from './raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder'; -import { EnvironmentType, PythonEnvironment } from '../client/pythonEnvironments/info'; +import { EnvironmentType, PythonEnvironment } from '../platform/pythonEnvironments/info'; import { VSCodeNotebookController } from '../notebooks/controllers/vscodeNotebookController'; import { isPythonNotebook } from '../notebooks/helpers'; import { INotebookControllerManager } from '../notebooks/types'; import { PreferredRemoteKernelIdProvider } from './raw/finder/preferredRemoteKernelIdProvider'; import { findNotebookEditor, selectKernel } from '../notebooks/controllers/kernelSelector'; -import { DisplayOptions } from '../client/datascience/displayOptions'; -import { KernelDeadError } from '../extension/errors/kernelDeadError'; +import { DisplayOptions } from '../platform/datascience/displayOptions'; +import { KernelDeadError } from '../platform/errors/kernelDeadError'; // Helper functions for dealing with kernels and kernelspecs diff --git a/src/kernels/installer/channelManager.ts b/src/kernels/installer/channelManager.ts index 82b9407aaf6..24892fab5b4 100644 --- a/src/kernels/installer/channelManager.ts +++ b/src/kernels/installer/channelManager.ts @@ -2,11 +2,11 @@ // Licensed under the MIT License. import { inject, injectable } from 'inversify'; -import { EnvironmentType, PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { IApplicationShell } from '../../client/common/application/types'; -import { IPlatformService } from '../../client/common/platform/types'; -import { Installer } from '../../client/common/utils/localize'; -import { IServiceContainer } from '../../client/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { IApplicationShell } from '../../platform/common/application/types'; +import { IPlatformService } from '../../platform/common/platform/types'; +import { Installer } from '../../platform/common/utils/localize'; +import { IServiceContainer } from '../../platform/ioc/types'; import { IInstallationChannelManager, IModuleInstaller, Product } from './types'; @injectable() diff --git a/src/kernels/installer/condaInstaller.ts b/src/kernels/installer/condaInstaller.ts index 26e2570c8f0..75991a29e64 100644 --- a/src/kernels/installer/condaInstaller.ts +++ b/src/kernels/installer/condaInstaller.ts @@ -3,9 +3,9 @@ // Licensed under the MIT License. import { inject, injectable } from 'inversify'; -import { EnvironmentType, PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { CondaService } from '../../client/common/process/condaService'; -import { IServiceContainer } from '../../client/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { CondaService } from '../../platform/common/process/condaService'; +import { IServiceContainer } from '../../platform/ioc/types'; import { ExecutionInstallArgs, ModuleInstaller, translateProductToModule } from './moduleInstaller'; import { ModuleInstallerType, ModuleInstallFlags, Product } from './types'; import * as path from 'path'; diff --git a/src/kernels/installer/moduleInstaller.ts b/src/kernels/installer/moduleInstaller.ts index ea3da688220..816780d58ad 100644 --- a/src/kernels/installer/moduleInstaller.ts +++ b/src/kernels/installer/moduleInstaller.ts @@ -1,23 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. - -import { inject, injectable } from 'inversify'; import { CancellationToken, CancellationTokenSource, Progress, ProgressLocation, ProgressOptions } from 'vscode'; -import { IApplicationShell } from '../../client/common/application/types'; -import { STANDARD_OUTPUT_CHANNEL } from '../../client/common/constants'; -import { traceError, traceInfo } from '../../client/common/logger'; +import { IApplicationShell } from '../../platform/common/application/types'; +import { STANDARD_OUTPUT_CHANNEL } from '../../platform/common/constants'; +import { traceError, traceInfo } from '../../platform/common/logger'; import { IProcessServiceFactory, IPythonExecutionFactory, ObservableExecutionResult -} from '../../client/common/process/types'; -import { IOutputChannel } from '../../client/common/types'; -import { createDeferred } from '../../client/common/utils/async'; -import { Products } from '../../client/common/utils/localize'; -import { IEnvironmentVariablesService } from '../../client/common/variables/types'; -import { IEnvironmentActivationService } from '../../client/interpreter/activation/types'; -import { IServiceContainer } from '../../client/ioc/types'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +} from '../../platform/common/process/types'; +import { IOutputChannel } from '../../platform/common/types'; +import { createDeferred } from '../../platform/common/utils/async'; +import { Products } from '../../platform/common/utils/localize'; +import { IEnvironmentVariablesService } from '../../platform/common/variables/types'; +import { IEnvironmentActivationService } from '../../platform/interpreter/activation/types'; +import { IServiceContainer } from '../../platform/ioc/types'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; import { IModuleInstaller, ModuleInstallerType, ModuleInstallFlags, Product } from './types'; export type ExecutionInstallArgs = { @@ -27,14 +25,13 @@ export type ExecutionInstallArgs = { useShellExec?: boolean; }; -@injectable() export abstract class ModuleInstaller implements IModuleInstaller { public abstract get priority(): number; public abstract get name(): string; public abstract get displayName(): string; public abstract get type(): ModuleInstallerType; - constructor(@inject(IServiceContainer) protected serviceContainer: IServiceContainer) {} + constructor(protected serviceContainer: IServiceContainer) {} public async installModule( productOrModuleName: Product | string, diff --git a/src/kernels/installer/pipEnvInstaller.ts b/src/kernels/installer/pipEnvInstaller.ts index 9de7647edea..21266898cae 100644 --- a/src/kernels/installer/pipEnvInstaller.ts +++ b/src/kernels/installer/pipEnvInstaller.ts @@ -2,16 +2,16 @@ // Licensed under the MIT License. import { inject, injectable } from 'inversify'; -import { EnvironmentType, PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { IWorkspaceService } from '../../client/common/application/types'; -import { InterpreterUri } from '../../client/common/types'; -import { isResource } from '../../client/common/utils/misc'; -import { IInterpreterService } from '../../client/interpreter/contracts'; +import { EnvironmentType, PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { IWorkspaceService } from '../../platform/common/application/types'; +import { InterpreterUri } from '../../platform/common/types'; +import { isResource } from '../../platform/common/utils/misc'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; import { ExecutionInstallArgs, ModuleInstaller } from './moduleInstaller'; import { ModuleInstallerType, ModuleInstallFlags } from './types'; import { isPipenvEnvironmentRelatedToFolder } from './pipenv'; -import { getInterpreterWorkspaceFolder } from '../../client/../kernels/helpers'; -import { IServiceContainer } from '../../client/ioc/types'; +import { getInterpreterWorkspaceFolder } from '../../platform/../kernels/helpers'; +import { IServiceContainer } from '../../platform/ioc/types'; export const pipenvName = 'pipenv'; diff --git a/src/kernels/installer/pipInstaller.ts b/src/kernels/installer/pipInstaller.ts index 908daa9cce2..c31aed82855 100644 --- a/src/kernels/installer/pipInstaller.ts +++ b/src/kernels/installer/pipInstaller.ts @@ -1,17 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { injectable } from 'inversify'; +import { inject, injectable } from 'inversify'; import { ExecutionInstallArgs, ModuleInstaller, translateProductToModule } from './moduleInstaller'; import * as path from 'path'; -import { IWorkspaceService } from '../../client/common/application/types'; -import { _SCRIPTS_DIR } from '../../client/common/process/internal/scripts'; -import { IPythonExecutionFactory } from '../../client/common/process/types'; +import { IWorkspaceService } from '../../platform/common/application/types'; +import { _SCRIPTS_DIR } from '../../platform/common/process/internal/scripts'; +import { IPythonExecutionFactory } from '../../platform/common/process/types'; import { ModuleInstallerType, ModuleInstallFlags, Product, IInstaller } from './types'; -import { EnvironmentType, PythonEnvironment } from '../../client/pythonEnvironments/info'; +import { EnvironmentType, PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { IServiceContainer } from '../../platform/ioc/types'; @injectable() export class PipInstaller extends ModuleInstaller { + // eslint-disable-next-line @typescript-eslint/no-useless-constructor + constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) { + super(serviceContainer); + } + public get name(): string { return 'Pip'; } diff --git a/src/kernels/installer/pipenv.ts b/src/kernels/installer/pipenv.ts index d826b0788f6..f7b892f6d1f 100644 --- a/src/kernels/installer/pipenv.ts +++ b/src/kernels/installer/pipenv.ts @@ -2,9 +2,9 @@ // Licensed under the MIT License. import * as path from 'path'; -import { traceError } from '../../client/common/logger'; -import { getEnvironmentVariable } from '../../client/common/utils/platform'; -import { pathExists, readFile, arePathsSame, normCasePath } from '../../client/common/platform/fileUtils'; +import { traceError } from '../../platform/common/logger'; +import { getEnvironmentVariable } from '../../platform/common/utils/platform'; +import { pathExists, readFile, arePathsSame, normCasePath } from '../../platform/common/platform/fileUtils'; function getSearchHeight() { // PIPENV_MAX_DEPTH tells pipenv the maximum number of directories to recursively search for diff --git a/src/kernels/installer/poetry.ts b/src/kernels/installer/poetry.ts index 12089366f92..f9db4abe1b9 100644 --- a/src/kernels/installer/poetry.ts +++ b/src/kernels/installer/poetry.ts @@ -4,12 +4,11 @@ 'use strict'; import * as path from 'path'; -import { isTestExecution } from '../../client/common/constants'; -import { traceVerbose, traceError } from '../../client/common/logger'; -import { cache } from '../../client/common/utils/decorators'; -import { getUserHomeDir } from '../../client/common/utils/platform'; -import { StopWatch } from '../../client/common/utils/stopWatch'; -import { getOSType, OSType } from '../../test/common'; +import { isTestExecution } from '../../platform/common/constants'; +import { traceVerbose, traceError } from '../../platform/common/logger'; +import { cache } from '../../platform/common/utils/decorators'; +import { getOSType, getUserHomeDir, OSType } from '../../platform/common/utils/platform'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; import { getPythonSetting, shellExecute, @@ -19,7 +18,7 @@ import { getEnvironmentDirFromPath, isVirtualenvEnvironment, pathExists -} from '../../client/common/platform/fileUtils'; +} from '../../platform/common/platform/fileUtils'; /** * Global virtual env dir for a project is named as: diff --git a/src/kernels/installer/poetryInstaller.ts b/src/kernels/installer/poetryInstaller.ts index 587ff5489ef..edeec62bbe6 100644 --- a/src/kernels/installer/poetryInstaller.ts +++ b/src/kernels/installer/poetryInstaller.ts @@ -4,11 +4,11 @@ 'use strict'; import { inject, injectable } from 'inversify'; -import { EnvironmentType, PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { IWorkspaceService } from '../../client/common/application/types'; -import { IConfigurationService } from '../../client/common/types'; -import { getInterpreterWorkspaceFolder } from '../../client/../kernels/helpers'; -import { IServiceContainer } from '../../client/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { IWorkspaceService } from '../../platform/common/application/types'; +import { IConfigurationService } from '../../platform/common/types'; +import { getInterpreterWorkspaceFolder } from '../../platform/../kernels/helpers'; +import { IServiceContainer } from '../../platform/ioc/types'; import { ExecutionInstallArgs, ModuleInstaller } from './moduleInstaller'; import { isPoetryEnvironmentRelatedToFolder } from './poetry'; import { ModuleInstallerType } from './types'; diff --git a/src/kernels/installer/productInstaller.ts b/src/kernels/installer/productInstaller.ts index 03b963ba6af..2e68f5ea640 100644 --- a/src/kernels/installer/productInstaller.ts +++ b/src/kernels/installer/productInstaller.ts @@ -16,12 +16,12 @@ import { ProductInstallStatus, ProductType } from './types'; -import { traceDecorators } from '../../client/logging'; -import { logValue } from '../../client/logging/trace'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { IApplicationShell, IWorkspaceService } from '../../client/common/application/types'; -import { traceError } from '../../client/common/logger'; -import { IPythonExecutionFactory, IProcessServiceFactory } from '../../client/common/process/types'; +import { traceDecorators } from '../../platform/logging'; +import { logValue } from '../../platform/logging/trace'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { IApplicationShell, IWorkspaceService } from '../../platform/common/application/types'; +import { traceError } from '../../platform/common/logger'; +import { IPythonExecutionFactory, IProcessServiceFactory } from '../../platform/common/process/types'; import { IConfigurationService, IPersistentStateFactory, @@ -29,15 +29,15 @@ import { IMemento, IOutputChannel, InterpreterUri -} from '../../client/common/types'; -import { isResource } from '../../client/common/utils/misc'; -import { IServiceContainer } from '../../client/ioc/types'; -import { sendTelemetryEvent } from '../../client/telemetry'; -import { InterpreterPackages } from '../../client/datascience/telemetry/interpreterPackages'; -import { getInterpreterHash } from '../../client/pythonEnvironments/info/interpreter'; -import { noop, sleep } from '../../test/core'; +} from '../../platform/common/types'; +import { isResource, noop } from '../../platform/common/utils/misc'; +import { IServiceContainer } from '../../platform/ioc/types'; +import { sendTelemetryEvent } from '../../telemetry'; +import { InterpreterPackages } from '../../telemetry/interpreterPackages'; +import { getInterpreterHash } from '../../platform/pythonEnvironments/info/interpreter'; import { Telemetry } from '../../datascience-ui/common/constants'; -import { STANDARD_OUTPUT_CHANNEL } from '../../client/common/constants'; +import { STANDARD_OUTPUT_CHANNEL } from '../../platform/common/constants'; +import { sleep } from '../../platform/common/utils/async'; /** * Keep track of the fact that we attempted to install a package into an interpreter. diff --git a/src/kernels/installer/productPath.ts b/src/kernels/installer/productPath.ts index 8ab3808f660..c609f238663 100644 --- a/src/kernels/installer/productPath.ts +++ b/src/kernels/installer/productPath.ts @@ -3,18 +3,17 @@ 'use strict'; -import { inject, injectable } from 'inversify'; +import { injectable, inject } from 'inversify'; import * as path from 'path'; import { Uri } from 'vscode'; -import { IConfigurationService } from '../../client/common/types'; -import { IServiceContainer } from '../../client/ioc/types'; +import { IConfigurationService } from '../../platform/common/types'; +import { IServiceContainer } from '../../platform/ioc/types'; import { IInstaller, IProductPathService, ModuleNamePurpose, Product } from './types'; -@injectable() export abstract class BaseProductPathsService implements IProductPathService { protected readonly configService: IConfigurationService; protected readonly productInstaller: IInstaller; - constructor(@inject(IServiceContainer) protected serviceContainer: IServiceContainer) { + constructor(protected serviceContainer: IServiceContainer) { this.configService = serviceContainer.get(IConfigurationService); this.productInstaller = serviceContainer.get(IInstaller); } diff --git a/src/kernels/installer/pyenv.ts b/src/kernels/installer/pyenv.ts index 65ac438f1fc..2a3c5298598 100644 --- a/src/kernels/installer/pyenv.ts +++ b/src/kernels/installer/pyenv.ts @@ -1,6 +1,6 @@ import * as path from 'path'; -import { getEnvironmentVariable, getOSType, getUserHomeDir, OSType } from '../../client/common/utils/platform'; -import { arePathsSame, isParentPath, pathExists } from '../../client/common/platform/fileUtils'; +import { getEnvironmentVariable, getOSType, getUserHomeDir, OSType } from '../../platform/common/utils/platform'; +import { arePathsSame, isParentPath, pathExists } from '../../platform/common/platform/fileUtils'; export function getPyenvDir(): string { // Check if the pyenv environment variables exist: PYENV on Windows, PYENV_ROOT on Unix. diff --git a/src/kernels/installer/serviceRegistry.ts b/src/kernels/installer/serviceRegistry.ts index 0a24a92adca..f1025ece16d 100644 --- a/src/kernels/installer/serviceRegistry.ts +++ b/src/kernels/installer/serviceRegistry.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. 'use strict'; -import { IServiceManager } from '../../client/ioc/types'; +import { IServiceManager } from '../../platform/ioc/types'; import { InstallationChannelManager } from './channelManager'; import { CondaInstaller } from './condaInstaller'; import { PipEnvInstaller } from './pipEnvInstaller'; diff --git a/src/kernels/installer/types.ts b/src/kernels/installer/types.ts index 60a71b24a0e..c0269705644 100644 --- a/src/kernels/installer/types.ts +++ b/src/kernels/installer/types.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. import { CancellationTokenSource, Event, Uri } from 'vscode'; -import { InterpreterUri } from '../../client/common/types'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +import { InterpreterUri } from '../../platform/common/types'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; export enum InstallerResponse { Installed, diff --git a/src/kernels/ipywidgets-message-coordination/cdnWidgetScriptSourceProvider.ts b/src/kernels/ipywidgets-message-coordination/cdnWidgetScriptSourceProvider.ts index 8adc6f7d5f2..50d7d8c2f62 100644 --- a/src/kernels/ipywidgets-message-coordination/cdnWidgetScriptSourceProvider.ts +++ b/src/kernels/ipywidgets-message-coordination/cdnWidgetScriptSourceProvider.ts @@ -7,12 +7,12 @@ import * as download from 'download'; import { sha256 } from 'hash.js'; import * as path from 'path'; import { Uri } from 'vscode'; -import { traceError, traceInfo, traceInfoIfCI } from '../../client/common/logger'; -import { IFileSystem, TemporaryFile } from '../../client/common/platform/types'; -import { IConfigurationService, WidgetCDNs } from '../../client/common/types'; -import { createDeferred } from '../../client/common/utils/async'; -import { ILocalResourceUriConverter } from '../../client/datascience/types'; -import { ConsoleForegroundColors } from '../../client/logging/_global'; +import { traceError, traceInfo, traceInfoIfCI } from '../../platform/common/logger'; +import { IFileSystem, TemporaryFile } from '../../platform/common/platform/types'; +import { IConfigurationService, WidgetCDNs } from '../../platform/common/types'; +import { createDeferred } from '../../platform/common/utils/async'; +import { ILocalResourceUriConverter } from '../../platform/datascience/types'; +import { ConsoleForegroundColors } from '../../platform/logging/_global'; import { IWidgetScriptSourceProvider, WidgetScriptSource } from './types'; // Source borrowed from https://github.com/jupyter-widgets/ipywidgets/blob/54941b7a4b54036d089652d91b39f937bde6b6cd/packages/html-manager/src/libembed-amd.ts#L33 diff --git a/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts b/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts index bc7ff2a47f8..0f4bc0cece9 100644 --- a/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts +++ b/src/kernels/ipywidgets-message-coordination/commonMessageCoordinator.ts @@ -4,13 +4,12 @@ 'use strict'; import type { KernelMessage } from '@jupyterlab/services'; -import { injectable } from 'inversify'; import { Event, EventEmitter, NotebookDocument } from 'vscode'; -import { IApplicationShell, ICommandManager, IWorkspaceService } from '../../client/common/application/types'; -import { STANDARD_OUTPUT_CHANNEL } from '../../client/common/constants'; -import { traceVerbose, traceError, traceInfo, traceInfoIfCI } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IPythonExecutionFactory } from '../../client/common/process/types'; +import { IApplicationShell, ICommandManager, IWorkspaceService } from '../../platform/common/application/types'; +import { STANDARD_OUTPUT_CHANNEL } from '../../platform/common/constants'; +import { traceVerbose, traceError, traceInfo, traceInfoIfCI } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IPythonExecutionFactory } from '../../platform/common/process/types'; import { IDisposableRegistry, IOutputChannel, @@ -18,16 +17,16 @@ import { IHttpClient, IPersistentStateFactory, IExtensionContext -} from '../../client/common/types'; -import { Common, DataScience } from '../../client/common/utils/localize'; -import { noop } from '../../client/common/utils/misc'; -import { stripAnsi } from '../../client/common/utils/regexp'; -import { InteractiveWindowMessages } from '../../extension/messageTypes'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { IServiceContainer } from '../../client/ioc/types'; -import { ConsoleForegroundColors } from '../../client/logging/_global'; -import { sendTelemetryEvent } from '../../client/telemetry'; -import { getTelemetrySafeHashedString } from '../../client/telemetry/helpers'; +} from '../../platform/common/types'; +import { Common, DataScience } from '../../platform/common/utils/localize'; +import { noop } from '../../platform/common/utils/misc'; +import { stripAnsi } from '../../platform/common/utils/regexp'; +import { InteractiveWindowMessages } from '../../platform/messageTypes'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { IServiceContainer } from '../../platform/ioc/types'; +import { ConsoleForegroundColors } from '../../platform/logging/_global'; +import { sendTelemetryEvent } from '../../telemetry'; +import { getTelemetrySafeHashedString } from '../../telemetry/helpers'; import { Telemetry, Commands } from '../../datascience-ui/common/constants'; import { LoadIPyWidgetClassLoadAction, @@ -42,7 +41,6 @@ import { IIPyWidgetMessageDispatcher } from './types'; /** * This class wraps all of the ipywidgets communication with a backing notebook */ -@injectable() // export class CommonMessageCoordinator { // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcher.ts b/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcher.ts index 3f3cc8a7ac0..e62c8900a16 100644 --- a/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcher.ts +++ b/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcher.ts @@ -8,14 +8,14 @@ import * as util from 'util'; import * as uuid from 'uuid/v4'; import { Event, EventEmitter, NotebookDocument } from 'vscode'; import type { Data as WebSocketData } from 'ws'; -import { traceInfoIfCI, traceVerbose, traceError } from '../../client/common/logger'; -import { IDisposable } from '../../client/common/types'; -import { Deferred, createDeferred } from '../../client/common/utils/async'; -import { noop } from '../../client/common/utils/misc'; -import { deserializeDataViews, serializeDataViews } from '../../client/common/utils/serializers'; -import { IPyWidgetMessages, IInteractiveWindowMapping } from '../../extension/messageTypes'; -import { KernelSocketInformation } from '../../client/datascience/types'; -import { sendTelemetryEvent } from '../../client/telemetry'; +import { traceInfoIfCI, traceVerbose, traceError } from '../../platform/common/logger'; +import { IDisposable } from '../../platform/common/types'; +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 { KernelSocketInformation } from '../../platform/datascience/types'; +import { sendTelemetryEvent } from '../../telemetry'; import { Identifiers, Telemetry } from '../../datascience-ui/common/constants'; import { IKernel, IKernelProvider } from '../types'; import { WIDGET_MIMETYPE } from './constants'; diff --git a/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcherFactory.ts b/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcherFactory.ts index d0d9698e0b1..58f365c90ce 100644 --- a/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcherFactory.ts +++ b/src/kernels/ipywidgets-message-coordination/ipyWidgetMessageDispatcherFactory.ts @@ -5,8 +5,8 @@ import { inject, injectable } from 'inversify'; import { Event, EventEmitter, NotebookDocument } from 'vscode'; -import { IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { IPyWidgetMessages } from '../../extension/messageTypes'; +import { IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { IPyWidgetMessages } from '../../platform/messageTypes'; import { IKernel, IKernelProvider } from '../types'; import { IPyWidgetMessageDispatcher } from './ipyWidgetMessageDispatcher'; import { IIPyWidgetMessageDispatcher, IPyWidgetMessage } from './types'; diff --git a/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSource.ts b/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSource.ts index ed8b7a6f1b6..856668edb93 100644 --- a/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSource.ts +++ b/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSource.ts @@ -6,10 +6,10 @@ import type * as jupyterlabService from '@jupyterlab/services'; import { sha256 } from 'hash.js'; import * as path from 'path'; import { Event, EventEmitter, NotebookDocument, Uri } from 'vscode'; -import { IApplicationShell, IWorkspaceService } from '../../client/common/application/types'; -import { traceError, traceInfo, traceVerbose } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IPythonExecutionFactory } from '../../client/common/process/types'; +import { IApplicationShell, IWorkspaceService } from '../../platform/common/application/types'; +import { traceError, traceInfo, traceVerbose } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IPythonExecutionFactory } from '../../platform/common/process/types'; import { IDisposableRegistry, IConfigurationService, @@ -17,18 +17,18 @@ import { IPersistentStateFactory, IExtensionContext, IDisposable -} from '../../client/common/types'; -import { Deferred, createDeferred } from '../../client/common/utils/async'; -import { InteractiveWindowMessages, IPyWidgetMessages } from '../../extension/messageTypes'; -import { ILocalResourceUriConverter } from '../../client/datascience/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { ConsoleForegroundColors } from '../../client/logging/_global'; -import { sendTelemetryEvent } from '../../client/telemetry'; +} from '../../platform/common/types'; +import { Deferred, createDeferred } from '../../platform/common/utils/async'; +import { InteractiveWindowMessages, IPyWidgetMessages } from '../../platform/messageTypes'; +import { ILocalResourceUriConverter } from '../../platform/datascience/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { ConsoleForegroundColors } from '../../platform/logging/_global'; +import { sendTelemetryEvent } from '../../telemetry'; import { Telemetry } from '../../datascience-ui/common/constants'; -import { getOSType, OSType } from '../../test/common'; import { IKernel, IKernelProvider } from '../types'; import { IPyWidgetScriptSourceProvider } from './ipyWidgetScriptSourceProvider'; import { WidgetScriptSource } from './types'; +import { getOSType, OSType } from '../../platform/common/utils/platform'; /* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */ const sanitize = require('sanitize-filename'); diff --git a/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts b/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts index 0ffd827691b..da755f60e31 100644 --- a/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts +++ b/src/kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider.ts @@ -4,25 +4,25 @@ 'use strict'; import { ConfigurationChangeEvent, ConfigurationTarget } from 'vscode'; -import { IApplicationShell, IWorkspaceService } from '../../client/common/application/types'; -import '../../client/common/extensions'; -import { traceError } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IPythonExecutionFactory } from '../../client/common/process/types'; +import { IApplicationShell, IWorkspaceService } from '../../platform/common/application/types'; +import '../../platform/common/extensions'; +import { traceError } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IPythonExecutionFactory } from '../../platform/common/process/types'; import { WidgetCDNs, IPersistentState, IConfigurationService, IPersistentStateFactory, IHttpClient -} from '../../client/common/types'; -import { Deferred, createDeferred } from '../../client/common/utils/async'; -import { DataScience, Common } from '../../client/common/utils/localize'; -import { noop } from '../../client/common/utils/misc'; -import { ILocalResourceUriConverter } from '../../client/datascience/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { sendTelemetryEvent } from '../../client/telemetry'; -import { getTelemetrySafeHashedString } from '../../client/telemetry/helpers'; +} from '../../platform/common/types'; +import { Deferred, createDeferred } from '../../platform/common/utils/async'; +import { DataScience, Common } from '../../platform/common/utils/localize'; +import { noop } from '../../platform/common/utils/misc'; +import { ILocalResourceUriConverter } from '../../platform/datascience/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { sendTelemetryEvent } from '../../telemetry'; +import { getTelemetrySafeHashedString } from '../../telemetry/helpers'; import { Telemetry } from '../../datascience-ui/common/constants'; import { IKernel } from '../types'; import { CDNWidgetScriptSourceProvider } from './cdnWidgetScriptSourceProvider'; diff --git a/src/kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider.ts b/src/kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider.ts index c2cebef8d91..d0028590411 100644 --- a/src/kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider.ts +++ b/src/kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider.ts @@ -5,12 +5,12 @@ import * as path from 'path'; import { Uri } from 'vscode'; -import { traceError } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IPythonExecutionFactory } from '../../client/common/process/types'; -import { ILocalResourceUriConverter } from '../../client/datascience/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { captureTelemetry } from '../../client/telemetry'; +import { traceError } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IPythonExecutionFactory } from '../../platform/common/process/types'; +import { ILocalResourceUriConverter } from '../../platform/datascience/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { captureTelemetry } from '../../telemetry'; import { Telemetry } from '../../datascience-ui/common/constants'; import { getInterpreterFromKernelConnectionMetadata, diff --git a/src/kernels/ipywidgets-message-coordination/notebookIPyWidgetCoordinator.ts b/src/kernels/ipywidgets-message-coordination/notebookIPyWidgetCoordinator.ts index 9cc2a7af0b7..21e9e2f5b0d 100644 --- a/src/kernels/ipywidgets-message-coordination/notebookIPyWidgetCoordinator.ts +++ b/src/kernels/ipywidgets-message-coordination/notebookIPyWidgetCoordinator.ts @@ -10,17 +10,17 @@ import { EventEmitter, CancellationTokenSource } from 'vscode'; -import { IVSCodeNotebook } from '../../client/common/application/types'; -import { Cancellation } from '../../client/common/cancellation'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { traceInfo, traceVerbose, traceInfoIfCI } from '../../client/common/logger'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; -import { IDisposableRegistry, IAsyncDisposableRegistry, IDisposable } from '../../client/common/types'; -import { createDeferred } from '../../client/common/utils/async'; -import { noop } from '../../client/common/utils/misc'; -import { InteractiveWindowMessages, IPyWidgetMessages } from '../../extension/messageTypes'; -import { IServiceContainer } from '../../client/ioc/types'; -import { ConsoleForegroundColors } from '../../client/logging/_global'; +import { IVSCodeNotebook } from '../../platform/common/application/types'; +import { Cancellation } from '../../platform/common/cancellation'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { traceInfo, traceVerbose, traceInfoIfCI } from '../../platform/common/logger'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; +import { IDisposableRegistry, IAsyncDisposableRegistry, IDisposable } from '../../platform/common/types'; +import { createDeferred } from '../../platform/common/utils/async'; +import { noop } from '../../platform/common/utils/misc'; +import { InteractiveWindowMessages, IPyWidgetMessages } from '../../platform/messageTypes'; +import { IServiceContainer } from '../../platform/ioc/types'; +import { ConsoleForegroundColors } from '../../platform/logging/_global'; import { CommonMessageCoordinator } from './commonMessageCoordinator'; import { VSCodeNotebookController } from '../../notebooks/controllers/vscodeNotebookController'; import { INotebookCommunication } from '../../notebooks/types'; diff --git a/src/kernels/ipywidgets-message-coordination/remoteWidgetScriptSourceProvider.ts b/src/kernels/ipywidgets-message-coordination/remoteWidgetScriptSourceProvider.ts index 2e9177dc071..ea477e2eae2 100644 --- a/src/kernels/ipywidgets-message-coordination/remoteWidgetScriptSourceProvider.ts +++ b/src/kernels/ipywidgets-message-coordination/remoteWidgetScriptSourceProvider.ts @@ -3,8 +3,8 @@ 'use strict'; -import { traceWarning } from '../../client/common/logger'; -import { IHttpClient } from '../../client/common/types'; +import { traceWarning } from '../../platform/common/logger'; +import { IHttpClient } from '../../platform/common/types'; import { IWidgetScriptSourceProvider, WidgetScriptSource } from './types'; /** diff --git a/src/kernels/ipywidgets-message-coordination/types.ts b/src/kernels/ipywidgets-message-coordination/types.ts index fe5f103fa48..0140a43e8e6 100644 --- a/src/kernels/ipywidgets-message-coordination/types.ts +++ b/src/kernels/ipywidgets-message-coordination/types.ts @@ -4,8 +4,8 @@ 'use strict'; import { Event } from 'vscode'; -import { IDisposable } from '../../client/common/types'; -import { IPyWidgetMessages } from '../../extension/messageTypes'; +import { IDisposable } from '../../platform/common/types'; +import { IPyWidgetMessages } from '../../platform/messageTypes'; export interface IPyWidgetMessage { message: IPyWidgetMessages; diff --git a/src/kernels/jupyter/import-export/jupyterExporter.ts b/src/kernels/jupyter/import-export/jupyterExporter.ts index 59059428f0c..7c0d4197638 100644 --- a/src/kernels/jupyter/import-export/jupyterExporter.ts +++ b/src/kernels/jupyter/import-export/jupyterExporter.ts @@ -7,20 +7,20 @@ import * as os from 'os'; import * as path from 'path'; import { Uri } from 'vscode'; -import { IWorkspaceService, IApplicationShell } from '../../../client/common/application/types'; -import { traceError } from '../../../client/common/logger'; -import { IFileSystem, IPlatformService } from '../../../client/common/platform/types'; -import { IConfigurationService } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { CellMatcher } from '../../../client/datascience/cellMatcher'; -import { pruneCell } from '../../../client/datascience/common'; +import { IWorkspaceService, IApplicationShell } from '../../../platform/common/application/types'; +import { traceError } from '../../../platform/common/logger'; +import { IFileSystem, IPlatformService } from '../../../platform/common/platform/types'; +import { IConfigurationService } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { CellMatcher } from '../../../platform/datascience/cellMatcher'; +import { pruneCell } from '../../../platform/datascience/common'; import { INotebookExporter, IJupyterExecution, INotebookEditorProvider, IDataScienceErrorHandler, ICell -} from '../../../client/datascience/types'; +} from '../../../platform/datascience/types'; import { concatMultilineString } from '../../../datascience-ui/common'; import { createCodeCell } from '../../../datascience-ui/common/cellFactory'; import { defaultNotebookFormat, CodeSnippets } from '../../../datascience-ui/common/constants'; diff --git a/src/kernels/jupyter/import-export/jupyterImporter.ts b/src/kernels/jupyter/import-export/jupyterImporter.ts index a1b1b2c9770..69389541dbc 100644 --- a/src/kernels/jupyter/import-export/jupyterImporter.ts +++ b/src/kernels/jupyter/import-export/jupyterImporter.ts @@ -1,26 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../../../client/common/extensions'; +import '../../../platform/common/extensions'; import { inject, injectable } from 'inversify'; import * as os from 'os'; import * as path from 'path'; import { Uri } from 'vscode'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { traceError } from '../../../client/common/logger'; -import { IFileSystem, IPlatformService } from '../../../client/common/platform/types'; -import { IDisposableRegistry, IConfigurationService } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { traceError } from '../../../platform/common/logger'; +import { IFileSystem, IPlatformService } from '../../../platform/common/platform/types'; +import { IDisposableRegistry, IConfigurationService } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; import { INotebookImporter, INbConvertInterpreterDependencyChecker, INbConvertExportToPythonService -} from '../../../client/datascience/types'; +} from '../../../platform/datascience/types'; import { Identifiers, CodeSnippets } from '../../../datascience-ui/common/constants'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; -import { noop } from '../../../client/common/utils/misc'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; +import { noop } from '../../../platform/common/utils/misc'; @injectable() export class JupyterImporter implements INotebookImporter { diff --git a/src/kernels/jupyter/interpreter/jupyterCommand.ts b/src/kernels/jupyter/interpreter/jupyterCommand.ts index 4e3c1282b96..7a8f9de7dab 100644 --- a/src/kernels/jupyter/interpreter/jupyterCommand.ts +++ b/src/kernels/jupyter/interpreter/jupyterCommand.ts @@ -4,16 +4,16 @@ import { SpawnOptions } from 'child_process'; import { inject, injectable } from 'inversify'; import * as path from 'path'; -import { traceError } from '../../../client/common/logger'; +import { traceError } from '../../../platform/common/logger'; import { IPythonExecutionService, IPythonExecutionFactory, IPythonDaemonExecutionService, ExecutionResult -} from '../../../client/common/process/types'; -import { EXTENSION_ROOT_DIR } from '../../../client/constants'; -import { IJupyterCommand, IJupyterCommandFactory } from '../../../client/datascience/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +} from '../../../platform/common/process/types'; +import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; +import { IJupyterCommand, IJupyterCommandFactory } from '../../../platform/datascience/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { JupyterDaemonModule, JupyterCommands } from '../../../datascience-ui/common/constants'; class InterpreterJupyterCommand implements IJupyterCommand { diff --git a/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts b/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts index 1105448874e..0196119cf2c 100644 --- a/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts +++ b/src/kernels/jupyter/interpreter/jupyterInterpreterDependencyService.ts @@ -5,19 +5,19 @@ import { inject, injectable } from 'inversify'; import { CancellationToken, CancellationTokenSource } from 'vscode'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { createPromiseFromCancellation, Cancellation } from '../../../client/common/cancellation'; -import { traceError } from '../../../client/common/logger'; -import { DataScience, Common } from '../../../client/common/utils/localize'; -import { noop } from '../../../client/common/utils/misc'; -import { HelpLinks } from '../../../client/datascience/constants'; -import { reportAction } from '../../../client/datascience/progress/decorator'; -import { ReportableAction } from '../../../client/datascience/progress/types'; -import { IJupyterCommandFactory } from '../../../client/datascience/types'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { createPromiseFromCancellation, Cancellation } from '../../../platform/common/cancellation'; +import { traceError } from '../../../platform/common/logger'; +import { DataScience, Common } from '../../../platform/common/utils/localize'; +import { noop } from '../../../platform/common/utils/misc'; +import { HelpLinks } from '../../../platform/datascience/constants'; +import { reportAction } from '../../../platform/datascience/progress/decorator'; +import { ReportableAction } from '../../../platform/datascience/progress/types'; +import { IJupyterCommandFactory } from '../../../platform/datascience/types'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; +import { sendTelemetryEvent } from '../../../telemetry'; import { Telemetry, JupyterCommands } from '../../../datascience-ui/common/constants'; -import { JupyterInstallError } from '../../../extension/errors/jupyterInstallError'; +import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError'; import { ProductNames } from '../../installer/productNames'; import { Product, IInstaller, InstallerResponse } from '../../installer/types'; diff --git a/src/kernels/jupyter/interpreter/jupyterInterpreterOldCacheStateStore.ts b/src/kernels/jupyter/interpreter/jupyterInterpreterOldCacheStateStore.ts index 1dd95f57203..2ee5167e2ee 100644 --- a/src/kernels/jupyter/interpreter/jupyterInterpreterOldCacheStateStore.ts +++ b/src/kernels/jupyter/interpreter/jupyterInterpreterOldCacheStateStore.ts @@ -4,8 +4,8 @@ 'use strict'; import { inject, injectable } from 'inversify'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { IPersistentState, IPersistentStateFactory } from '../../../client/common/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { IPersistentState, IPersistentStateFactory } from '../../../platform/common/types'; type CacheInfo = { /** diff --git a/src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts b/src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts index f897268da04..ec85c608d93 100644 --- a/src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts +++ b/src/kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand.ts @@ -4,10 +4,10 @@ 'use strict'; import { inject, injectable } from 'inversify'; -import { IExtensionSingleActivationService } from '../../../client/activation/types'; -import { ICommandManager } from '../../../client/common/application/types'; -import { IDisposableRegistry } from '../../../client/common/types'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +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 '../../../datascience-ui/common/constants'; import { JupyterInterpreterService } from './jupyterInterpreterService'; diff --git a/src/kernels/jupyter/interpreter/jupyterInterpreterSelector.ts b/src/kernels/jupyter/interpreter/jupyterInterpreterSelector.ts index e908ab7e6ca..98447a85361 100644 --- a/src/kernels/jupyter/interpreter/jupyterInterpreterSelector.ts +++ b/src/kernels/jupyter/interpreter/jupyterInterpreterSelector.ts @@ -6,12 +6,12 @@ import { inject, injectable } from 'inversify'; import { QuickPickOptions } from 'vscode'; import { CancellationToken } from 'vscode-jsonrpc'; -import { IApplicationShell, IWorkspaceService } from '../../../client/common/application/types'; -import { Cancellation } from '../../../client/common/cancellation'; -import { IPathUtils } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { IInterpreterSelector } from '../../../client/interpreter/configuration/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IApplicationShell, IWorkspaceService } from '../../../platform/common/application/types'; +import { Cancellation } from '../../../platform/common/cancellation'; +import { IPathUtils } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { IInterpreterSelector } from '../../../platform/interpreter/configuration/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { JupyterInterpreterStateStore } from './jupyterInterpreterStateStore'; /** diff --git a/src/kernels/jupyter/interpreter/jupyterInterpreterService.ts b/src/kernels/jupyter/interpreter/jupyterInterpreterService.ts index 814d6db7711..a35656fb446 100644 --- a/src/kernels/jupyter/interpreter/jupyterInterpreterService.ts +++ b/src/kernels/jupyter/interpreter/jupyterInterpreterService.ts @@ -6,14 +6,14 @@ import { inject, injectable } from 'inversify'; import { Event, EventEmitter } from 'vscode'; import { CancellationToken } from 'vscode-jsonrpc'; -import { createPromiseFromCancellation } from '../../../client/common/cancellation'; -import '../../../client/common/extensions'; -import { noop } from '../../../client/common/utils/misc'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +import { createPromiseFromCancellation } from '../../../platform/common/cancellation'; +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 '../../../datascience-ui/common/constants'; -import { JupyterInstallError } from '../../../extension/errors/jupyterInstallError'; +import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError'; import { JupyterInterpreterDependencyResponse, JupyterInterpreterDependencyService diff --git a/src/kernels/jupyter/interpreter/jupyterInterpreterStateStore.ts b/src/kernels/jupyter/interpreter/jupyterInterpreterStateStore.ts index 84f585fa28d..2dd05a01fb3 100644 --- a/src/kernels/jupyter/interpreter/jupyterInterpreterStateStore.ts +++ b/src/kernels/jupyter/interpreter/jupyterInterpreterStateStore.ts @@ -5,10 +5,10 @@ import { inject, injectable, named } from 'inversify'; import { Memento } from 'vscode'; -import { IExtensionSingleActivationService } from '../../../client/activation/types'; -import { IPythonApiProvider, IPythonExtensionChecker } from '../../../client/api/types'; -import { IMemento, GLOBAL_MEMENTO, IDisposableRegistry } from '../../../client/common/types'; -import { noop } from '../../../client/common/utils/misc'; +import { IExtensionSingleActivationService } from '../../../platform/activation/types'; +import { IPythonApiProvider, IPythonExtensionChecker } from '../../../platform/api/types'; +import { IMemento, GLOBAL_MEMENTO, IDisposableRegistry } from '../../../platform/common/types'; +import { noop } from '../../../platform/common/utils/misc'; const key = 'INTERPRETER_PATH_SELECTED_FOR_JUPYTER_SERVER'; const keySelected = 'INTERPRETER_PATH_WAS_SELECTED_FOR_JUPYTER_SERVER'; diff --git a/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.ts b/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.ts index a2323381f28..60c48bd632a 100644 --- a/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.ts +++ b/src/kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.ts @@ -6,27 +6,27 @@ import { inject, injectable, named } from 'inversify'; import * as path from 'path'; import { CancellationToken } from 'vscode'; -import { traceWarning } from '../../../client/common/logger'; +import { traceWarning } from '../../../platform/common/logger'; import { IPythonExecutionFactory, SpawnOptions, ObservableExecutionResult, IPythonDaemonExecutionService -} from '../../../client/common/process/types'; -import { IOutputChannel, IPathUtils } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { noop } from '../../../client/common/utils/misc'; -import { EXTENSION_ROOT_DIR } from '../../../client/constants'; +} from '../../../platform/common/process/types'; +import { IOutputChannel, IPathUtils } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { noop } from '../../../platform/common/utils/misc'; +import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; import { IJupyterSubCommandExecutionService, IJupyterInterpreterDependencyManager -} from '../../../client/datascience/types'; -import { IEnvironmentActivationService } from '../../../client/interpreter/activation/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +} from '../../../platform/datascience/types'; +import { IEnvironmentActivationService } from '../../../platform/interpreter/activation/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; +import { sendTelemetryEvent } from '../../../telemetry'; import { JUPYTER_OUTPUT_CHANNEL, Telemetry, JupyterDaemonModule } from '../../../datascience-ui/common/constants'; -import { JupyterInstallError } from '../../../extension/errors/jupyterInstallError'; +import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError'; import { Product } from '../../installer/types'; import { JupyterPaths } from '../../raw/finder/jupyterPaths'; import { JupyterServerInfo } from '../launcher/jupyterConnection'; diff --git a/src/kernels/jupyter/interpreter/nbconvertExportToPythonService.ts b/src/kernels/jupyter/interpreter/nbconvertExportToPythonService.ts index 164ceb1c81f..9e7797bae94 100644 --- a/src/kernels/jupyter/interpreter/nbconvertExportToPythonService.ts +++ b/src/kernels/jupyter/interpreter/nbconvertExportToPythonService.ts @@ -5,11 +5,11 @@ import { inject, injectable } from 'inversify'; import { CancellationToken, Uri } from 'vscode'; -import { traceError } from '../../../client/common/logger'; -import { IPythonExecutionFactory, IPythonDaemonExecutionService } from '../../../client/common/process/types'; -import { reportAction } from '../../../client/datascience/progress/decorator'; -import { ReportableAction } from '../../../client/datascience/progress/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { traceError } from '../../../platform/common/logger'; +import { IPythonExecutionFactory, IPythonDaemonExecutionService } from '../../../platform/common/process/types'; +import { reportAction } from '../../../platform/datascience/progress/decorator'; +import { ReportableAction } from '../../../platform/datascience/progress/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { JupyterDaemonModule } from '../../../datascience-ui/common/constants'; @injectable() diff --git a/src/kernels/jupyter/interpreter/nbconvertInterpreterDependencyChecker.ts b/src/kernels/jupyter/interpreter/nbconvertInterpreterDependencyChecker.ts index 0aa12169c75..fc0e8fc59f8 100644 --- a/src/kernels/jupyter/interpreter/nbconvertInterpreterDependencyChecker.ts +++ b/src/kernels/jupyter/interpreter/nbconvertInterpreterDependencyChecker.ts @@ -6,9 +6,9 @@ import { inject, injectable } from 'inversify'; import { SemVer } from 'semver'; import { CancellationToken } from 'vscode'; -import { parseSemVer } from '../../../client/datascience/common'; -import { INbConvertInterpreterDependencyChecker, IJupyterCommandFactory } from '../../../client/datascience/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { parseSemVer } from '../../../platform/datascience/common'; +import { INbConvertInterpreterDependencyChecker, IJupyterCommandFactory } from '../../../platform/datascience/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { JupyterCommands } from '../../../datascience-ui/common/constants'; import { IInstaller, Product } from '../../installer/types'; diff --git a/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.ts b/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.ts index 692b902a4d3..61ff0f794ee 100644 --- a/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.ts +++ b/src/kernels/jupyter/jupyterCellOutputMimeTypeTracker.ts @@ -6,12 +6,12 @@ import { IDisposable } from '@fluentui/react'; import type * as nbformat from '@jupyterlab/nbformat'; import { inject, injectable } from 'inversify'; import { NotebookCell, NotebookCellExecutionStateChangeEvent, NotebookCellKind, NotebookDocument } from 'vscode'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; -import { IVSCodeNotebook } from '../../client/common/application/types'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { IDisposableRegistry } from '../../client/common/types'; -import { captureTelemetry, sendTelemetryEvent } from '../../client/telemetry'; -import { getTelemetrySafeHashedString } from '../../client/telemetry/helpers'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; +import { IVSCodeNotebook } from '../../platform/common/application/types'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { IDisposableRegistry } from '../../platform/common/types'; +import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; +import { getTelemetrySafeHashedString } from '../../telemetry/helpers'; import { Telemetry } from '../../datascience-ui/common/constants'; import { isJupyterNotebook, createJupyterCellFromVSCNotebookCell } from '../../notebooks/helpers'; // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires diff --git a/src/kernels/jupyter/jupyterKernelService.ts b/src/kernels/jupyter/jupyterKernelService.ts index 869c6758a3d..62834c5c579 100644 --- a/src/kernels/jupyter/jupyterKernelService.ts +++ b/src/kernels/jupyter/jupyterKernelService.ts @@ -7,27 +7,27 @@ import type { KernelSpec } from '@jupyterlab/services'; import { inject, injectable } from 'inversify'; import * as path from 'path'; import { CancellationToken } from 'vscode'; -import { Cancellation } from '../../client/common/cancellation'; -import '../../client/common/extensions'; -import { traceInfoIfCI, traceInfo, traceVerbose } from '../../client/common/logger'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; -import { IFileSystem } from '../../client/common/platform/types'; -import { Resource, ReadWrite } from '../../client/common/types'; -import { noop } from '../../client/common/utils/misc'; -import { IEnvironmentVariablesService } from '../../client/common/variables/types'; +import { Cancellation } from '../../platform/common/cancellation'; +import '../../platform/common/extensions'; +import { traceInfoIfCI, traceInfo, traceVerbose } from '../../platform/common/logger'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { Resource, ReadWrite } from '../../platform/common/types'; +import { noop } from '../../platform/common/utils/misc'; +import { IEnvironmentVariablesService } from '../../platform/common/variables/types'; import { IKernelDependencyService, IDisplayOptions, KernelInterpreterDependencyResponse, IJupyterKernelSpec -} from '../../client/datascience/types'; -import { IEnvironmentActivationService } from '../../client/interpreter/activation/types'; -import { traceDecorators } from '../../client/logging'; -import { logValue, ignoreLogging } from '../../client/logging/trace'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { captureTelemetry, sendTelemetryEvent } from '../../client/telemetry'; +} from '../../platform/datascience/types'; +import { IEnvironmentActivationService } from '../../platform/interpreter/activation/types'; +import { traceDecorators } from '../../platform/logging'; +import { logValue, ignoreLogging } from '../../platform/logging/trace'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; import { Telemetry } from '../../datascience-ui/common/constants'; -import { JupyterKernelDependencyError } from '../../extension/errors/jupyterKernelDependencyError'; +import { JupyterKernelDependencyError } from '../../platform/errors/jupyterKernelDependencyError'; import { getKernelRegistrationInfo, cleanEnvironment } from '../helpers'; import { JupyterPaths } from '../raw/finder/jupyterPaths'; import { KernelConnectionMetadata, LocalKernelConnectionMetadata } from '../types'; diff --git a/src/kernels/jupyter/jupyterKernelSpec.ts b/src/kernels/jupyter/jupyterKernelSpec.ts index 8816bc539d9..ddeeaf21526 100644 --- a/src/kernels/jupyter/jupyterKernelSpec.ts +++ b/src/kernels/jupyter/jupyterKernelSpec.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. 'use strict'; import type { KernelSpec } from '@jupyterlab/services'; -import { IJupyterKernelSpec } from '../../client/datascience/types'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +import { IJupyterKernelSpec } from '../../platform/datascience/types'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; export class JupyterKernelSpec implements IJupyterKernelSpec { public name: string; diff --git a/src/kernels/jupyter/jupyterUriProviderRegistration.ts b/src/kernels/jupyter/jupyterUriProviderRegistration.ts index 7ffa043f86f..e1d40160290 100644 --- a/src/kernels/jupyter/jupyterUriProviderRegistration.ts +++ b/src/kernels/jupyter/jupyterUriProviderRegistration.ts @@ -2,14 +2,14 @@ // Licensed under the MIT License. import { inject, injectable } from 'inversify'; -import { IExtensions } from '../../client/common/types'; -import * as localize from '../../client/common/utils/localize'; +import { IExtensions } from '../../platform/common/types'; +import * as localize from '../../platform/common/utils/localize'; import { IJupyterServerUri, IJupyterUriProvider, IJupyterUriProviderRegistration, JupyterServerUriHandle -} from '../../client/datascience/types'; +} from '../../platform/datascience/types'; import { JupyterUriProviderWrapper } from './jupyterUriProviderWrapper'; @injectable() diff --git a/src/kernels/jupyter/jupyterUriProviderWrapper.ts b/src/kernels/jupyter/jupyterUriProviderWrapper.ts index 4f7d90db7fa..a69b5c17f45 100644 --- a/src/kernels/jupyter/jupyterUriProviderWrapper.ts +++ b/src/kernels/jupyter/jupyterUriProviderWrapper.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import * as vscode from 'vscode'; -import * as localize from '../../client/common/utils/localize'; -import { IJupyterServerUri, IJupyterUriProvider, JupyterServerUriHandle } from '../../client/datascience/types'; +import * as localize from '../../platform/common/utils/localize'; +import { IJupyterServerUri, IJupyterUriProvider, JupyterServerUriHandle } from '../../platform/datascience/types'; /** * This class wraps an IJupyterUriProvider provided by another extension. It allows us to show diff --git a/src/kernels/jupyter/jupyterUtils.ts b/src/kernels/jupyter/jupyterUtils.ts index 0413edccd9b..9a887deccdc 100644 --- a/src/kernels/jupyter/jupyterUtils.ts +++ b/src/kernels/jupyter/jupyterUtils.ts @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../../client/common/extensions'; +import '../../platform/common/extensions'; import * as fs from 'fs-extra'; import * as path from 'path'; import { Uri } from 'vscode'; -import { IWorkspaceService } from '../../client/common/application/types'; -import { Resource } from '../../client/common/types'; -import { SystemVariables } from '../../client/common/variables/systemVariables'; -import { IJupyterServerUri, IJupyterConnection } from '../../client/datascience/types'; +import { IWorkspaceService } from '../../platform/common/application/types'; +import { Resource } from '../../platform/common/types'; +import { SystemVariables } from '../../platform/common/variables/systemVariables'; +import { IJupyterServerUri, IJupyterConnection } from '../../platform/datascience/types'; import { getJupyterConnectionDisplayName } from './launcher/jupyterConnection'; -import { noop } from '../../client/common/utils/misc'; +import { noop } from '../../platform/common/utils/misc'; export function expandWorkingDir( workingDir: string | undefined, diff --git a/src/kernels/jupyter/launcher/commandLineSelector.ts b/src/kernels/jupyter/launcher/commandLineSelector.ts index cbd36fcb35f..998493070da 100644 --- a/src/kernels/jupyter/launcher/commandLineSelector.ts +++ b/src/kernels/jupyter/launcher/commandLineSelector.ts @@ -7,16 +7,16 @@ import { inject, injectable } from 'inversify'; // eslint-disable-next-line import parseArgsStringToArgv from 'string-argv'; import { ConfigurationChangeEvent, ConfigurationTarget, QuickPickItem, Uri } from 'vscode'; -import { IWorkspaceService, IApplicationShell, ICommandManager } from '../../../client/common/application/types'; -import { IConfigurationService } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; +import { IWorkspaceService, IApplicationShell, ICommandManager } from '../../../platform/common/application/types'; +import { IConfigurationService } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; import { IMultiStepInputFactory, IMultiStepInput, InputStep, IQuickPickParameters -} from '../../../client/common/utils/multiStepInput'; -import { captureTelemetry, sendTelemetryEvent } from '../../../client/telemetry'; +} from '../../../platform/common/utils/multiStepInput'; +import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; @injectable() diff --git a/src/kernels/jupyter/launcher/jupyterConnection.ts b/src/kernels/jupyter/launcher/jupyterConnection.ts index b070375eaf7..ab85f1a70c6 100644 --- a/src/kernels/jupyter/launcher/jupyterConnection.ts +++ b/src/kernels/jupyter/launcher/jupyterConnection.ts @@ -1,22 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../../../client/common/extensions'; +import '../../../platform/common/extensions'; import { ChildProcess } from 'child_process'; import { Subscription } from 'rxjs'; import { CancellationError, CancellationToken, Disposable, Event, EventEmitter } from 'vscode'; -import { IConfigurationService, IDisposable } from '../../../client/common/types'; -import { Cancellation } from '../../../client/common/cancellation'; -import { traceInfo, traceError, traceWarning } from '../../../client/common/logger'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { ObservableExecutionResult, Output } from '../../../client/common/process/types'; -import { Deferred, createDeferred } from '../../../client/common/utils/async'; -import { DataScience } from '../../../client/common/utils/localize'; -import { IJupyterConnection } from '../../../client/datascience/types'; -import { IServiceContainer } from '../../../client/ioc/types'; +import { IConfigurationService, IDisposable } from '../../../platform/common/types'; +import { Cancellation } from '../../../platform/common/cancellation'; +import { traceInfo, traceError, traceWarning } from '../../../platform/common/logger'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { ObservableExecutionResult, Output } from '../../../platform/common/process/types'; +import { Deferred, createDeferred } from '../../../platform/common/utils/async'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { IJupyterConnection } from '../../../platform/datascience/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; import { RegExpValues } from '../../../datascience-ui/common/constants'; -import { JupyterConnectError } from '../../../extension/errors/jupyterConnectError'; +import { JupyterConnectError } from '../../../platform/errors/jupyterConnectError'; // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, @typescript-eslint/no-explicit-any const namedRegexp = require('named-js-regexp'); diff --git a/src/kernels/jupyter/launcher/jupyterExecution.ts b/src/kernels/jupyter/launcher/jupyterExecution.ts index f40f4c0b618..aa610b879a7 100644 --- a/src/kernels/jupyter/launcher/jupyterExecution.ts +++ b/src/kernels/jupyter/launcher/jupyterExecution.ts @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { injectable } from 'inversify'; import * as path from 'path'; import * as uuid from 'uuid/v4'; import { CancellationToken } from 'vscode'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { Cancellation } from '../../../client/common/cancellation'; -import { WrappedError } from '../../../client/../extension/errors/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposableRegistry, IConfigurationService, Resource } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { JupyterSelfCertsError } from '../../../extension/errors/jupyterSelfCertsError'; -import { JupyterWaitForIdleError } from '../../../extension/errors/jupyterWaitForIdleError'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { Cancellation } from '../../../platform/common/cancellation'; +import { WrappedError } from '../../../platform/errors/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposableRegistry, IConfigurationService, Resource } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { JupyterSelfCertsError } from '../../../platform/errors/jupyterSelfCertsError'; +import { JupyterWaitForIdleError } from '../../../platform/errors/jupyterWaitForIdleError'; import { IJupyterExecution, IJupyterSubCommandExecutionService, @@ -22,11 +21,11 @@ import { INotebookServer, IJupyterConnection, JupyterServerUriHandle -} from '../../../client/datascience/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; -import { sendTelemetryEvent, captureTelemetry } from '../../../client/telemetry'; +} from '../../../platform/datascience/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; +import { sendTelemetryEvent, captureTelemetry } from '../../../telemetry'; import { Telemetry, Identifiers } from '../../../datascience-ui/common/constants'; import { expandWorkingDir, createRemoteConnectionInfo } from '../jupyterUtils'; @@ -34,7 +33,6 @@ import { NotebookStarter } from './notebookStarter'; const LocalHosts = ['localhost', '127.0.0.1', '::1']; -@injectable() export class JupyterExecutionBase implements IJupyterExecution { private usablePythonInterpreter: PythonEnvironment | undefined; private disposed: boolean = false; diff --git a/src/kernels/jupyter/launcher/jupyterNotebook.ts b/src/kernels/jupyter/launcher/jupyterNotebook.ts index 2f9f246eacc..aaf9dd8a102 100644 --- a/src/kernels/jupyter/launcher/jupyterNotebook.ts +++ b/src/kernels/jupyter/launcher/jupyterNotebook.ts @@ -3,7 +3,7 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports import cloneDeep = require('lodash/cloneDeep'); -import { INotebook, INotebookProviderConnection, IJupyterSession } from '../../../client/datascience/types'; +import { INotebook, INotebookProviderConnection, IJupyterSession } from '../../../platform/datascience/types'; // This code is based on the examples here: // https://www.npmjs.com/package/@jupyterlab/services diff --git a/src/kernels/jupyter/launcher/jupyterNotebookProvider.ts b/src/kernels/jupyter/launcher/jupyterNotebookProvider.ts index b2735f708b7..30a9cb68355 100644 --- a/src/kernels/jupyter/launcher/jupyterNotebookProvider.ts +++ b/src/kernels/jupyter/launcher/jupyterNotebookProvider.ts @@ -4,7 +4,7 @@ 'use strict'; import { inject, injectable } from 'inversify'; -import { SessionDisposedError } from '../../../extension/errors/sessionDisposedError'; +import { SessionDisposedError } from '../../../platform/errors/sessionDisposedError'; import { IJupyterNotebookProvider, IJupyterServerProvider, @@ -13,9 +13,9 @@ import { IJupyterConnection, NotebookCreationOptions, INotebook -} from '../../../client/datascience/types'; +} from '../../../platform/datascience/types'; import { isLocalConnection } from '../../types'; -import { Cancellation } from '../../../client/common/cancellation'; +import { Cancellation } from '../../../platform/common/cancellation'; // When the NotebookProvider looks to create a notebook it uses this class to create a Jupyter notebook @injectable() diff --git a/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts b/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts index 65f11d51a02..bf4048d538a 100644 --- a/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts +++ b/src/kernels/jupyter/launcher/jupyterPasswordConnect.ts @@ -6,12 +6,12 @@ import { inject, injectable } from 'inversify'; import * as nodeFetch from 'node-fetch'; import { URLSearchParams } from 'url'; import { ConfigurationTarget } from 'vscode'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { IAsyncDisposableRegistry, IConfigurationService } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { IMultiStepInputFactory, IMultiStepInput } from '../../../client/common/utils/multiStepInput'; -import { IJupyterPasswordConnect, IJupyterPasswordConnectInfo } from '../../../client/datascience/types'; -import { captureTelemetry, sendTelemetryEvent } from '../../../client/telemetry'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { IAsyncDisposableRegistry, IConfigurationService } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { IMultiStepInputFactory, IMultiStepInput } from '../../../platform/common/utils/multiStepInput'; +import { IJupyterPasswordConnect, IJupyterPasswordConnectInfo } from '../../../platform/datascience/types'; +import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; @injectable() diff --git a/src/kernels/jupyter/launcher/liveshare/hostJupyterExecution.ts b/src/kernels/jupyter/launcher/liveshare/hostJupyterExecution.ts index bb88edc6f2d..be91717b322 100644 --- a/src/kernels/jupyter/launcher/liveshare/hostJupyterExecution.ts +++ b/src/kernels/jupyter/launcher/liveshare/hostJupyterExecution.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../../../../client/common/extensions'; +import '../../../../platform/common/extensions'; import * as uuid from 'uuid/v4'; import { CancellationToken } from 'vscode'; @@ -10,14 +10,18 @@ import { JupyterExecutionBase } from '../jupyterExecution'; import { NotebookStarter } from '../notebookStarter'; import { ServerCache } from './serverCache'; import { inject, injectable } from 'inversify'; -import { IWorkspaceService } from '../../../../client/common/application/types'; -import { traceInfo } from '../../../../client/common/logger'; -import { IFileSystem } from '../../../../client/common/platform/types'; -import { IDisposableRegistry, IAsyncDisposableRegistry, IConfigurationService } from '../../../../client/common/types'; -import { testOnlyMethod } from '../../../../client/common/utils/decorators'; -import { IJupyterExecution, INotebookServerOptions, INotebookServer } from '../../../../client/datascience/types'; -import { IInterpreterService } from '../../../../client/interpreter/contracts'; -import { IServiceContainer } from '../../../../client/ioc/types'; +import { IWorkspaceService } from '../../../../platform/common/application/types'; +import { traceInfo } from '../../../../platform/common/logger'; +import { IFileSystem } from '../../../../platform/common/platform/types'; +import { + IDisposableRegistry, + IAsyncDisposableRegistry, + IConfigurationService +} from '../../../../platform/common/types'; +import { testOnlyMethod } from '../../../../platform/common/utils/decorators'; +import { IJupyterExecution, INotebookServerOptions, INotebookServer } from '../../../../platform/datascience/types'; +import { IInterpreterService } from '../../../../platform/interpreter/contracts'; +import { IServiceContainer } from '../../../../platform/ioc/types'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts b/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts index ae168d53cdf..e84abd41335 100644 --- a/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts +++ b/src/kernels/jupyter/launcher/liveshare/hostJupyterServer.ts @@ -1,40 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../../../../client/common/extensions'; +import '../../../../platform/common/extensions'; import { CancellationToken } from 'vscode-jsonrpc'; import { injectable, inject, named } from 'inversify'; -import { IWorkspaceService } from '../../../../client/common/application/types'; -import { STANDARD_OUTPUT_CHANNEL } from '../../../../client/common/constants'; -import { traceInfo, traceError, traceInfoIfCI } from '../../../../client/common/logger'; +import { IWorkspaceService } from '../../../../platform/common/application/types'; +import { STANDARD_OUTPUT_CHANNEL } from '../../../../platform/common/constants'; +import { traceInfo, traceError, traceInfoIfCI } from '../../../../platform/common/logger'; import { IAsyncDisposableRegistry, IOutputChannel, IDisposableRegistry, Resource, IDisposable -} from '../../../../client/common/types'; -import { Deferred, createDeferred, sleep } from '../../../../client/common/utils/async'; -import { DataScience } from '../../../../client/common/utils/localize'; -import { StopWatch } from '../../../../client/common/utils/stopWatch'; -import { SessionDisposedError } from '../../../../extension/errors/sessionDisposedError'; -import { sendKernelTelemetryEvent } from '../../../../client/datascience/telemetry/telemetry'; +} from '../../../../platform/common/types'; +import { Deferred, createDeferred, sleep } from '../../../../platform/common/utils/async'; +import { DataScience } from '../../../../platform/common/utils/localize'; +import { StopWatch } from '../../../../platform/common/utils/stopWatch'; +import { SessionDisposedError } from '../../../../platform/errors/sessionDisposedError'; +import { sendKernelTelemetryEvent } from '../../../../telemetry/telemetry'; import { INotebookServer, IJupyterConnection, INotebook, IJupyterSessionManagerFactory, IDisplayOptions -} from '../../../../client/datascience/types'; +} from '../../../../platform/datascience/types'; import { Telemetry } from '../../../../datascience-ui/common/constants'; import { KernelConnectionMetadata, isLocalConnection } from '../../../types'; import { computeWorkingDirectory } from '../../jupyterUtils'; import { JupyterSessionManager } from '../../session/jupyterSessionManager'; import { JupyterNotebook } from '../jupyterNotebook'; -import { noop } from '../../../../client/common/utils/misc'; -import { getDisplayPath } from '../../../../client/common/platform/fs-paths'; -import { Cancellation } from '../../../../client/common/cancellation'; +import { noop } from '../../../../platform/common/utils/misc'; +import { Cancellation } from '../../../../platform/common/cancellation'; +import { getDisplayPath } from '../../../../platform/common/platform/fs-paths'; /* eslint-disable @typescript-eslint/no-explicit-any */ @injectable() diff --git a/src/kernels/jupyter/launcher/liveshare/serverCache.ts b/src/kernels/jupyter/launcher/liveshare/serverCache.ts index a75fcb9170b..d08c31fdb10 100644 --- a/src/kernels/jupyter/launcher/liveshare/serverCache.ts +++ b/src/kernels/jupyter/launcher/liveshare/serverCache.ts @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../../../../client/common/extensions'; +import '../../../../platform/common/extensions'; import { CancellationToken } from 'vscode'; -import { IWorkspaceService } from '../../../../client/common/application/types'; -import { traceInfo, traceError } from '../../../../client/common/logger'; -import { IFileSystem } from '../../../../client/common/platform/types'; -import { IAsyncDisposable, IConfigurationService } from '../../../../client/common/types'; -import { testOnlyMethod } from '../../../../client/common/utils/decorators'; -import { INotebookServerOptions, INotebookServer } from '../../../../client/datascience/types'; -import { calculateWorkingDirectory } from '../../../../client/datascience/utils'; -import { sleep } from '../../../../client/common/utils/async'; +import { IWorkspaceService } from '../../../../platform/common/application/types'; +import { traceInfo, traceError } from '../../../../platform/common/logger'; +import { IFileSystem } from '../../../../platform/common/platform/types'; +import { IAsyncDisposable, IConfigurationService } from '../../../../platform/common/types'; +import { testOnlyMethod } from '../../../../platform/common/utils/decorators'; +import { INotebookServerOptions, INotebookServer } from '../../../../platform/datascience/types'; +import { calculateWorkingDirectory } from '../../../../platform/datascience/utils'; +import { sleep } from '../../../../platform/common/utils/async'; interface IServerData { options: INotebookServerOptions; diff --git a/src/kernels/jupyter/launcher/notebookProvider.ts b/src/kernels/jupyter/launcher/notebookProvider.ts index 089b93471db..1af4460abd0 100644 --- a/src/kernels/jupyter/launcher/notebookProvider.ts +++ b/src/kernels/jupyter/launcher/notebookProvider.ts @@ -4,15 +4,11 @@ 'use strict'; import { inject, injectable } from 'inversify'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { Cancellation } from '../../../client/common/cancellation'; -import { IConfigurationService } from '../../../client/common/types'; -import { Settings } from '../../../client/datascience/constants'; -import { DisplayOptions } from '../../../client/datascience/displayOptions'; -import { - trackKernelResourceInformation, - sendKernelTelemetryWhenDone -} from '../../../client/datascience/telemetry/telemetry'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { IConfigurationService } from '../../../platform/common/types'; +import { Settings } from '../../../platform/datascience/constants'; +import { DisplayOptions } from '../../../platform/datascience/displayOptions'; +import { trackKernelResourceInformation, sendKernelTelemetryWhenDone } from '../../../telemetry/telemetry'; import { INotebookProvider, IRawNotebookProvider, @@ -21,9 +17,10 @@ import { INotebookProviderConnection, NotebookCreationOptions, INotebook -} from '../../../client/datascience/types'; +} from '../../../platform/datascience/types'; import { Telemetry } from '../../../datascience-ui/common/constants'; import { isLocalConnection } from '../../../kernels/types'; +import { Cancellation } from '../../../platform/common/cancellation'; @injectable() export class NotebookProvider implements INotebookProvider { diff --git a/src/kernels/jupyter/launcher/notebookServerProvider.ts b/src/kernels/jupyter/launcher/notebookServerProvider.ts index 8df87637849..ede53ae40fa 100644 --- a/src/kernels/jupyter/launcher/notebookServerProvider.ts +++ b/src/kernels/jupyter/launcher/notebookServerProvider.ts @@ -6,15 +6,15 @@ import { IDisposable } from '@fluentui/react'; import { inject, injectable } from 'inversify'; import { CancellationError, CancellationToken } from 'vscode'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { traceInfo } from '../../../client/common/logger'; -import { IConfigurationService, IDisposableRegistry, Resource } from '../../../client/common/types'; -import { testOnlyMethod } from '../../../client/common/utils/decorators'; -import { DataScience } from '../../../client/common/utils/localize'; -import { Settings } from '../../../client/datascience/constants'; -import { DisplayOptions } from '../../../client/datascience/displayOptions'; -import { JupyterInstallError } from '../../../extension/errors/jupyterInstallError'; -import { KernelProgressReporter } from '../../../client/datascience/progress/kernelProgressReporter'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { traceInfo } from '../../../platform/common/logger'; +import { IConfigurationService, IDisposableRegistry, Resource } from '../../../platform/common/types'; +import { testOnlyMethod } from '../../../platform/common/utils/decorators'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { Settings } from '../../../platform/datascience/constants'; +import { DisplayOptions } from '../../../platform/datascience/displayOptions'; +import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError'; +import { KernelProgressReporter } from '../../../platform/datascience/progress/kernelProgressReporter'; import { IJupyterServerProvider, INotebookServer, @@ -22,8 +22,8 @@ import { IJupyterServerUriStorage, GetServerOptions, INotebookServerOptions -} from '../../../client/datascience/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; +} from '../../../platform/datascience/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; import { JupyterServerSelector } from '../../../kernels/jupyter/serverSelector'; @injectable() diff --git a/src/kernels/jupyter/launcher/notebookStarter.ts b/src/kernels/jupyter/launcher/notebookStarter.ts index 93560d19c57..f3c3c32f7c1 100644 --- a/src/kernels/jupyter/launcher/notebookStarter.ts +++ b/src/kernels/jupyter/launcher/notebookStarter.ts @@ -11,23 +11,23 @@ import * as path from 'path'; import * as uuid from 'uuid/v4'; import { CancellationError, CancellationToken, Disposable } from 'vscode'; import { IDisposable } from '@fluentui/react'; -import { Cancellation, createPromiseFromCancellation } from '../../../client/common/cancellation'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { traceInfo, traceError } from '../../../client/common/logger'; -import { IFileSystem, TemporaryDirectory } from '../../../client/common/platform/types'; -import { IOutputChannel, Resource } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { StopWatch } from '../../../client/common/utils/stopWatch'; -import { JupyterConnectError } from '../../../extension/errors/jupyterConnectError'; -import { JupyterInstallError } from '../../../extension/errors/jupyterInstallError'; -import { KernelProgressReporter } from '../../../client/datascience/progress/kernelProgressReporter'; -import { ReportableAction } from '../../../client/datascience/progress/types'; -import { IJupyterSubCommandExecutionService, IJupyterConnection } from '../../../client/datascience/types'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +import { Cancellation, createPromiseFromCancellation } from '../../../platform/common/cancellation'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { traceInfo, traceError } from '../../../platform/common/logger'; +import { IFileSystem, TemporaryDirectory } from '../../../platform/common/platform/types'; +import { IOutputChannel, Resource } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { StopWatch } from '../../../platform/common/utils/stopWatch'; +import { JupyterConnectError } from '../../../platform/errors/jupyterConnectError'; +import { JupyterInstallError } from '../../../platform/errors/jupyterInstallError'; +import { KernelProgressReporter } from '../../../platform/datascience/progress/kernelProgressReporter'; +import { ReportableAction } from '../../../platform/datascience/progress/types'; +import { IJupyterSubCommandExecutionService, IJupyterConnection } from '../../../platform/datascience/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { sendTelemetryEvent } from '../../../telemetry'; import { JUPYTER_OUTPUT_CHANNEL, Telemetry } from '../../../datascience-ui/common/constants'; import { JupyterConnectionWaiter } from './jupyterConnection'; -import { WrappedError } from '../../../client/../extension/errors/types'; +import { WrappedError } from '../../../platform/errors/types'; /** * Responsible for starting a notebook. diff --git a/src/kernels/jupyter/launcher/serverPreload.ts b/src/kernels/jupyter/launcher/serverPreload.ts index 1f9417aa088..d50c25a8382 100644 --- a/src/kernels/jupyter/launcher/serverPreload.ts +++ b/src/kernels/jupyter/launcher/serverPreload.ts @@ -3,19 +3,24 @@ 'use strict'; import { inject, injectable, named } from 'inversify'; import { CancellationTokenSource, Memento, NotebookDocument } from 'vscode'; -import { IExtensionSingleActivationService } from '../../../client/activation/types'; -import { IVSCodeNotebook, IWorkspaceService } from '../../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { traceInfo, traceError } from '../../../client/common/logger'; -import { IConfigurationService, IDisposableRegistry, IMemento, WORKSPACE_MEMENTO } from '../../../client/common/types'; -import { DisplayOptions } from '../../../client/datascience/displayOptions'; +import { IExtensionSingleActivationService } from '../../../platform/activation/types'; +import { IVSCodeNotebook, IWorkspaceService } from '../../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { traceInfo, traceError } from '../../../platform/common/logger'; +import { + IConfigurationService, + IDisposableRegistry, + IMemento, + WORKSPACE_MEMENTO +} from '../../../platform/common/types'; +import { DisplayOptions } from '../../../platform/datascience/displayOptions'; import { isJupyterNotebook } from '../../../notebooks/helpers'; import { IInteractiveWindowProvider, INotebookProvider, IRawNotebookProvider, IInteractiveWindow -} from '../../../client/datascience/types'; +} from '../../../platform/datascience/types'; import { getKernelConnectionLanguage } from '../../helpers'; import { IKernel, IKernelProvider } from '../../types'; diff --git a/src/kernels/jupyter/launcher/serverUriStorage.ts b/src/kernels/jupyter/launcher/serverUriStorage.ts index db635de7405..487dd2dad76 100644 --- a/src/kernels/jupyter/launcher/serverUriStorage.ts +++ b/src/kernels/jupyter/launcher/serverUriStorage.ts @@ -6,10 +6,10 @@ import { IWorkspaceService, IEncryptedStorage, IApplicationEnvironment -} from '../../../client/common/application/types'; -import { IConfigurationService, ICryptoUtils, IMemento, GLOBAL_MEMENTO } from '../../../client/common/types'; -import { Settings } from '../../../client/datascience/constants'; -import { IJupyterServerUriStorage } from '../../../client/datascience/types'; +} from '../../../platform/common/application/types'; +import { IConfigurationService, ICryptoUtils, IMemento, GLOBAL_MEMENTO } from '../../../platform/common/types'; +import { Settings } from '../../../platform/datascience/constants'; +import { IJupyterServerUriStorage } from '../../../platform/datascience/types'; /** * Class for storing Jupyter Server URI values diff --git a/src/kernels/jupyter/serverSelector.ts b/src/kernels/jupyter/serverSelector.ts index fa1309ebedb..92a03b89288 100644 --- a/src/kernels/jupyter/serverSelector.ts +++ b/src/kernels/jupyter/serverSelector.ts @@ -6,25 +6,25 @@ import { inject, injectable } from 'inversify'; import { isNil } from 'lodash'; import { EventEmitter, QuickPickItem, ThemeIcon, Uri } from 'vscode'; -import { IClipboard } from '../../client/common/application/types'; -import { traceError } from '../../client/common/logger'; -import { DataScience } from '../../client/common/utils/localize'; +import { IClipboard } from '../../platform/common/application/types'; +import { traceError } from '../../platform/common/logger'; +import { DataScience } from '../../platform/common/utils/localize'; import { IMultiStepInputFactory, IMultiStepInput, InputStep, IQuickPickParameters, InputFlowAction -} from '../../client/common/utils/multiStepInput'; -import { Settings } from '../../client/datascience/constants'; +} from '../../platform/common/utils/multiStepInput'; +import { Settings } from '../../platform/datascience/constants'; import { IJupyterUriProvider, IJupyterUriProviderRegistration, IJupyterServerUriStorage, JupyterServerUriHandle -} from '../../client/datascience/types'; -import { traceDecorators } from '../../client/logging'; -import { captureTelemetry, sendTelemetryEvent } from '../../client/telemetry'; +} from '../../platform/datascience/types'; +import { traceDecorators } from '../../platform/logging'; +import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; import { Telemetry, Identifiers } from '../../datascience-ui/common/constants'; const defaultUri = 'https://hostname:8080/?token=849d61a414abafab97bc4aab1f3547755ddc232c2b8cb7fe'; diff --git a/src/kernels/jupyter/session/jupyterSession.ts b/src/kernels/jupyter/session/jupyterSession.ts index 8c660a7e75a..31788173c17 100644 --- a/src/kernels/jupyter/session/jupyterSession.ts +++ b/src/kernels/jupyter/session/jupyterSession.ts @@ -12,24 +12,24 @@ import type { import * as path from 'path'; import * as uuid from 'uuid/v4'; import { CancellationToken, CancellationTokenSource } from 'vscode-jsonrpc'; -import { Cancellation } from '../../../client/common/cancellation'; -import { BaseError } from '../../../client/../extension/errors/types'; -import { traceVerbose, traceError, traceInfo, traceInfoIfCI } from '../../../client/common/logger'; -import { Resource, IOutputChannel } from '../../../client/common/types'; -import { waitForCondition } from '../../../client/common/utils/async'; -import { DataScience } from '../../../client/common/utils/localize'; -import { DisplayOptions } from '../../../client/datascience/displayOptions'; -import { JupyterInvalidKernelError } from '../../../extension/errors/jupyterInvalidKernelError'; -import { SessionDisposedError } from '../../../extension/errors/sessionDisposedError'; -import { IJupyterConnection, IDisplayOptions, ISessionWithSocket } from '../../../client/datascience/types'; -import { captureTelemetry } from '../../../client/telemetry'; +import { Cancellation } from '../../../platform/common/cancellation'; +import { BaseError } from '../../../platform/errors/types'; +import { traceVerbose, traceError, traceInfo, traceInfoIfCI } from '../../../platform/common/logger'; +import { Resource, IOutputChannel } from '../../../platform/common/types'; +import { waitForCondition } from '../../../platform/common/utils/async'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { DisplayOptions } from '../../../platform/datascience/displayOptions'; +import { JupyterInvalidKernelError } from '../../../platform/errors/jupyterInvalidKernelError'; +import { SessionDisposedError } from '../../../platform/errors/sessionDisposedError'; +import { IJupyterConnection, IDisplayOptions, ISessionWithSocket } from '../../../platform/datascience/types'; +import { captureTelemetry } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; import { BaseJupyterSession, JupyterSessionStartError } from '../../common/baseJupyterSession'; import { getNameOfKernelConnection } from '../../helpers'; import { KernelConnectionMetadata, isLocalConnection } from '../../types'; import { JupyterKernelService } from '../jupyterKernelService'; import { JupyterWebSockets } from './jupyterWebSocket'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; const jvscIdentifier = '-jvsc-'; function getRemoteIPynbSuffix(): string { diff --git a/src/kernels/jupyter/session/jupyterSessionManager.ts b/src/kernels/jupyter/session/jupyterSessionManager.ts index 4e2313344af..931f5bab710 100644 --- a/src/kernels/jupyter/session/jupyterSessionManager.ts +++ b/src/kernels/jupyter/session/jupyterSessionManager.ts @@ -14,17 +14,17 @@ import { JSONObject } from '@lumino/coreutils'; import { Agent as HttpsAgent } from 'https'; import * as nodeFetch from 'node-fetch'; import { CancellationToken, EventEmitter } from 'vscode'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { traceInfo, traceError } from '../../../client/common/logger'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { traceInfo, traceError } from '../../../platform/common/logger'; import { IPersistentState, IConfigurationService, IOutputChannel, IPersistentStateFactory, Resource -} from '../../../client/common/types'; -import { Common, DataScience } from '../../../client/common/utils/localize'; -import { SessionDisposedError } from '../../../extension/errors/sessionDisposedError'; +} from '../../../platform/common/types'; +import { Common, DataScience } from '../../../platform/common/utils/localize'; +import { SessionDisposedError } from '../../../platform/errors/sessionDisposedError'; import { IJupyterSessionManager, IJupyterConnection, @@ -32,8 +32,7 @@ import { IDisplayOptions, IJupyterKernel, IJupyterKernelSpec -} from '../../../client/datascience/types'; -import { sleep } from '../../../test/core'; +} from '../../../platform/datascience/types'; import { createInterpreterKernelSpec } from '../../helpers'; import { KernelConnectionMetadata } from '../../types'; import { JupyterKernelService } from '../jupyterKernelService'; @@ -41,6 +40,7 @@ import { JupyterKernelSpec } from '../jupyterKernelSpec'; import { createAuthorizingRequest } from './jupyterRequest'; import { JupyterSession } from './jupyterSession'; import { createJupyterWebSocket } from './jupyterWebSocket'; +import { sleep } from '../../../platform/common/utils/async'; // Key for our insecure connection global state const GlobalStateUserAllowsInsecureConnections = 'DataScienceAllowInsecureConnections'; diff --git a/src/kernels/jupyter/session/jupyterSessionManagerFactory.ts b/src/kernels/jupyter/session/jupyterSessionManagerFactory.ts index 6880363f2f0..85c94afd64b 100644 --- a/src/kernels/jupyter/session/jupyterSessionManagerFactory.ts +++ b/src/kernels/jupyter/session/jupyterSessionManagerFactory.ts @@ -5,19 +5,19 @@ import { inject, injectable, named } from 'inversify'; import type { Kernel } from '@jupyterlab/services'; import { EventEmitter } from 'vscode'; import { JupyterSessionManager } from './jupyterSessionManager'; -import { IApplicationShell } from '../../../client/common/application/types'; +import { IApplicationShell } from '../../../platform/common/application/types'; import { IConfigurationService, IOutputChannel, IPersistentStateFactory, IDisposableRegistry -} from '../../../client/common/types'; +} from '../../../platform/common/types'; import { IJupyterSessionManagerFactory, IJupyterPasswordConnect, IJupyterConnection, IJupyterSessionManager -} from '../../../client/datascience/types'; +} from '../../../platform/datascience/types'; import { JUPYTER_OUTPUT_CHANNEL } from '../../../datascience-ui/common/constants'; import { JupyterKernelService } from '../jupyterKernelService'; diff --git a/src/kernels/jupyter/session/jupyterWebSocket.ts b/src/kernels/jupyter/session/jupyterWebSocket.ts index 3d9b154098e..fa345f92f4d 100644 --- a/src/kernels/jupyter/session/jupyterWebSocket.ts +++ b/src/kernels/jupyter/session/jupyterWebSocket.ts @@ -2,9 +2,9 @@ // Licensed under the MIT License. 'use strict'; import * as WebSocketWS from 'ws'; -import { traceError } from '../../../client/common/logger'; -import { noop } from '../../../client/common/utils/misc'; -import { IKernelSocket } from '../../../client/datascience/types'; +import { traceError } from '../../../platform/common/logger'; +import { noop } from '../../../platform/common/utils/misc'; +import { IKernelSocket } from '../../../platform/datascience/types'; import { KernelSocketWrapper } from '../../common/kernelSocketWrapper'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/kernels/kernel.ts b/src/kernels/kernel.ts index 3a2da1d158a..de931d57874 100644 --- a/src/kernels/kernel.ts +++ b/src/kernels/kernel.ts @@ -17,29 +17,29 @@ import { ColorThemeKind, Disposable } from 'vscode'; -import { IApplicationShell, IWorkspaceService } from '../client/common/application/types'; -import { WrappedError } from '../client/../extension/errors/types'; -import { disposeAllDisposables } from '../client/common/helpers'; -import { traceInfo, traceInfoIfCI, traceError, traceVerbose, traceWarning } from '../client/common/logger'; -import { getDisplayPath } from '../client/common/platform/fs-paths'; -import { IFileSystem } from '../client/common/platform/types'; -import { IPythonExecutionFactory } from '../client/common/process/types'; -import { Resource, IDisposableRegistry, IConfigurationService, IDisposable } from '../client/common/types'; -import { Deferred } from '../client/common/utils/async'; -import { DataScience } from '../client/common/utils/localize'; -import { noop } from '../client/common/utils/misc'; -import { StopWatch } from '../client/common/utils/stopWatch'; -import { AddRunCellHook } from '../client/datascience/constants'; -import { DisplayOptions } from '../client/datascience/displayOptions'; +import { IApplicationShell, IWorkspaceService } from '../platform/common/application/types'; +import { WrappedError } from '../platform/errors/types'; +import { disposeAllDisposables } from '../platform/common/helpers'; +import { traceInfo, traceInfoIfCI, traceError, traceVerbose, traceWarning } from '../platform/common/logger'; +import { getDisplayPath } from '../platform/common/platform/fs-paths'; +import { IFileSystem } from '../platform/common/platform/types'; +import { IPythonExecutionFactory } from '../platform/common/process/types'; +import { Resource, IDisposableRegistry, IConfigurationService, IDisposable } from '../platform/common/types'; +import { Deferred, sleep } from '../platform/common/utils/async'; +import { DataScience } from '../platform/common/utils/localize'; +import { noop } from '../platform/common/utils/misc'; +import { StopWatch } from '../platform/common/utils/stopWatch'; +import { AddRunCellHook } from '../platform/datascience/constants'; +import { DisplayOptions } from '../platform/datascience/displayOptions'; import { CellHashProviderFactory } from '../interactive-window/editor-integration/cellHashProviderFactory'; -import { JupyterConnectError } from '../extension/errors/jupyterConnectError'; +import { JupyterConnectError } from '../platform/errors/jupyterConnectError'; import { InteractiveWindowView } from '../notebooks/constants'; -import { KernelProgressReporter } from '../client/datascience/progress/kernelProgressReporter'; +import { KernelProgressReporter } from '../platform/datascience/progress/kernelProgressReporter'; import { sendKernelTelemetryEvent, trackKernelResourceInformation, initializeInteractiveOrNotebookTelemetryBasedOnUserAction -} from '../client/datascience/telemetry/telemetry'; +} from '../telemetry/telemetry'; import { INotebookProviderConnection, KernelSocketInformation, @@ -49,12 +49,11 @@ import { IStatusProvider, InterruptResult, IDisplayOptions -} from '../client/datascience/types'; -import { calculateWorkingDirectory } from '../client/datascience/utils'; -import { sendTelemetryEvent } from '../client/telemetry'; +} from '../platform/datascience/types'; +import { calculateWorkingDirectory } from '../platform/datascience/utils'; +import { sendTelemetryEvent } from '../telemetry'; import { concatMultilineString } from '../datascience-ui/common'; import { Telemetry, Identifiers, CodeSnippets } from '../datascience-ui/common/constants'; -import { sleep } from '../test/core'; import { CellOutputDisplayIdTracker } from '../notebooks/execution/cellDisplayIdTracker'; import { executeSilently, @@ -72,7 +71,7 @@ import { } from './types'; import { KernelExecution } from '../notebooks/execution/kernelExecution'; import { traceCellMessage } from '../notebooks/helpers'; -import { Cancellation } from '../client/common/cancellation'; +import { Cancellation } from '../platform/common/cancellation'; export class Kernel implements IKernel { /** diff --git a/src/kernels/kernelCommandListener.ts b/src/kernels/kernelCommandListener.ts index 3135cd98c49..18d47468400 100644 --- a/src/kernels/kernelCommandListener.ts +++ b/src/kernels/kernelCommandListener.ts @@ -4,21 +4,21 @@ import type { KernelMessage } from '@jupyterlab/services'; import { inject, injectable } from 'inversify'; import { ConfigurationTarget, Uri, window, workspace } from 'vscode'; -import { IApplicationShell, ICommandManager } from '../client/common/application/types'; -import { displayErrorsInCell } from '../client/../extension/errors/errorUtils'; -import { traceInfo } from '../client/common/logger'; -import { IDisposableRegistry, IConfigurationService, IDisposable } from '../client/common/types'; -import { DataScience } from '../client/common/utils/localize'; +import { IApplicationShell, ICommandManager } from '../platform/common/application/types'; +import { displayErrorsInCell } from '../platform/errors/errorUtils'; +import { traceInfo } from '../platform/common/logger'; +import { IDisposableRegistry, IConfigurationService, IDisposable } from '../platform/common/types'; +import { DataScience } from '../platform/common/utils/localize'; import { INotebookControllerManager } from '../notebooks/types'; -import { trackKernelResourceInformation } from '../client/datascience/telemetry/telemetry'; +import { trackKernelResourceInformation } from '../telemetry/telemetry'; import { IDataScienceCommandListener, IStatusProvider, IInteractiveWindowProvider, IDataScienceErrorHandler -} from '../client/datascience/types'; -import { IServiceContainer } from '../client/ioc/types'; -import { sendTelemetryEvent } from '../client/telemetry'; +} from '../platform/datascience/types'; +import { IServiceContainer } from '../platform/ioc/types'; +import { sendTelemetryEvent } from '../telemetry'; import { Commands, Telemetry } from '../datascience-ui/common/constants'; import { getDisplayNameOrNameOfKernelConnection, wrapKernelMethod } from './helpers'; import { JupyterSession } from './jupyter/session/jupyterSession'; diff --git a/src/kernels/kernelConnectionWrapper.ts b/src/kernels/kernelConnectionWrapper.ts index 0aa50980e5f..b0fb4a685a0 100644 --- a/src/kernels/kernelConnectionWrapper.ts +++ b/src/kernels/kernelConnectionWrapper.ts @@ -34,7 +34,7 @@ import { ISpecModel } from '@jupyterlab/services/lib/kernelspec/restapi'; import { JSONObject } from '@lumino/coreutils'; import { Signal } from '@lumino/signaling'; import { Disposable } from 'vscode'; -import { IDisposable } from '../client/common/types'; +import { IDisposable } from '../platform/common/types'; import { IKernel } from './types'; export class KernelConnectionWrapper implements Kernel.IKernelConnection { diff --git a/src/kernels/kernelDependencyService.ts b/src/kernels/kernelDependencyService.ts index 9ce4c6b9d7c..6298018d5ba 100644 --- a/src/kernels/kernelDependencyService.ts +++ b/src/kernels/kernelDependencyService.ts @@ -5,27 +5,26 @@ import { inject, injectable, named } from 'inversify'; import { CancellationToken, CancellationTokenSource, Memento } from 'vscode'; -import { IApplicationShell } from '../client/common/application/types'; -import { createPromiseFromCancellation } from '../client/common/cancellation'; -import { traceInfo, traceError, traceInfoIfCI } from '../client/common/logger'; -import { getDisplayPath } from '../client/common/platform/fs-paths'; -import { IMemento, GLOBAL_MEMENTO, IsCodeSpace, Resource } from '../client/common/types'; -import { DataScience, Common } from '../client/common/utils/localize'; -import { noop } from '../client/common/utils/misc'; -import { getResourceType } from '../client/datascience/common'; -import { KernelProgressReporter } from '../client/datascience/progress/kernelProgressReporter'; +import { IApplicationShell } from '../platform/common/application/types'; +import { createPromiseFromCancellation } from '../platform/common/cancellation'; +import { traceInfo, traceError, traceInfoIfCI } from '../platform/common/logger'; +import { getDisplayPath } from '../platform/common/platform/fs-paths'; +import { IMemento, GLOBAL_MEMENTO, IsCodeSpace, Resource } from '../platform/common/types'; +import { DataScience, Common } from '../platform/common/utils/localize'; +import { getResourceType } from '../platform/datascience/common'; +import { KernelProgressReporter } from '../platform/datascience/progress/kernelProgressReporter'; import { IKernelDependencyService, KernelInterpreterDependencyResponse, IRawNotebookSupportedService, IDisplayOptions -} from '../client/datascience/types'; -import { IServiceContainer } from '../client/ioc/types'; -import { traceDecorators } from '../client/logging'; -import { ignoreLogging, logValue } from '../client/logging/trace'; -import { EnvironmentType, PythonEnvironment } from '../client/pythonEnvironments/info'; -import { sendTelemetryEvent } from '../client/telemetry'; -import { getTelemetrySafeHashedString } from '../client/telemetry/helpers'; +} from '../platform/datascience/types'; +import { IServiceContainer } from '../platform/ioc/types'; +import { traceDecorators } from '../platform/logging'; +import { ignoreLogging, logValue } from '../platform/logging/trace'; +import { EnvironmentType, PythonEnvironment } from '../platform/pythonEnvironments/info'; +import { sendTelemetryEvent } from '../telemetry'; +import { getTelemetrySafeHashedString } from '../telemetry/helpers'; import { Telemetry } from '../datascience-ui/common/constants'; import { isModulePresentInEnvironmentCache, @@ -35,6 +34,7 @@ import { import { ProductNames } from './installer/productNames'; import { IInstaller, Product, InstallerResponse } from './installer/types'; import { KernelConnectionMetadata } from './types'; +import { noop } from '../platform/common/utils/misc'; /** * Responsible for managing dependencies of a Python interpreter required to run as a Jupyter Kernel. diff --git a/src/kernels/kernelProvider.ts b/src/kernels/kernelProvider.ts index 6f8b90af255..f1dc17d0709 100644 --- a/src/kernels/kernelProvider.ts +++ b/src/kernels/kernelProvider.ts @@ -5,21 +5,21 @@ import type { KernelMessage } from '@jupyterlab/services'; import { inject, injectable } from 'inversify'; import { Event, EventEmitter, NotebookDocument } from 'vscode'; -import { IApplicationShell, IWorkspaceService, IVSCodeNotebook } from '../client/common/application/types'; -import { traceInfoIfCI, traceVerbose, traceWarning } from '../client/common/logger'; -import { getDisplayPath } from '../client/common/platform/fs-paths'; -import { IFileSystem } from '../client/common/platform/types'; -import { IPythonExecutionFactory } from '../client/common/process/types'; +import { IApplicationShell, IWorkspaceService, IVSCodeNotebook } from '../platform/common/application/types'; +import { traceInfoIfCI, traceVerbose, traceWarning } from '../platform/common/logger'; +import { getDisplayPath } from '../platform/common/platform/fs-paths'; +import { IFileSystem } from '../platform/common/platform/types'; +import { IPythonExecutionFactory } from '../platform/common/process/types'; import { IAsyncDisposable, IAsyncDisposableRegistry, IDisposableRegistry, IConfigurationService -} from '../client/common/types'; -import { noop } from '../client/common/utils/misc'; +} from '../platform/common/types'; +import { noop } from '../platform/common/utils/misc'; import { CellHashProviderFactory } from '../interactive-window/editor-integration/cellHashProviderFactory'; import { InteractiveWindowView } from '../notebooks/constants'; -import { INotebookProvider, IStatusProvider } from '../client/datascience/types'; +import { INotebookProvider, IStatusProvider } from '../platform/datascience/types'; import { CellOutputDisplayIdTracker } from '../notebooks/execution/cellDisplayIdTracker'; import { Kernel } from './kernel'; import { IKernel, IKernelProvider, KernelOptions } from './types'; diff --git a/src/kernels/raw/finder/jupyterPaths.ts b/src/kernels/raw/finder/jupyterPaths.ts index 8d5ec9a2025..894a3a26f4a 100644 --- a/src/kernels/raw/finder/jupyterPaths.ts +++ b/src/kernels/raw/finder/jupyterPaths.ts @@ -5,17 +5,17 @@ import { inject, injectable, named } from 'inversify'; import * as path from 'path'; import { CancellationToken, Memento } from 'vscode'; -import { IPlatformService, IFileSystem } from '../../../client/common/platform/types'; +import { IPlatformService, IFileSystem } from '../../../platform/common/platform/types'; import { IPathUtils, IDisposableRegistry, IMemento, GLOBAL_MEMENTO, IExtensionContext -} from '../../../client/common/types'; -import { IEnvironmentVariablesProvider } from '../../../client/common/variables/types'; -import { tryGetRealPath } from '../../../client/datascience/common'; -import { traceDecorators } from '../../../client/logging'; +} from '../../../platform/common/types'; +import { IEnvironmentVariablesProvider } from '../../../platform/common/variables/types'; +import { tryGetRealPath } from '../../../platform/datascience/common'; +import { traceDecorators } from '../../../platform/logging'; const winJupyterPath = path.join('AppData', 'Roaming', 'jupyter', 'kernels'); const linuxJupyterPath = path.join('.local', 'share', 'jupyter', 'kernels'); diff --git a/src/kernels/raw/finder/localKernelFinder.ts b/src/kernels/raw/finder/localKernelFinder.ts index f6183253010..f2e0d1405e3 100644 --- a/src/kernels/raw/finder/localKernelFinder.ts +++ b/src/kernels/raw/finder/localKernelFinder.ts @@ -14,25 +14,25 @@ import { import { LocalKernelConnectionMetadata } from '../../../kernels/types'; import { LocalPythonAndRelatedNonPythonKernelSpecFinder } from './localPythonAndRelatedNonPythonKernelSpecFinder'; import { LocalKnownPathKernelSpecFinder } from './localKnownPathKernelSpecFinder'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { createPromiseFromCancellation } from '../../../client/common/cancellation'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { traceInfo, traceError } from '../../../client/common/logger'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IMemento, GLOBAL_MEMENTO, Resource } from '../../../client/common/types'; -import { getResourceType } from '../../../client/datascience/common'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { createPromiseFromCancellation } from '../../../platform/common/cancellation'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { traceInfo, traceError } from '../../../platform/common/logger'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IMemento, GLOBAL_MEMENTO, Resource } from '../../../platform/common/types'; +import { getResourceType } from '../../../platform/datascience/common'; import { isPythonNotebook } from '../../../notebooks/helpers'; -import { sendKernelListTelemetry } from '../../../client/datascience/telemetry/kernelTelemetry'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { traceDecorators } from '../../../client/logging'; -import { ignoreLogging, TraceOptions } from '../../../client/logging/trace'; -import { getInterpreterHash } from '../../../client/pythonEnvironments/info/interpreter'; -import { captureTelemetry, sendTelemetryEvent } from '../../../client/telemetry'; -import { getTelemetrySafeLanguage } from '../../../client/telemetry/helpers'; +import { sendKernelListTelemetry } from '../../../telemetry/kernelTelemetry'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { traceDecorators } from '../../../platform/logging'; +import { ignoreLogging, TraceOptions } from '../../../platform/logging/trace'; +import { getInterpreterHash } from '../../../platform/pythonEnvironments/info/interpreter'; +import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry'; +import { getTelemetrySafeLanguage } from '../../../telemetry/helpers'; import { Telemetry } from '../../../datascience-ui/common/constants'; import { ILocalKernelFinder } from '../types'; -import { swallowExceptions } from '../../../client/common/utils/decorators'; -import { noop } from '../../../client/common/utils/misc'; +import { swallowExceptions } from '../../../platform/common/utils/decorators'; +import { noop } from '../../../platform/common/utils/misc'; const GlobalKernelSpecsCacheKey = 'JUPYTER_GLOBAL_KERNELSPECS_V2'; const LocalKernelSpecConnectionsCacheKey = 'LOCAL_KERNEL_SPEC_CONNECTIONS_CACHE_KEY_V2'; diff --git a/src/kernels/raw/finder/localKernelSpecFinderBase.ts b/src/kernels/raw/finder/localKernelSpecFinderBase.ts index 94516937817..4123f202b90 100644 --- a/src/kernels/raw/finder/localKernelSpecFinderBase.ts +++ b/src/kernels/raw/finder/localKernelSpecFinderBase.ts @@ -2,22 +2,21 @@ // Licensed under the MIT License. 'use strict'; -import { inject, injectable, named } from 'inversify'; import * as path from 'path'; import { CancellationToken, Memento } from 'vscode'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { traceInfoIfCI, traceInfo, traceVerbose, traceError } from '../../../client/common/logger'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IMemento, GLOBAL_MEMENTO, ReadWrite } from '../../../client/common/types'; -import { testOnlyMethod } from '../../../client/common/utils/decorators'; -import { noop } from '../../../client/common/utils/misc'; -import { IJupyterKernelSpec } from '../../../client/datascience/types'; -import { traceDecorators } from '../../../client/logging'; -import { ignoreLogging } from '../../../client/logging/trace'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { traceInfoIfCI, traceInfo, traceVerbose, traceError } from '../../../platform/common/logger'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { ReadWrite } from '../../../platform/common/types'; +import { testOnlyMethod } from '../../../platform/common/utils/decorators'; +import { noop } from '../../../platform/common/utils/misc'; +import { IJupyterKernelSpec } from '../../../platform/datascience/types'; +import { traceDecorators } from '../../../platform/logging'; +import { ignoreLogging } from '../../../platform/logging/trace'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { getInterpreterKernelSpecName, getKernelRegistrationInfo } from '../../../kernels/helpers'; import { LocalKernelSpecConnectionMetadata, PythonKernelConnectionMetadata } from '../../../kernels/types'; import { JupyterKernelSpec } from '../../jupyter/jupyterKernelSpec'; @@ -26,7 +25,6 @@ type KernelSpecFileWithContainingInterpreter = { interpreter?: PythonEnvironment export const isDefaultPythonKernelSpecSpecName = /python\s\d*.?\d*$/; export const oldKernelsSpecFolderName = '__old_vscode_kernelspecs'; -@injectable() export abstract class LocalKernelSpecFinderBase { private _oldKernelSpecsFolder?: string; protected get oldKernelSpecsFolder() { @@ -51,10 +49,10 @@ export abstract class LocalKernelSpecFinderBase { private pathToKernelSpec = new Map>(); constructor( - @inject(IFileSystem) protected readonly fs: IFileSystem, - @inject(IWorkspaceService) protected readonly workspaceService: IWorkspaceService, + protected readonly fs: IFileSystem, + protected readonly workspaceService: IWorkspaceService, protected readonly extensionChecker: IPythonExtensionChecker, - @inject(IMemento) @named(GLOBAL_MEMENTO) protected readonly globalState: Memento + protected readonly globalState: Memento ) {} @testOnlyMethod() diff --git a/src/kernels/raw/finder/localKnownPathKernelSpecFinder.ts b/src/kernels/raw/finder/localKnownPathKernelSpecFinder.ts index 67753afce9c..bdbe095332e 100644 --- a/src/kernels/raw/finder/localKnownPathKernelSpecFinder.ts +++ b/src/kernels/raw/finder/localKnownPathKernelSpecFinder.ts @@ -8,15 +8,15 @@ import { getKernelId } from '../../../kernels/helpers'; import { LocalKernelSpecConnectionMetadata, PythonKernelConnectionMetadata } from '../../../kernels/types'; import { LocalKernelSpecFinderBase } from './localKernelSpecFinderBase'; import { JupyterPaths } from './jupyterPaths'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { traceInfo, traceError } from '../../../client/common/logger'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IMemento, GLOBAL_MEMENTO } from '../../../client/common/types'; -import { captureTelemetry } from '../../../client/telemetry'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { traceInfo, traceError } from '../../../platform/common/logger'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IMemento, GLOBAL_MEMENTO } from '../../../platform/common/types'; +import { captureTelemetry } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; -import { IJupyterKernelSpec } from '../../../client/datascience/types'; +import { IJupyterKernelSpec } from '../../../platform/datascience/types'; /** * This class searches for kernels on the file system in well known paths documented by Jupyter. diff --git a/src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.ts b/src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.ts index 4d2dd0f865a..d8adbdad250 100644 --- a/src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.ts +++ b/src/kernels/raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder.ts @@ -10,19 +10,19 @@ import { LocalKernelSpecConnectionMetadata, PythonKernelConnectionMetadata } fro import { LocalKernelSpecFinderBase } from './localKernelSpecFinderBase'; import { baseKernelPath, JupyterPaths } from './jupyterPaths'; import { LocalKnownPathKernelSpecFinder } from './localKnownPathKernelSpecFinder'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { traceInfoIfCI, traceVerbose, traceError } from '../../../client/common/logger'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IMemento, GLOBAL_MEMENTO, Resource } from '../../../client/common/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { areInterpreterPathsSame } from '../../../client/pythonEnvironments/info/interpreter'; -import { captureTelemetry } from '../../../client/telemetry'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { traceInfoIfCI, traceVerbose, traceError } from '../../../platform/common/logger'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IMemento, GLOBAL_MEMENTO, Resource } from '../../../platform/common/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { areInterpreterPathsSame } from '../../../platform/pythonEnvironments/info/interpreter'; +import { captureTelemetry } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; -import { IJupyterKernelSpec } from '../../../client/datascience/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IJupyterKernelSpec } from '../../../platform/datascience/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; export const isDefaultPythonKernelSpecName = /^python\d*.?\d*$/; diff --git a/src/kernels/raw/finder/preferredRemoteKernelIdProvider.ts b/src/kernels/raw/finder/preferredRemoteKernelIdProvider.ts index 6c89c1ffd83..487ffc1d2e7 100644 --- a/src/kernels/raw/finder/preferredRemoteKernelIdProvider.ts +++ b/src/kernels/raw/finder/preferredRemoteKernelIdProvider.ts @@ -4,10 +4,10 @@ import { inject, injectable, named } from 'inversify'; import { cloneDeep } from 'lodash'; import { Memento, Uri } from 'vscode'; -import { traceInfo } from '../../../client/common/logger'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; -import { IMemento, GLOBAL_MEMENTO, ICryptoUtils } from '../../../client/common/types'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +import { traceInfo } from '../../../platform/common/logger'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; +import { IMemento, GLOBAL_MEMENTO, ICryptoUtils } from '../../../platform/common/types'; +import { sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; export const ActiveKernelIdList = 'Active_Kernel_Id_List'; diff --git a/src/kernels/raw/finder/pythonKernelInterruptDaemon.ts b/src/kernels/raw/finder/pythonKernelInterruptDaemon.ts index c964f4db860..52994736a05 100644 --- a/src/kernels/raw/finder/pythonKernelInterruptDaemon.ts +++ b/src/kernels/raw/finder/pythonKernelInterruptDaemon.ts @@ -5,11 +5,11 @@ import { ChildProcess } from 'child_process'; import { MessageConnection, RequestType0 } from 'vscode-jsonrpc'; -import { traceInfo } from '../../../client/common/logger'; -import { IPlatformService } from '../../../client/common/platform/types'; -import { BasePythonDaemon } from '../../../client/common/process/baseDaemon'; -import { IPythonExecutionService } from '../../../client/common/process/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { traceInfo } from '../../../platform/common/logger'; +import { IPlatformService } from '../../../platform/common/platform/types'; +import { BasePythonDaemon } from '../../../platform/common/process/baseDaemon'; +import { IPythonExecutionService } from '../../../platform/common/process/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { IPythonKernelDaemon } from '../types'; export class PythonKernelInterruptDaemon extends BasePythonDaemon implements IPythonKernelDaemon { diff --git a/src/kernels/raw/finder/remoteKernelFinder.ts b/src/kernels/raw/finder/remoteKernelFinder.ts index fb8c5bffe4d..5196213efee 100644 --- a/src/kernels/raw/finder/remoteKernelFinder.ts +++ b/src/kernels/raw/finder/remoteKernelFinder.ts @@ -13,22 +13,22 @@ import { LiveKernelConnectionMetadata, RemoteKernelSpecConnectionMetadata } from '../../../kernels/types'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { traceError, traceInfoIfCI } from '../../../client/common/logger'; -import { IDisposableRegistry, Resource } from '../../../client/common/types'; -import { getResourceType } from '../../../client/datascience/common'; -import { sendKernelListTelemetry } from '../../../client/datascience/telemetry/kernelTelemetry'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { traceError, traceInfoIfCI } from '../../../platform/common/logger'; +import { IDisposableRegistry, Resource } from '../../../platform/common/types'; +import { getResourceType } from '../../../platform/datascience/common'; +import { sendKernelListTelemetry } from '../../../telemetry/kernelTelemetry'; import { IJupyterSessionManagerFactory, INotebookProviderConnection, IJupyterSessionManager, IJupyterKernelSpec -} from '../../../client/datascience/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { traceDecorators } from '../../../client/logging'; -import { ignoreLogging } from '../../../client/logging/trace'; -import { captureTelemetry, sendTelemetryEvent } from '../../../client/telemetry'; -import { getTelemetrySafeLanguage } from '../../../client/telemetry/helpers'; +} from '../../../platform/datascience/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { traceDecorators } from '../../../platform/logging'; +import { ignoreLogging } from '../../../platform/logging/trace'; +import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry'; +import { getTelemetrySafeLanguage } from '../../../telemetry/helpers'; import { Telemetry } from '../../../datascience-ui/common/constants'; import { IRemoteKernelFinder } from '../types'; import { PreferredRemoteKernelIdProvider } from './preferredRemoteKernelIdProvider'; diff --git a/src/kernels/raw/launcher/kernelEnvVarsService.ts b/src/kernels/raw/launcher/kernelEnvVarsService.ts index 8b6a9c8f21e..4b0939fcbb2 100644 --- a/src/kernels/raw/launcher/kernelEnvVarsService.ts +++ b/src/kernels/raw/launcher/kernelEnvVarsService.ts @@ -3,15 +3,15 @@ import { inject, injectable } from 'inversify'; import * as path from 'path'; -import { traceInfo, traceError } from '../../../client/common/logger'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; -import { Resource } from '../../../client/common/types'; -import { noop } from '../../../client/common/utils/misc'; -import { IEnvironmentVariablesService, IEnvironmentVariablesProvider } from '../../../client/common/variables/types'; -import { IJupyterKernelSpec } from '../../../client/datascience/types'; -import { IEnvironmentActivationService } from '../../../client/interpreter/activation/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { traceInfo, traceError } from '../../../platform/common/logger'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; +import { Resource } from '../../../platform/common/types'; +import { noop } from '../../../platform/common/utils/misc'; +import { IEnvironmentVariablesService, IEnvironmentVariablesProvider } from '../../../platform/common/variables/types'; +import { IJupyterKernelSpec } from '../../../platform/datascience/types'; +import { IEnvironmentActivationService } from '../../../platform/interpreter/activation/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; @injectable() export class KernelEnvironmentVariablesService { diff --git a/src/kernels/raw/launcher/kernelLauncher.ts b/src/kernels/raw/launcher/kernelLauncher.ts index 6d27a79c41e..5e60b055789 100644 --- a/src/kernels/raw/launcher/kernelLauncher.ts +++ b/src/kernels/raw/launcher/kernelLauncher.ts @@ -10,19 +10,19 @@ import * as portfinder from 'portfinder'; import { promisify } from 'util'; import * as uuid from 'uuid/v4'; import { CancellationError, CancellationToken, window } from 'vscode'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { Cancellation, createPromiseFromCancellation } from '../../../client/common/cancellation'; -import { isTestExecution } from '../../../client/common/constants'; -import { getTelemetrySafeErrorMessageFromPythonTraceback } from '../../../client/../extension/errors/errorUtils'; -import { traceInfo, traceWarning } from '../../../client/common/logger'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IProcessServiceFactory, IPythonExecutionFactory } from '../../../client/common/process/types'; -import { IDisposableRegistry, IConfigurationService, Resource } from '../../../client/common/types'; -import { swallowExceptions } from '../../../client/common/utils/decorators'; -import { DataScience } from '../../../client/common/utils/localize'; -import { sendKernelTelemetryWhenDone } from '../../../client/datascience/telemetry/telemetry'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { Cancellation, createPromiseFromCancellation } from '../../../platform/common/cancellation'; +import { isTestExecution } from '../../../platform/common/constants'; +import { getTelemetrySafeErrorMessageFromPythonTraceback } from '../../../platform/errors/errorUtils'; +import { traceInfo, traceWarning } from '../../../platform/common/logger'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IProcessServiceFactory, IPythonExecutionFactory } from '../../../platform/common/process/types'; +import { IDisposableRegistry, IConfigurationService, Resource } from '../../../platform/common/types'; +import { swallowExceptions } from '../../../platform/common/utils/decorators'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { sendKernelTelemetryWhenDone } from '../../../telemetry/telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; import { isLocalConnection, diff --git a/src/kernels/raw/launcher/kernelProcess.ts b/src/kernels/raw/launcher/kernelProcess.ts index 2ea05e35542..f7754ba632d 100644 --- a/src/kernels/raw/launcher/kernelProcess.ts +++ b/src/kernels/raw/launcher/kernelProcess.ts @@ -16,34 +16,34 @@ import { import { LocalKernelSpecConnectionMetadata, PythonKernelConnectionMetadata } from '../../../kernels/types'; import { IKernelConnection, IKernelProcess } from '../types'; import { KernelEnvironmentVariablesService } from './kernelEnvVarsService'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { Cancellation, createPromiseFromCancellation } from '../../../client/common/cancellation'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { Cancellation, createPromiseFromCancellation } from '../../../platform/common/cancellation'; import { getTelemetrySafeErrorMessageFromPythonTraceback, getErrorMessageFromPythonTraceback -} from '../../../client/../extension/errors/errorUtils'; -import { BaseError } from '../../../client/../extension/errors/types'; -import { traceInfo, traceError, traceVerbose, traceWarning, traceInfoIfCI } from '../../../client/common/logger'; -import { IFileSystem } from '../../../client/common/platform/types'; +} from '../../../platform/errors/errorUtils'; +import { BaseError } from '../../../platform/errors/types'; +import { traceInfo, traceError, traceVerbose, traceWarning, traceInfoIfCI } from '../../../platform/common/logger'; +import { IFileSystem } from '../../../platform/common/platform/types'; import { IProcessServiceFactory, IPythonExecutionFactory, ObservableExecutionResult, IProcessService -} from '../../../client/common/process/types'; -import { Resource, IOutputChannel, IJupyterSettings } from '../../../client/common/types'; -import { createDeferred } from '../../../client/common/utils/async'; -import { DataScience } from '../../../client/common/utils/localize'; -import { noop, swallowExceptions } from '../../../client/common/utils/misc'; -import { KernelDiedError } from '../../../extension/errors/kernelDiedError'; -import { KernelPortNotUsedTimeoutError } from '../../../extension/errors/kernelPortNotUsedTimeoutError'; -import { KernelProcessExitedError } from '../../../extension/errors/kernelProcessExitedError'; -import { traceDecorators } from '../../../client/logging'; -import { ignoreLogging, TraceOptions } from '../../../client/logging/trace'; -import { captureTelemetry } from '../../../client/telemetry'; +} from '../../../platform/common/process/types'; +import { Resource, IOutputChannel, IJupyterSettings } from '../../../platform/common/types'; +import { createDeferred } from '../../../platform/common/utils/async'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { noop, swallowExceptions } from '../../../platform/common/utils/misc'; +import { KernelDiedError } from '../../../platform/errors/kernelDiedError'; +import { KernelPortNotUsedTimeoutError } from '../../../platform/errors/kernelPortNotUsedTimeoutError'; +import { KernelProcessExitedError } from '../../../platform/errors/kernelProcessExitedError'; +import { traceDecorators } from '../../../platform/logging'; +import { ignoreLogging, TraceOptions } from '../../../platform/logging/trace'; +import { captureTelemetry } from '../../../telemetry'; import { Telemetry, KernelInterruptDaemonModule } from '../../../datascience-ui/common/constants'; import { PythonKernelInterruptDaemon } from '../finder/pythonKernelInterruptDaemon'; -import { IJupyterKernelSpec } from '../../../client/datascience/types'; +import { IJupyterKernelSpec } from '../../../platform/datascience/types'; // Launches and disposes a kernel process given a kernelspec and a resource or python interpreter. // Exposes connection information and the process itself. diff --git a/src/kernels/raw/session/hostRawNotebookProvider.ts b/src/kernels/raw/session/hostRawNotebookProvider.ts index 642bc96763b..eb86ab2b0c8 100644 --- a/src/kernels/raw/session/hostRawNotebookProvider.ts +++ b/src/kernels/raw/session/hostRawNotebookProvider.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../../../client/common/extensions'; +import '../../../platform/common/extensions'; import * as vscode from 'vscode'; import * as uuid from 'uuid/v4'; @@ -12,24 +12,24 @@ import { IRawConnection, IRawNotebookProvider, IRawNotebookSupportedService -} from '../../../client/datascience/types'; +} from '../../../platform/datascience/types'; import { injectable, inject, named } from 'inversify'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { STANDARD_OUTPUT_CHANNEL } from '../../../client/common/constants'; -import { traceInfo, traceVerbose, traceError } from '../../../client/common/logger'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { STANDARD_OUTPUT_CHANNEL } from '../../../platform/common/constants'; +import { traceInfo, traceVerbose, traceError } from '../../../platform/common/logger'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; import { IAsyncDisposableRegistry, IConfigurationService, IOutputChannel, IDisposableRegistry, Resource -} from '../../../client/common/types'; -import { createDeferred } from '../../../client/common/utils/async'; -import { DataScience } from '../../../client/common/utils/localize'; -import { trackKernelResourceInformation } from '../../../client/datascience/telemetry/telemetry'; -import { captureTelemetry, sendTelemetryEvent } from '../../../client/telemetry'; +} from '../../../platform/common/types'; +import { createDeferred } from '../../../platform/common/utils/async'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { trackKernelResourceInformation } from '../../../telemetry/telemetry'; +import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; import { isPythonKernelConnection } from '../../helpers'; import { computeWorkingDirectory } from '../../jupyter/jupyterUtils'; @@ -37,8 +37,8 @@ import { JupyterNotebook } from '../../jupyter/launcher/jupyterNotebook'; import { KernelConnectionMetadata } from '../../types'; import { IKernelLauncher } from '../types'; import { RawJupyterSession } from './rawJupyterSession'; -import { noop } from '../../../client/common/utils/misc'; -import { Cancellation } from '../../../client/common/cancellation'; +import { noop } from '../../../platform/common/utils/misc'; +import { Cancellation } from '../../../platform/common/cancellation'; // eslint-disable-next-line @typescript-eslint/no-require-imports /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/kernels/raw/session/rawJupyterSession.ts b/src/kernels/raw/session/rawJupyterSession.ts index 9954a74627a..2f7baa4d9df 100644 --- a/src/kernels/raw/session/rawJupyterSession.ts +++ b/src/kernels/raw/session/rawJupyterSession.ts @@ -5,26 +5,22 @@ import type { Kernel, KernelMessage } from '@jupyterlab/services'; import type { Slot } from '@lumino/signaling'; import { CancellationError, CancellationTokenSource } from 'vscode'; import { CancellationToken } from 'vscode-jsonrpc'; -import { Cancellation, createPromiseFromCancellation } from '../../../client/common/cancellation'; -import { getTelemetrySafeErrorMessageFromPythonTraceback } from '../../../client/../extension/errors/errorUtils'; -import { traceInfo, traceError, traceVerbose, traceWarning } from '../../../client/common/logger'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; -import { IDisposable, IOutputChannel, Resource } from '../../../client/common/types'; -import { TimedOutError, createDeferred } from '../../../client/common/utils/async'; -import { DataScience } from '../../../client/common/utils/localize'; -import { StopWatch } from '../../../client/common/utils/stopWatch'; -import { DisplayOptions } from '../../../client/datascience/displayOptions'; -import { KernelProgressReporter } from '../../../client/datascience/progress/kernelProgressReporter'; -import { - trackKernelResourceInformation, - sendKernelTelemetryEvent -} from '../../../client/datascience/telemetry/telemetry'; -import { IDisplayOptions, ISessionWithSocket } from '../../../client/datascience/types'; -import { sendTelemetryEvent, captureTelemetry } from '../../../client/telemetry'; +import { Cancellation, createPromiseFromCancellation } from '../../../platform/common/cancellation'; +import { getTelemetrySafeErrorMessageFromPythonTraceback } from '../../../platform/errors/errorUtils'; +import { traceInfo, traceError, traceVerbose, traceWarning } from '../../../platform/common/logger'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; +import { IDisposable, IOutputChannel, Resource } from '../../../platform/common/types'; +import { TimedOutError, createDeferred, sleep } from '../../../platform/common/utils/async'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { StopWatch } from '../../../platform/common/utils/stopWatch'; +import { DisplayOptions } from '../../../platform/datascience/displayOptions'; +import { KernelProgressReporter } from '../../../platform/datascience/progress/kernelProgressReporter'; +import { trackKernelResourceInformation, sendKernelTelemetryEvent } from '../../../telemetry/telemetry'; +import { IDisplayOptions, ISessionWithSocket } from '../../../platform/datascience/types'; +import { sendTelemetryEvent, captureTelemetry } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; import { getDisplayNameOrNameOfKernelConnection } from '../../../kernels/helpers'; import { KernelConnectionMetadata } from '../../../kernels/types'; -import { sleep } from '../../../test/core'; import { BaseJupyterSession } from '../../common/baseJupyterSession'; import { IKernelLauncher, IKernelProcess } from '../types'; import { RawSession } from './rawSession'; diff --git a/src/kernels/raw/session/rawKernel.ts b/src/kernels/raw/session/rawKernel.ts index 0896986d759..73acff13fd8 100644 --- a/src/kernels/raw/session/rawKernel.ts +++ b/src/kernels/raw/session/rawKernel.ts @@ -5,11 +5,11 @@ import { ISignal } from '@lumino/signaling'; /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-require-imports */ import cloneDeep = require('lodash/cloneDeep'); import * as uuid from 'uuid/v4'; -import { isTestExecution } from '../../../client/common/constants'; -import { traceError, traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; -import { swallowExceptions } from '../../../client/common/utils/misc'; -import { IKernelSocket } from '../../../client/datascience/types'; +import { isTestExecution } from '../../../platform/common/constants'; +import { traceError, traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; +import { swallowExceptions } from '../../../platform/common/utils/misc'; +import { IKernelSocket } from '../../../platform/datascience/types'; import { getNameOfKernelConnection } from '../../../kernels/helpers'; import { IWebSocketLike } from '../../common/kernelSocketWrapper'; import { IKernelProcess } from '../types'; diff --git a/src/kernels/raw/session/rawNotebookSupportedService.ts b/src/kernels/raw/session/rawNotebookSupportedService.ts index 927b9623d95..0fb277e45f1 100644 --- a/src/kernels/raw/session/rawNotebookSupportedService.ts +++ b/src/kernels/raw/session/rawNotebookSupportedService.ts @@ -2,10 +2,10 @@ // Licensed under the MIT License. 'use strict'; import { inject, injectable } from 'inversify'; -import { traceInfo, traceError } from '../../../client/common/logger'; -import { IConfigurationService } from '../../../client/common/types'; -import { IRawNotebookSupportedService } from '../../../client/datascience/types'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +import { traceInfo, traceError } from '../../../platform/common/logger'; +import { IConfigurationService } from '../../../platform/common/types'; +import { IRawNotebookSupportedService } from '../../../platform/datascience/types'; +import { sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; // This class check to see if we have everything in place to support a raw kernel launch on the machine diff --git a/src/kernels/raw/session/rawSession.ts b/src/kernels/raw/session/rawSession.ts index 89b6c9ac40f..d37a563094e 100644 --- a/src/kernels/raw/session/rawSession.ts +++ b/src/kernels/raw/session/rawSession.ts @@ -3,15 +3,15 @@ import type { Kernel, KernelMessage, ServerConnection, Session } from '@jupyterlab/services'; import { ISignal, Signal } from '@lumino/signaling'; import * as uuid from 'uuid/v4'; -import { getTelemetrySafeErrorMessageFromPythonTraceback } from '../../../client/../extension/errors/errorUtils'; -import '../../../client/common/extensions'; -import { traceVerbose, traceInfoIfCI, traceError } from '../../../client/common/logger'; -import { IDisposable, Resource } from '../../../client/common/types'; -import { createDeferred, sleep } from '../../../client/common/utils/async'; -import { noop } from '../../../client/common/utils/misc'; -import { KernelConnectionTimeoutError } from '../../../extension/errors/kernelConnectionTimeoutError'; -import { ISessionWithSocket, KernelSocketInformation } from '../../../client/datascience/types'; -import { sendTelemetryEvent } from '../../../client/telemetry'; +import { getTelemetrySafeErrorMessageFromPythonTraceback } from '../../../platform/errors/errorUtils'; +import '../../../platform/common/extensions'; +import { traceVerbose, traceInfoIfCI, traceError } from '../../../platform/common/logger'; +import { IDisposable, Resource } from '../../../platform/common/types'; +import { createDeferred, sleep } from '../../../platform/common/utils/async'; +import { noop } from '../../../platform/common/utils/misc'; +import { KernelConnectionTimeoutError } from '../../../platform/errors/kernelConnectionTimeoutError'; +import { ISessionWithSocket, KernelSocketInformation } from '../../../platform/datascience/types'; +import { sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../../../datascience-ui/common/constants'; import { KernelConnectionMetadata } from '../../types'; import { IKernelProcess } from '../types'; diff --git a/src/kernels/raw/session/rawSocket.ts b/src/kernels/raw/session/rawSocket.ts index 9f2a89e6f71..4bfa2752c1a 100644 --- a/src/kernels/raw/session/rawSocket.ts +++ b/src/kernels/raw/session/rawSocket.ts @@ -6,9 +6,9 @@ import * as wireProtocol from '@nteract/messaging/lib/wire-protocol'; import * as uuid from 'uuid/v4'; import * as WebSocketWS from 'ws'; import type { Dealer, Subscriber } from 'zeromq'; -import { traceError } from '../../../client/common/logger'; -import { noop } from '../../../client/common/utils/misc'; -import { IKernelSocket } from '../../../client/datascience/types'; +import { traceError } from '../../../platform/common/logger'; +import { noop } from '../../../platform/common/utils/misc'; +import { IKernelSocket } from '../../../platform/datascience/types'; import { IWebSocketLike } from '../../common/kernelSocketWrapper'; import { IKernelConnection } from '../types'; diff --git a/src/kernels/raw/types.ts b/src/kernels/raw/types.ts index 4ab34cee3be..627c84196d0 100644 --- a/src/kernels/raw/types.ts +++ b/src/kernels/raw/types.ts @@ -4,8 +4,8 @@ import type * as nbformat from '@jupyterlab/nbformat'; import { CancellationToken, Event } from 'vscode'; -import { IAsyncDisposable, IDisposable, Resource } from '../../client/common/types'; -import { INotebookProviderConnection } from '../../client/datascience/types'; +import { IAsyncDisposable, IDisposable, Resource } from '../../platform/common/types'; +import { INotebookProviderConnection } from '../../platform/datascience/types'; import { KernelConnectionMetadata, LocalKernelConnectionMetadata, diff --git a/src/kernels/serviceRegistry.ts b/src/kernels/serviceRegistry.ts new file mode 100644 index 00000000000..a1f3adacec0 --- /dev/null +++ b/src/kernels/serviceRegistry.ts @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; +import * as vscode from 'vscode'; +import { Identifiers } from '../datascience-ui/common/constants'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { IPythonExtensionChecker } from '../platform/api/types'; +import { JupyterCommandLineSelectorCommand } from '../platform/commands/commandLineSelector'; +import { JupyterServerSelectorCommand } from '../platform/commands/serverSelector'; +import { IApplicationEnvironment } from '../platform/common/application/types'; +import { JVSC_EXTENSION_ID } from '../platform/common/constants'; +import { IConfigurationService } from '../platform/common/types'; +import { JupyterVariableDataProvider } from '../platform/datascience/data-viewing/jupyterVariableDataProvider'; +import { JupyterVariableDataProviderFactory } from '../platform/datascience/data-viewing/jupyterVariableDataProviderFactory'; +import { MultiplexingDebugService } from '../platform/datascience/multiplexingDebugService'; +import { + IRawNotebookSupportedService, + IJupyterCommandFactory, + INotebookExporter, + INotebookImporter, + INotebookServer, + IRawNotebookProvider, + IJupyterNotebookProvider, + IDataScienceCommandListener, + IInteractiveWindowDebugger, + ICellHashListener, + IJupyterExecution, + IJupyterPasswordConnect, + IJupyterSessionManagerFactory, + IJupyterVariables, + IKernelVariableRequester, + INbConvertInterpreterDependencyChecker, + INbConvertExportToPythonService, + IJupyterServerProvider, + IJupyterInterpreterDependencyManager, + IJupyterSubCommandExecutionService, + IKernelDependencyService, + IJupyterDebugService, + IJupyterVariableDataProvider, + IJupyterVariableDataProviderFactory, + IJupyterUriProviderRegistration, + IJupyterServerUriStorage, + INotebookProvider +} from '../platform/datascience/types'; +import { ProtocolParser } from '../platform/debugger/extension/helpers/protocolParser'; +import { IProtocolParser } from '../platform/debugger/extension/types'; +import { IServiceManager } from '../platform/ioc/types'; +import { setSharedProperty } from '../telemetry'; +import { InteractiveWindowDebugger } from './debugging/interactiveWindowDebugger'; +import { JupyterDebugService } from './debugging/jupyterDebugService'; +import { isLocalLaunch } from './helpers'; +import { registerInstallerTypes } from './installer/serviceRegistry'; +import { IPyWidgetMessageDispatcherFactory } from './ipywidgets-message-coordination/ipyWidgetMessageDispatcherFactory'; +import { NotebookIPyWidgetCoordinator } from './ipywidgets-message-coordination/notebookIPyWidgetCoordinator'; +import { JupyterExporter } from './jupyter/import-export/jupyterExporter'; +import { JupyterImporter } from './jupyter/import-export/jupyterImporter'; +import { JupyterCommandFactory } from './jupyter/interpreter/jupyterCommand'; +import { JupyterInterpreterDependencyService } from './jupyter/interpreter/jupyterInterpreterDependencyService'; +import { JupyterInterpreterOldCacheStateStore } from './jupyter/interpreter/jupyterInterpreterOldCacheStateStore'; +import { JupyterInterpreterSelectionCommand } from './jupyter/interpreter/jupyterInterpreterSelectionCommand'; +import { JupyterInterpreterSelector } from './jupyter/interpreter/jupyterInterpreterSelector'; +import { JupyterInterpreterService } from './jupyter/interpreter/jupyterInterpreterService'; +import { + MigrateJupyterInterpreterStateService, + JupyterInterpreterStateStore +} from './jupyter/interpreter/jupyterInterpreterStateStore'; +import { JupyterInterpreterSubCommandExecutionService } from './jupyter/interpreter/jupyterInterpreterSubCommandExecutionService'; +import { NbConvertExportToPythonService } from './jupyter/interpreter/nbconvertExportToPythonService'; +import { NbConvertInterpreterDependencyChecker } from './jupyter/interpreter/nbconvertInterpreterDependencyChecker'; +import { CellOutputMimeTypeTracker } from './jupyter/jupyterCellOutputMimeTypeTracker'; +import { JupyterKernelService } from './jupyter/jupyterKernelService'; +import { JupyterUriProviderRegistration } from './jupyter/jupyterUriProviderRegistration'; +import { JupyterCommandLineSelector } from './jupyter/launcher/commandLineSelector'; +import { JupyterNotebookProvider } from './jupyter/launcher/jupyterNotebookProvider'; +import { JupyterPasswordConnect } from './jupyter/launcher/jupyterPasswordConnect'; +import { HostJupyterExecution } from './jupyter/launcher/liveshare/hostJupyterExecution'; +import { HostJupyterServer } from './jupyter/launcher/liveshare/hostJupyterServer'; +import { NotebookProvider } from './jupyter/launcher/notebookProvider'; +import { NotebookServerProvider } from './jupyter/launcher/notebookServerProvider'; +import { NotebookStarter } from './jupyter/launcher/notebookStarter'; +import { ServerPreload } from './jupyter/launcher/serverPreload'; +import { JupyterServerUriStorage } from './jupyter/launcher/serverUriStorage'; +import { JupyterServerSelector } from './jupyter/serverSelector'; +import { JupyterSessionManagerFactory } from './jupyter/session/jupyterSessionManagerFactory'; +import { KernelCommandListener } from './kernelCommandListener'; +import { KernelDependencyService } from './kernelDependencyService'; +import { JupyterPaths } from './raw/finder/jupyterPaths'; +import { LocalKernelFinder } from './raw/finder/localKernelFinder'; +import { LocalKnownPathKernelSpecFinder } from './raw/finder/localKnownPathKernelSpecFinder'; +import { LocalPythonAndRelatedNonPythonKernelSpecFinder } from './raw/finder/localPythonAndRelatedNonPythonKernelSpecFinder'; +import { PreferredRemoteKernelIdProvider } from './raw/finder/preferredRemoteKernelIdProvider'; +import { RemoteKernelFinder } from './raw/finder/remoteKernelFinder'; +import { KernelEnvironmentVariablesService } from './raw/launcher/kernelEnvVarsService'; +import { KernelLauncher } from './raw/launcher/kernelLauncher'; +import { HostRawNotebookProvider } from './raw/session/hostRawNotebookProvider'; +import { RawNotebookSupportedService } from './raw/session/rawNotebookSupportedService'; +import { IKernelLauncher, ILocalKernelFinder, IRemoteKernelFinder } from './raw/types'; +import { DebuggerVariableRegistration } from './variables/debuggerVariableRegistration'; +import { DebuggerVariables } from './variables/debuggerVariables'; +import { JupyterVariables } from './variables/jupyterVariables'; +import { KernelVariables } from './variables/kernelVariables'; +import { PreWarmActivatedJupyterEnvironmentVariables } from './variables/preWarmVariables'; +import { PythonVariablesRequester } from './variables/pythonVariableRequester'; + +export function registerTypes(serviceManager: IServiceManager, _isDevMode: boolean) { + serviceManager.addSingleton( + IRawNotebookSupportedService, + RawNotebookSupportedService + ); + const isVSCInsiders = serviceManager.get(IApplicationEnvironment).channel === 'insiders'; + const packageJson: { engines: { vscode: string } } | undefined = vscode.extensions.getExtension(JVSC_EXTENSION_ID) + ?.packageJSON; + const isInsiderVersion = packageJson?.engines?.vscode?.toLowerCase()?.endsWith('insider'); + setSharedProperty('isInsiderExtension', isVSCInsiders && isInsiderVersion ? 'true' : 'false'); + + // This will ensure all subsequent telemetry will get the context of whether it is a custom/native/old notebook editor. + // This is temporary, and once we ship native editor this needs to be removed. + setSharedProperty('ds_notebookeditor', 'native'); + const isLocalConnection = isLocalLaunch(serviceManager.get(IConfigurationService)); + setSharedProperty('localOrRemoteConnection', isLocalConnection ? 'local' : 'remote'); + const isPythonExtensionInstalled = serviceManager.get(IPythonExtensionChecker); + setSharedProperty( + 'isPythonExtensionInstalled', + isPythonExtensionInstalled.isPythonExtensionInstalled ? 'true' : 'false' + ); + const rawService = serviceManager.get(IRawNotebookSupportedService); + setSharedProperty('rawKernelSupported', rawService.isSupported ? 'true' : 'false'); + + serviceManager.addSingleton( + NotebookIPyWidgetCoordinator, + NotebookIPyWidgetCoordinator + ); + serviceManager.add(IJupyterCommandFactory, JupyterCommandFactory); + serviceManager.add(INotebookExporter, JupyterExporter); + serviceManager.add(INotebookImporter, JupyterImporter); + serviceManager.add(INotebookServer, HostJupyterServer); + serviceManager.addSingleton( + PreferredRemoteKernelIdProvider, + PreferredRemoteKernelIdProvider + ); + serviceManager.addSingleton(IRawNotebookProvider, HostRawNotebookProvider); + serviceManager.addSingleton(IJupyterNotebookProvider, JupyterNotebookProvider); + serviceManager.addSingleton(IKernelLauncher, KernelLauncher); + serviceManager.addSingleton( + KernelEnvironmentVariablesService, + KernelEnvironmentVariablesService + ); + serviceManager.addSingleton(ILocalKernelFinder, LocalKernelFinder); + serviceManager.addSingleton(JupyterPaths, JupyterPaths); + serviceManager.addSingleton( + LocalKnownPathKernelSpecFinder, + LocalKnownPathKernelSpecFinder + ); + serviceManager.addSingleton( + LocalPythonAndRelatedNonPythonKernelSpecFinder, + LocalPythonAndRelatedNonPythonKernelSpecFinder + ); + serviceManager.addSingleton(IRemoteKernelFinder, RemoteKernelFinder); + serviceManager.addSingleton( + IExtensionSingleActivationService, + CellOutputMimeTypeTracker + ); + serviceManager.addSingleton( + IExtensionSingleActivationService, + JupyterInterpreterSelectionCommand + ); + serviceManager.addSingleton( + IExtensionSingleActivationService, + PreWarmActivatedJupyterEnvironmentVariables + ); + serviceManager.addSingleton( + IExtensionSingleActivationService, + MigrateJupyterInterpreterStateService + ); + serviceManager.addSingleton(IDataScienceCommandListener, KernelCommandListener); + serviceManager.addSingleton( + IInteractiveWindowDebugger, + InteractiveWindowDebugger, + undefined, + [ICellHashListener] + ); + serviceManager.addSingleton(IJupyterExecution, HostJupyterExecution); + serviceManager.addSingleton(IJupyterPasswordConnect, JupyterPasswordConnect); + serviceManager.addSingleton( + IJupyterSessionManagerFactory, + JupyterSessionManagerFactory + ); + serviceManager.addSingleton( + IExtensionSingleActivationService, + DebuggerVariableRegistration + ); + serviceManager.addSingleton(IJupyterVariables, JupyterVariables, Identifiers.ALL_VARIABLES); + serviceManager.addSingleton(IJupyterVariables, KernelVariables, Identifiers.KERNEL_VARIABLES); + serviceManager.addSingleton( + IJupyterVariables, + DebuggerVariables, + Identifiers.DEBUGGER_VARIABLES + ); + serviceManager.addSingleton( + IKernelVariableRequester, + PythonVariablesRequester, + Identifiers.PYTHON_VARIABLES_REQUESTER + ); + serviceManager.addSingleton(JupyterCommandLineSelector, JupyterCommandLineSelector); + serviceManager.addSingleton( + JupyterCommandLineSelectorCommand, + JupyterCommandLineSelectorCommand + ); + serviceManager.addSingleton( + JupyterInterpreterDependencyService, + JupyterInterpreterDependencyService + ); + serviceManager.addSingleton( + INbConvertInterpreterDependencyChecker, + NbConvertInterpreterDependencyChecker + ); + serviceManager.addSingleton( + INbConvertExportToPythonService, + NbConvertExportToPythonService + ); + serviceManager.addSingleton( + JupyterInterpreterOldCacheStateStore, + JupyterInterpreterOldCacheStateStore + ); + serviceManager.addSingleton(JupyterInterpreterSelector, JupyterInterpreterSelector); + serviceManager.addSingleton(JupyterInterpreterService, JupyterInterpreterService); + serviceManager.addSingleton( + JupyterInterpreterStateStore, + JupyterInterpreterStateStore + ); + serviceManager.addSingleton(JupyterServerSelector, JupyterServerSelector); + serviceManager.addSingleton( + JupyterServerSelectorCommand, + JupyterServerSelectorCommand + ); + serviceManager.addSingleton(JupyterKernelService, JupyterKernelService); + serviceManager.addSingleton(IJupyterServerProvider, NotebookServerProvider); + serviceManager.addSingleton( + IPyWidgetMessageDispatcherFactory, + IPyWidgetMessageDispatcherFactory + ); + serviceManager.addSingleton( + IJupyterInterpreterDependencyManager, + JupyterInterpreterSubCommandExecutionService + ); + serviceManager.addSingleton( + IJupyterSubCommandExecutionService, + JupyterInterpreterSubCommandExecutionService + ); + serviceManager.addSingleton(IKernelDependencyService, KernelDependencyService); + serviceManager.add(IProtocolParser, ProtocolParser); + serviceManager.addSingleton( + IJupyterDebugService, + MultiplexingDebugService, + Identifiers.MULTIPLEXING_DEBUGSERVICE + ); + serviceManager.addSingleton( + IJupyterDebugService, + JupyterDebugService, + Identifiers.RUN_BY_LINE_DEBUGSERVICE + ); + serviceManager.add(IJupyterVariableDataProvider, JupyterVariableDataProvider); + serviceManager.addSingleton( + IJupyterVariableDataProviderFactory, + JupyterVariableDataProviderFactory + ); + serviceManager.addSingleton( + IJupyterUriProviderRegistration, + JupyterUriProviderRegistration + ); + serviceManager.addSingleton(IJupyterServerUriStorage, JupyterServerUriStorage); + serviceManager.addSingleton(NotebookStarter, NotebookStarter); + serviceManager.addSingleton(INotebookProvider, NotebookProvider); + serviceManager.addSingleton(IExtensionSingleActivationService, ServerPreload); + + // Subdirectories + registerInstallerTypes(serviceManager); +} diff --git a/src/kernels/types.ts b/src/kernels/types.ts index 331fe3880ee..661e6ecf37c 100644 --- a/src/kernels/types.ts +++ b/src/kernels/types.ts @@ -15,9 +15,9 @@ import { IJupyterSession, INotebookProviderConnection, KernelSocketInformation -} from '../client/datascience/types'; -import { PythonEnvironment } from '../client/pythonEnvironments/info'; -import { IAsyncDisposable, Resource } from '../client/common/types'; +} from '../platform/datascience/types'; +import { PythonEnvironment } from '../platform/pythonEnvironments/info'; +import { IAsyncDisposable, Resource } from '../platform/common/types'; export type LiveKernelModel = IJupyterKernel & Partial & { model: Session.IModel | undefined; notebook?: { path?: string } }; diff --git a/src/kernels/variables/debuggerVariableRegistration.ts b/src/kernels/variables/debuggerVariableRegistration.ts index 14986e8527d..c4af65bb130 100644 --- a/src/kernels/variables/debuggerVariableRegistration.ts +++ b/src/kernels/variables/debuggerVariableRegistration.ts @@ -3,12 +3,12 @@ 'use strict'; import { inject, injectable, named } from 'inversify'; import { DebugAdapterTracker, DebugAdapterTrackerFactory, DebugSession, ProviderResult } from 'vscode'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; -import { IDebugService } from '../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../client/common/constants'; -import { IDisposableRegistry } from '../../client/common/types'; -import { IJupyterDebugService, IJupyterVariables } from '../../client/datascience/types'; -import { pythonKernelDebugAdapter } from '../../client/debugger/constants'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; +import { IDebugService } from '../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../platform/common/constants'; +import { IDisposableRegistry } from '../../platform/common/types'; +import { IJupyterDebugService, IJupyterVariables } from '../../platform/datascience/types'; +import { pythonKernelDebugAdapter } from '../../platform/debugger/constants'; import { Identifiers } from '../../datascience-ui/common/constants'; @injectable() diff --git a/src/kernels/variables/debuggerVariables.ts b/src/kernels/variables/debuggerVariables.ts index 7f5f57a28cc..d6f49d33aef 100644 --- a/src/kernels/variables/debuggerVariables.ts +++ b/src/kernels/variables/debuggerVariables.ts @@ -6,20 +6,20 @@ import * as path from 'path'; import { DebugAdapterTracker, Disposable, Event, EventEmitter } from 'vscode'; import { DebugProtocol } from 'vscode-debugprotocol'; -import { IDebugService, IVSCodeNotebook } from '../../client/common/application/types'; -import { traceError } from '../../client/common/logger'; -import { IConfigurationService, Resource } from '../../client/common/types'; -import { DataFrameLoading, GetVariableInfo } from '../../client/datascience/constants'; -import { DebugLocationTracker } from '../../client/datascience/debugLocationTracker'; +import { IDebugService, IVSCodeNotebook } from '../../platform/common/application/types'; +import { traceError } from '../../platform/common/logger'; +import { IConfigurationService, Resource } from '../../platform/common/types'; +import { DataFrameLoading, GetVariableInfo } from '../../platform/datascience/constants'; +import { DebugLocationTracker } from '../../platform/datascience/debugLocationTracker'; import { IConditionalJupyterVariables, IJupyterVariable, IJupyterDebugService, IJupyterVariablesRequest, IJupyterVariablesResponse -} from '../../client/datascience/types'; -import { IDebuggingManager, KernelDebugMode } from '../../client/debugger/types'; -import { sendTelemetryEvent } from '../../client/telemetry'; +} from '../../platform/datascience/types'; +import { IDebuggingManager, KernelDebugMode } from '../../platform/debugger/types'; +import { sendTelemetryEvent } from '../../telemetry'; import { Identifiers, Telemetry } from '../../datascience-ui/common/constants'; import { IKernel } from '../types'; import { parseDataFrame } from './pythonVariableRequester'; diff --git a/src/kernels/variables/jupyterVariables.ts b/src/kernels/variables/jupyterVariables.ts index d2bec658ba5..8e3a04f1997 100644 --- a/src/kernels/variables/jupyterVariables.ts +++ b/src/kernels/variables/jupyterVariables.ts @@ -4,15 +4,15 @@ import { inject, injectable, named } from 'inversify'; import { CancellationToken, Event, EventEmitter } from 'vscode'; -import { IDisposableRegistry } from '../../client/common/types'; +import { IDisposableRegistry } from '../../platform/common/types'; import { IJupyterVariables, IConditionalJupyterVariables, IJupyterVariablesRequest, IJupyterVariablesResponse, IJupyterVariable -} from '../../client/datascience/types'; -import { captureTelemetry } from '../../client/telemetry'; +} from '../../platform/datascience/types'; +import { captureTelemetry } from '../../telemetry'; import { Identifiers, Telemetry } from '../../datascience-ui/common/constants'; import { IKernel } from '../types'; diff --git a/src/kernels/variables/kernelVariables.ts b/src/kernels/variables/kernelVariables.ts index 96d5f59b306..24b73e2787e 100644 --- a/src/kernels/variables/kernelVariables.ts +++ b/src/kernels/variables/kernelVariables.ts @@ -4,10 +4,10 @@ import type { JSONObject } from '@lumino/coreutils'; import { inject, injectable, named } from 'inversify'; import { CancellationError, CancellationToken, Event, EventEmitter, NotebookDocument } from 'vscode'; -import { PYTHON_LANGUAGE } from '../../client/common/constants'; -import { Experiments } from '../../client/common/experiments/groups'; -import { IConfigurationService, IExperimentService, IDisposableRegistry } from '../../client/common/types'; -import { createDeferred } from '../../client/common/utils/async'; +import { PYTHON_LANGUAGE } from '../../platform/common/constants'; +import { Experiments } from '../../platform/common/experiments/groups'; +import { IConfigurationService, IExperimentService, IDisposableRegistry } from '../../platform/common/types'; +import { createDeferred } from '../../platform/common/utils/async'; import { IJupyterVariable, IJupyterVariables, @@ -15,7 +15,7 @@ import { IJupyterVariablesRequest, IJupyterVariablesResponse, IJupyterSession -} from '../../client/datascience/types'; +} from '../../platform/datascience/types'; import { Identifiers } from '../../datascience-ui/common/constants'; import { getKernelConnectionLanguage, isPythonKernelConnection } from '../helpers'; import { IKernel } from '../types'; diff --git a/src/kernels/variables/preWarmVariables.ts b/src/kernels/variables/preWarmVariables.ts index 3d0040ece86..94931de1e29 100644 --- a/src/kernels/variables/preWarmVariables.ts +++ b/src/kernels/variables/preWarmVariables.ts @@ -4,15 +4,15 @@ 'use strict'; import { inject, injectable } from 'inversify'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; -import { IPythonExtensionChecker, IPythonApiProvider } from '../../client/api/types'; -import { IWorkspaceService } from '../../client/common/application/types'; -import { CondaService } from '../../client/common/process/condaService'; -import { IDisposableRegistry } from '../../client/common/types'; -import { noop } from '../../client/common/utils/misc'; -import { IEnvironmentVariablesProvider } from '../../client/common/variables/types'; -import { IRawNotebookSupportedService } from '../../client/datascience/types'; -import { IEnvironmentActivationService } from '../../client/interpreter/activation/types'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; +import { IPythonExtensionChecker, IPythonApiProvider } from '../../platform/api/types'; +import { IWorkspaceService } from '../../platform/common/application/types'; +import { CondaService } from '../../platform/common/process/condaService'; +import { IDisposableRegistry } from '../../platform/common/types'; +import { noop } from '../../platform/common/utils/misc'; +import { IEnvironmentVariablesProvider } from '../../platform/common/variables/types'; +import { IRawNotebookSupportedService } from '../../platform/datascience/types'; +import { IEnvironmentActivationService } from '../../platform/interpreter/activation/types'; import { JupyterInterpreterService } from '../jupyter/interpreter/jupyterInterpreterService'; @injectable() diff --git a/src/kernels/variables/pythonVariableRequester.ts b/src/kernels/variables/pythonVariableRequester.ts index 8807d8d6951..5bc6465e003 100644 --- a/src/kernels/variables/pythonVariableRequester.ts +++ b/src/kernels/variables/pythonVariableRequester.ts @@ -3,13 +3,13 @@ import type * as nbformat from '@jupyterlab/nbformat'; import { inject, injectable } from 'inversify'; import * as path from 'path'; import { CancellationToken, NotebookDocument } from 'vscode'; -import { traceError } from '../../client/common/logger'; -import { IFileSystem } from '../../client/common/platform/types'; -import { DataScience } from '../../client/common/utils/localize'; -import { stripAnsi } from '../../client/common/utils/regexp'; -import { DataFrameLoading, GetVariableInfo } from '../../client/datascience/constants'; -import { JupyterDataRateLimitError } from '../../extension/errors/jupyterDataRateLimitError'; -import { IKernelVariableRequester, IJupyterVariable } from '../../client/datascience/types'; +import { traceError } from '../../platform/common/logger'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { DataScience } from '../../platform/common/utils/localize'; +import { stripAnsi } from '../../platform/common/utils/regexp'; +import { DataFrameLoading, GetVariableInfo } from '../../platform/datascience/constants'; +import { JupyterDataRateLimitError } from '../../platform/errors/jupyterDataRateLimitError'; +import { IKernelVariableRequester, IJupyterVariable } from '../../platform/datascience/types'; import { Telemetry } from '../../datascience-ui/common/constants'; import { executeSilently } from '../helpers'; import { IKernel } from '../types'; diff --git a/src/kernels/variables/variableScriptLoader.ts b/src/kernels/variables/variableScriptLoader.ts index 4ba87fcae51..ce0637881e1 100644 --- a/src/kernels/variables/variableScriptLoader.ts +++ b/src/kernels/variables/variableScriptLoader.ts @@ -2,9 +2,9 @@ // Licensed under the MIT License. 'use strict'; import * as path from 'path'; -import { IFileSystem } from '../../client/common/platform/types'; -import { EXTENSION_ROOT_DIR } from '../../client/constants'; -import { IJupyterVariable } from '../../client/datascience/types'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { EXTENSION_ROOT_DIR } from '../../platform/constants'; +import { IJupyterVariable } from '../../platform/datascience/types'; export class VariableScriptLoader { private fetchVariableShapeScript?: string; diff --git a/src/notebooks/controllers/kernelFilter/kernelFilterService.ts b/src/notebooks/controllers/kernelFilter/kernelFilterService.ts index 9385cac9b39..a8c3c349896 100644 --- a/src/notebooks/controllers/kernelFilter/kernelFilterService.ts +++ b/src/notebooks/controllers/kernelFilter/kernelFilterService.ts @@ -2,10 +2,10 @@ import { inject, injectable } from 'inversify'; import { ConfigurationTarget, EventEmitter } from 'vscode'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { traceVerbose } from '../../../client/common/logger'; -import { IConfigurationService, IDisposable, IDisposableRegistry, IPathUtils } from '../../../client/common/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { traceVerbose } from '../../../platform/common/logger'; +import { IConfigurationService, IDisposable, IDisposableRegistry, IPathUtils } from '../../../platform/common/types'; import { KernelConnectionMetadata } from '../../../kernels/types'; @injectable() diff --git a/src/notebooks/controllers/kernelFilter/kernelFilterUI.ts b/src/notebooks/controllers/kernelFilter/kernelFilterUI.ts index 91ea365f8c7..71f1cae8992 100644 --- a/src/notebooks/controllers/kernelFilter/kernelFilterUI.ts +++ b/src/notebooks/controllers/kernelFilter/kernelFilterUI.ts @@ -2,12 +2,12 @@ import { inject, injectable } from 'inversify'; import { QuickPickItem } from 'vscode'; -import { IExtensionSyncActivationService } from '../../../client/activation/types'; -import { ICommandManager, IApplicationShell, IWorkspaceService } from '../../../client/common/application/types'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { IDisposable, IDisposableRegistry, IPathUtils } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { noop } from '../../../client/common/utils/misc'; +import { IExtensionSyncActivationService } from '../../../platform/activation/types'; +import { ICommandManager, IApplicationShell, IWorkspaceService } from '../../../platform/common/application/types'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { IDisposable, IDisposableRegistry, IPathUtils } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { noop } from '../../../platform/common/utils/misc'; import { getDisplayNameOrNameOfKernelConnection, getKernelConnectionPath, diff --git a/src/notebooks/controllers/kernelSelector.ts b/src/notebooks/controllers/kernelSelector.ts index 286d03edd8f..76cf8ab130c 100644 --- a/src/notebooks/controllers/kernelSelector.ts +++ b/src/notebooks/controllers/kernelSelector.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { IVSCodeNotebook, ICommandManager } from '../../client/common/application/types'; -import { JVSC_EXTENSION_ID } from '../../client/common/constants'; -import { traceError } from '../../client/common/logger'; -import { Resource } from '../../client/common/types'; -import { getResourceType } from '../../client/datascience/common'; +import { IVSCodeNotebook, ICommandManager } from '../../platform/common/application/types'; +import { JVSC_EXTENSION_ID } from '../../platform/common/constants'; +import { traceError } from '../../platform/common/logger'; +import { Resource } from '../../platform/common/types'; +import { getResourceType } from '../../platform/datascience/common'; import { getActiveInteractiveWindow } from '../../interactive-window/helpers'; -import { IInteractiveWindowProvider } from '../../client/datascience/types'; +import { IInteractiveWindowProvider } from '../../platform/datascience/types'; import { KernelConnectionMetadata } from '../../kernels/types'; // TODO: This should probably move to a 'notebook' subsection diff --git a/src/notebooks/controllers/liveKernelSwitcher.ts b/src/notebooks/controllers/liveKernelSwitcher.ts index 00ae8ef0b3a..39b05d07d01 100644 --- a/src/notebooks/controllers/liveKernelSwitcher.ts +++ b/src/notebooks/controllers/liveKernelSwitcher.ts @@ -3,10 +3,10 @@ 'use strict'; import { inject, injectable, named } from 'inversify'; import { Memento, NotebookDocument, Uri } from 'vscode'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; -import { IVSCodeNotebook, ICommandManager } from '../../client/common/application/types'; -import { traceError } from '../../client/common/logger'; -import { IDisposableRegistry, IMemento, WORKSPACE_MEMENTO } from '../../client/common/types'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; +import { IVSCodeNotebook, ICommandManager } from '../../platform/common/application/types'; +import { traceError } from '../../platform/common/logger'; +import { IDisposableRegistry, IMemento, WORKSPACE_MEMENTO } from '../../platform/common/types'; import { IKernelProvider, LiveKernelConnectionMetadata } from '../../kernels/types'; import { INotebookControllerManager } from '../types'; import { switchKernel } from './kernelSelector'; diff --git a/src/notebooks/controllers/noPythonKernelsNotebookController.ts b/src/notebooks/controllers/noPythonKernelsNotebookController.ts index f47b0732924..04f64be4d77 100644 --- a/src/notebooks/controllers/noPythonKernelsNotebookController.ts +++ b/src/notebooks/controllers/noPythonKernelsNotebookController.ts @@ -2,13 +2,13 @@ // Licensed under the MIT License. import { Disposable, NotebookCell, NotebookController, NotebookControllerAffinity, NotebookDocument } from 'vscode'; -import { IPythonExtensionChecker } from '../../client/api/types'; -import { IVSCodeNotebook, ICommandManager, IApplicationShell } from '../../client/common/application/types'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { DataScience, Common } from '../../client/common/utils/localize'; -import { noop } from '../../client/common/utils/misc'; -import { sendTelemetryEvent } from '../../client/telemetry'; +import { IPythonExtensionChecker } from '../../platform/api/types'; +import { IVSCodeNotebook, ICommandManager, IApplicationShell } from '../../platform/common/application/types'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { DataScience, Common } from '../../platform/common/utils/localize'; +import { noop } from '../../platform/common/utils/misc'; +import { sendTelemetryEvent } from '../../telemetry'; import { LanguagesSupportedByPythonkernel, Telemetry, PythonExtension } from '../../datascience-ui/common/constants'; import { getNotebookMetadata, isPythonNotebook } from '../helpers'; diff --git a/src/notebooks/controllers/notebookControllerManager.ts b/src/notebooks/controllers/notebookControllerManager.ts index e6c7f3e59ce..8cde5d0ebd2 100644 --- a/src/notebooks/controllers/notebookControllerManager.ts +++ b/src/notebooks/controllers/notebookControllerManager.ts @@ -4,19 +4,19 @@ import { inject, injectable } from 'inversify'; import { CancellationToken, NotebookControllerAffinity, Uri } from 'vscode'; import { CancellationTokenSource, EventEmitter, NotebookDocument } from 'vscode'; -import { IExtensionSyncActivationService } from '../../client/activation/types'; -import { IPythonExtensionChecker, IPythonApiProvider } from '../../client/api/types'; +import { IExtensionSyncActivationService } from '../../platform/activation/types'; +import { IPythonExtensionChecker, IPythonApiProvider } from '../../platform/api/types'; import { IVSCodeNotebook, ICommandManager, IWorkspaceService, IDocumentManager, IApplicationShell -} from '../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../client/common/constants'; -import { traceInfoIfCI, traceError, traceWarning, traceInfo } from '../../client/common/logger'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; -import { CondaService } from '../../client/common/process/condaService'; +} from '../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../platform/common/constants'; +import { traceInfoIfCI, traceError, traceWarning, traceInfo } from '../../platform/common/logger'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; +import { CondaService } from '../../platform/common/process/condaService'; import { IDisposableRegistry, IExtensions, @@ -25,21 +25,21 @@ import { IPathUtils, IBrowserService, Resource -} from '../../client/common/types'; -import { waitForCondition } from '../../client/common/utils/async'; -import { debounceAsync } from '../../client/common/utils/decorators'; -import { DataScience } from '../../client/common/utils/localize'; -import { noop } from '../../client/common/utils/misc'; -import { StopWatch } from '../../client/common/utils/stopWatch'; -import { DisplayOptions } from '../../client/datascience/displayOptions'; -import { sendKernelListTelemetry } from '../../client/datascience/telemetry/kernelTelemetry'; -import { trackKernelResourceInformation } from '../../client/datascience/telemetry/telemetry'; -import { INotebookProvider, IJupyterServerUriStorage } from '../../client/datascience/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { IServiceContainer } from '../../client/ioc/types'; -import { traceDecorators } from '../../client/logging'; -import { EnvironmentType, PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../client/telemetry'; +} from '../../platform/common/types'; +import { waitForCondition } from '../../platform/common/utils/async'; +import { debounceAsync } from '../../platform/common/utils/decorators'; +import { DataScience } from '../../platform/common/utils/localize'; +import { noop } from '../../platform/common/utils/misc'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; +import { DisplayOptions } from '../../platform/datascience/displayOptions'; +import { sendKernelListTelemetry } from '../../telemetry/kernelTelemetry'; +import { trackKernelResourceInformation } from '../../telemetry/telemetry'; +import { INotebookProvider, IJupyterServerUriStorage } from '../../platform/datascience/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { IServiceContainer } from '../../platform/ioc/types'; +import { traceDecorators } from '../../platform/logging'; +import { EnvironmentType, PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { sendTelemetryEvent } from '../../telemetry'; import { Telemetry } from '../../datascience-ui/common/constants'; import { NotebookCellLanguageService } from '../../intellisense/cellLanguageService'; import { diff --git a/src/notebooks/controllers/remoteSwitcher.ts b/src/notebooks/controllers/remoteSwitcher.ts index 182b79f6788..6c9627da406 100644 --- a/src/notebooks/controllers/remoteSwitcher.ts +++ b/src/notebooks/controllers/remoteSwitcher.ts @@ -4,17 +4,17 @@ import { inject, injectable } from 'inversify'; import { noop } from 'lodash'; import { StatusBarAlignment, StatusBarItem } from 'vscode'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; import { IDocumentManager, IVSCodeNotebook, ICommandManager, IApplicationShell -} from '../../client/common/application/types'; -import { IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { DataScience } from '../../client/common/utils/localize'; -import { Settings } from '../../client/datascience/constants'; -import { IJupyterServerUriStorage } from '../../client/datascience/types'; +} from '../../platform/common/application/types'; +import { IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { DataScience } from '../../platform/common/utils/localize'; +import { Settings } from '../../platform/datascience/constants'; +import { IJupyterServerUriStorage } from '../../platform/datascience/types'; import { Commands } from '../../datascience-ui/common/constants'; import { JupyterServerSelector } from '../../kernels/jupyter/serverSelector'; import { isJupyterNotebook } from '../helpers'; diff --git a/src/notebooks/controllers/vscodeNotebookController.ts b/src/notebooks/controllers/vscodeNotebookController.ts index 19f8e2eaaa8..eb43a95ab9d 100644 --- a/src/notebooks/controllers/vscodeNotebookController.ts +++ b/src/notebooks/controllers/vscodeNotebookController.ts @@ -19,18 +19,18 @@ import { NotebookRendererScript, Uri } from 'vscode'; -import { IPythonExtensionChecker } from '../../client/api/types'; +import { IPythonExtensionChecker } from '../../platform/api/types'; import { IVSCodeNotebook, ICommandManager, IWorkspaceService, IDocumentManager, IApplicationShell -} from '../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../client/common/constants'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { traceInfoIfCI, traceInfo, traceVerbose, traceWarning } from '../../client/common/logger'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; +} from '../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../platform/common/constants'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { traceInfoIfCI, traceInfo, traceVerbose, traceWarning } from '../../platform/common/logger'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; import { IBrowserService, IConfigurationService, @@ -38,28 +38,26 @@ import { IDisposableRegistry, IExtensionContext, IPathUtils -} from '../../client/common/types'; -import { createDeferred } from '../../client/common/utils/async'; -import { chainable } from '../../client/common/utils/decorators'; -import { DataScience, Common } from '../../client/common/utils/localize'; -import { noop } from '../../client/common/utils/misc'; -import { sendNotebookOrKernelLanguageTelemetry } from '../../client/datascience/common'; -import { DisplayOptions } from '../../client/datascience/displayOptions'; +} from '../../platform/common/types'; +import { createDeferred } from '../../platform/common/utils/async'; +import { chainable } from '../../platform/common/utils/decorators'; +import { DataScience, Common } from '../../platform/common/utils/localize'; +import { noop } from '../../platform/common/utils/misc'; +import { sendNotebookOrKernelLanguageTelemetry } from '../../platform/datascience/common'; import { initializeInteractiveOrNotebookTelemetryBasedOnUserAction, sendKernelTelemetryEvent -} from '../../client/datascience/telemetry/telemetry'; -import { IDataScienceErrorHandler, IDisplayOptions, KernelSocketInformation } from '../../client/datascience/types'; -import { IServiceContainer } from '../../client/ioc/types'; -import { traceDecorators } from '../../client/logging'; -import { TraceOptions } from '../../client/logging/trace'; -import { ConsoleForegroundColors } from '../../client/logging/_global'; -import { EnvironmentType } from '../../client/pythonEnvironments/info'; +} from '../../telemetry/telemetry'; +import { IDataScienceErrorHandler, IDisplayOptions, KernelSocketInformation } from '../../platform/datascience/types'; +import { IServiceContainer } from '../../platform/ioc/types'; +import { traceDecorators } from '../../platform/logging'; +import { TraceOptions } from '../../platform/logging/trace'; +import { ConsoleForegroundColors } from '../../platform/logging/_global'; +import { EnvironmentType } from '../../platform/pythonEnvironments/info'; import { Telemetry, Commands } from '../../datascience-ui/common/constants'; -import { displayErrorsInCell } from '../../extension/errors/errorUtils'; -import { KernelDeadError } from '../../extension/errors/kernelDeadError'; -import { WrappedError } from '../../extension/errors/types'; -import { IPyWidgetMessages } from '../../extension/messageTypes'; +import { displayErrorsInCell } from '../../platform/errors/errorUtils'; +import { WrappedError } from '../../platform/errors/types'; +import { IPyWidgetMessages } from '../../platform/messageTypes'; import { NotebookCellLanguageService } from '../../intellisense/cellLanguageService'; import { getKernelConnectionPath, @@ -84,6 +82,8 @@ import { import { InteractiveWindowView } from '../constants'; import { CellExecutionCreator } from '../execution/cellExecutionCreator'; import { isJupyterNotebook, traceCellMessage, updateNotebookDocumentMetadata } from '../helpers'; +import { DisplayOptions } from '../../platform/datascience/displayOptions'; +import { KernelDeadError } from '../../platform/errors/kernelDeadError'; export class VSCodeNotebookController implements Disposable { private readonly _onNotebookControllerSelected: EventEmitter<{ diff --git a/src/notebooks/execution/cellDisplayIdTracker.ts b/src/notebooks/execution/cellDisplayIdTracker.ts index 2cb04545ae8..029e53127af 100644 --- a/src/notebooks/execution/cellDisplayIdTracker.ts +++ b/src/notebooks/execution/cellDisplayIdTracker.ts @@ -3,7 +3,7 @@ import { injectable, inject } from 'inversify'; import { NotebookCell, NotebookCellOutput, NotebookDocument } from 'vscode'; -import { IVSCodeNotebook } from '../../client/common/application/types'; +import { IVSCodeNotebook } from '../../platform/common/application/types'; import { isJupyterNotebook } from '../../notebooks/helpers'; @injectable() diff --git a/src/notebooks/execution/cellExecution.ts b/src/notebooks/execution/cellExecution.ts index ed7735d3439..2d22c7f726f 100644 --- a/src/notebooks/execution/cellExecution.ts +++ b/src/notebooks/execution/cellExecution.ts @@ -29,16 +29,16 @@ import { import { Kernel } from '@jupyterlab/services'; import { CellOutputDisplayIdTracker } from './cellDisplayIdTracker'; import { CellExecutionCreator } from './cellExecutionCreator'; -import { IApplicationShell } from '../../client/common/application/types'; -import { analyzeKernelErrors } from '../../client/../extension/errors/errorUtils'; -import { BaseError } from '../../client/../extension/errors/types'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { traceError, traceInfoIfCI, traceWarning } from '../../client/common/logger'; -import { RefBool } from '../../client/common/refBool'; -import { IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { Deferred, createDeferred } from '../../client/common/utils/async'; -import * as localize from '../../client/common/utils/localize'; -import { StopWatch } from '../../client/common/utils/stopWatch'; +import { IApplicationShell } from '../../platform/common/application/types'; +import { analyzeKernelErrors } from '../../platform/errors/errorUtils'; +import { BaseError } from '../../platform/errors/types'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { traceError, traceInfoIfCI, traceWarning } from '../../platform/common/logger'; +import { RefBool } from '../../platform/common/refBool'; +import { IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { Deferred, createDeferred } from '../../platform/common/utils/async'; +import * as localize from '../../platform/common/utils/localize'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; import { CellHashProviderFactory } from '../../interactive-window/editor-integration/cellHashProviderFactory'; import { InteractiveWindowView } from '../../notebooks/constants'; import { @@ -48,13 +48,13 @@ import { cellOutputToVSCCellOutput, translateCellDisplayOutput } from '../../notebooks/helpers'; -import { ICellHashProvider, IJupyterSession, ICellHash } from '../../client/datascience/types'; -import { sendTelemetryEvent } from '../../client/telemetry'; +import { ICellHashProvider, IJupyterSession, ICellHash } from '../../platform/datascience/types'; +import { sendTelemetryEvent } from '../../telemetry'; import { formatStreamText, concatMultilineString } from '../../datascience-ui/common'; import { createErrorOutput, createErrorOutputFromFailureInfo } from '../../datascience-ui/common/cellFactory'; import { Telemetry } from '../../datascience-ui/common/constants'; -import { swallowExceptions } from '../../client/common/utils/decorators'; -import { noop } from '../../client/common/utils/misc'; +import { swallowExceptions } from '../../platform/common/utils/decorators'; +import { noop } from '../../platform/common/utils/misc'; import { getDisplayNameOrNameOfKernelConnection, isPythonKernelConnection } from '../../kernels/helpers'; import { IKernel, KernelConnectionMetadata, NotebookCellRunState } from '../../kernels/types'; import { handleTensorBoardDisplayDataOutput } from './executionHelpers'; diff --git a/src/notebooks/execution/cellExecutionQueue.ts b/src/notebooks/execution/cellExecutionQueue.ts index 57d5189b3a4..f8a7ca6ec25 100644 --- a/src/notebooks/execution/cellExecutionQueue.ts +++ b/src/notebooks/execution/cellExecutionQueue.ts @@ -2,10 +2,10 @@ // Licensed under the MIT License. import { Disposable, EventEmitter, NotebookCell } from 'vscode'; -import { traceInfo, traceError } from '../../client/common/logger'; -import { noop } from '../../client/common/utils/misc'; +import { traceInfo, traceError } from '../../platform/common/logger'; +import { noop } from '../../platform/common/utils/misc'; import { traceCellMessage } from '../../notebooks/helpers'; -import { IJupyterSession } from '../../client/datascience/types'; +import { IJupyterSession } from '../../platform/datascience/types'; import { CellExecution, CellExecutionFactory } from './cellExecution'; import { KernelConnectionMetadata, NotebookCellRunState } from '../../kernels/types'; diff --git a/src/notebooks/execution/kernelExecution.ts b/src/notebooks/execution/kernelExecution.ts index 0aff62ec6d2..e8c82b0527f 100644 --- a/src/notebooks/execution/kernelExecution.ts +++ b/src/notebooks/execution/kernelExecution.ts @@ -7,20 +7,20 @@ import { EventEmitter, NotebookCell, NotebookCellKind, NotebookController, Noteb import { CellExecutionFactory } from './cellExecution'; import { CellExecutionQueue } from './cellExecutionQueue'; import { KernelMessage } from '@jupyterlab/services'; -import { IApplicationShell } from '../../client/common/application/types'; -import { traceInfo, traceInfoIfCI, traceWarning } from '../../client/common/logger'; -import { IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { createDeferred, waitForPromise } from '../../client/common/utils/async'; -import { StopWatch } from '../../client/common/utils/stopWatch'; +import { IApplicationShell } from '../../platform/common/application/types'; +import { traceInfo, traceInfoIfCI, traceWarning } from '../../platform/common/logger'; +import { IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { createDeferred, waitForPromise } from '../../platform/common/utils/async'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; import { CellHashProviderFactory } from '../../interactive-window/editor-integration/cellHashProviderFactory'; -import { trackKernelResourceInformation, sendKernelTelemetryEvent } from '../../client/datascience/telemetry/telemetry'; -import { InterruptResult, IJupyterSession } from '../../client/datascience/types'; -import { captureTelemetry } from '../../client/telemetry'; +import { trackKernelResourceInformation, sendKernelTelemetryEvent } from '../../telemetry/telemetry'; +import { InterruptResult, IJupyterSession } from '../../platform/datascience/types'; +import { captureTelemetry } from '../../telemetry'; import { Telemetry } from '../../datascience-ui/common/constants'; import { CellOutputDisplayIdTracker } from './cellDisplayIdTracker'; import { IKernel, KernelConnectionMetadata, NotebookCellRunState } from '../../kernels/types'; import { traceCellMessage } from '../helpers'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; /** * Separate class that deals just with kernel execution. diff --git a/src/notebooks/execution/notebookUpdater.ts b/src/notebooks/execution/notebookUpdater.ts index bac91d2f304..520621153e5 100644 --- a/src/notebooks/execution/notebookUpdater.ts +++ b/src/notebooks/execution/notebookUpdater.ts @@ -4,7 +4,7 @@ import { noop } from 'lodash'; import { isPromise } from 'rxjs/internal-compatibility'; import { NotebookDocument, NotebookEditor, workspace, WorkspaceEdit, window } from 'vscode'; -import { createDeferred } from '../../client/common/utils/async'; +import { createDeferred } from '../../platform/common/utils/async'; /** * Use this class to perform updates on all cells. diff --git a/src/notebooks/helpers.ts b/src/notebooks/helpers.ts index 08d54ca8a89..be15ab1b2ba 100644 --- a/src/notebooks/helpers.ts +++ b/src/notebooks/helpers.ts @@ -25,15 +25,15 @@ import { KernelMessage } from '@jupyterlab/services'; import cloneDeep = require('lodash/cloneDeep'); import fastDeepEqual = require('fast-deep-equal'); import * as path from 'path'; -import { IVSCodeNotebook, IDocumentManager } from '../client/common/application/types'; -import { PYTHON_LANGUAGE, MARKDOWN_LANGUAGE } from '../client/common/constants'; -import { traceInfoIfCI, traceError, traceWarning } from '../client/common/logger'; -import { arePathsSame } from '../client/common/platform/fileUtils'; -import { IFileSystem } from '../client/common/platform/types'; -import { Resource } from '../client/common/types'; -import { IInteractiveWindowProvider, IJupyterKernelSpec } from '../client/datascience/types'; -import { getInterpreterHash } from '../client/pythonEnvironments/info/interpreter'; -import { sendTelemetryEvent } from '../client/telemetry'; +import { IVSCodeNotebook, IDocumentManager } from '../platform/common/application/types'; +import { PYTHON_LANGUAGE, MARKDOWN_LANGUAGE } from '../platform/common/constants'; +import { traceInfoIfCI, traceError, traceWarning } from '../platform/common/logger'; +import { arePathsSame } from '../platform/common/platform/fileUtils'; +import { IFileSystem } from '../platform/common/platform/types'; +import { Resource } from '../platform/common/types'; +import { IInteractiveWindowProvider, IJupyterKernelSpec } from '../platform/datascience/types'; +import { getInterpreterHash } from '../platform/pythonEnvironments/info/interpreter'; +import { sendTelemetryEvent } from '../telemetry'; import { splitMultilineString, concatMultilineString } from '../datascience-ui/common'; import { Telemetry } from '../datascience-ui/common/constants'; import { diff --git a/src/notebooks/notebookCommandListener.ts b/src/notebooks/notebookCommandListener.ts index 605e83fed51..c60da22f276 100644 --- a/src/notebooks/notebookCommandListener.ts +++ b/src/notebooks/notebookCommandListener.ts @@ -1,18 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import '../client/common/extensions'; +import '../platform/common/extensions'; import { inject, injectable } from 'inversify'; import { NotebookCellData, NotebookCellKind, NotebookRange } from 'vscode'; -import { IVSCodeNotebook, ICommandManager } from '../client/common/application/types'; -import { IDisposableRegistry } from '../client/common/types'; -import { IDataScienceCommandListener } from '../client/datascience/types'; +import { IVSCodeNotebook, ICommandManager } from '../platform/common/application/types'; +import { IDisposableRegistry } from '../platform/common/types'; +import { IDataScienceCommandListener } from '../platform/datascience/types'; import { Commands } from '../datascience-ui/common/constants'; import { chainWithPendingUpdates } from './execution/notebookUpdater'; import { getNotebookMetadata } from './helpers'; -import { noop } from '../client/common/utils/misc'; +import { noop } from '../platform/common/utils/misc'; import { NotebookCellLanguageService } from '../intellisense/cellLanguageService'; @injectable() diff --git a/src/notebooks/notebookEditorProvider.ts b/src/notebooks/notebookEditorProvider.ts index d04125834a9..6ed0fbbf090 100644 --- a/src/notebooks/notebookEditorProvider.ts +++ b/src/notebooks/notebookEditorProvider.ts @@ -5,11 +5,11 @@ import { inject, injectable } from 'inversify'; import { Uri, NotebookData, NotebookCellData, NotebookCellKind } from 'vscode'; -import { IVSCodeNotebook } from '../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../client/common/constants'; -import '../client/common/extensions'; -import { INotebookEditorProvider } from '../client/datascience/types'; -import { captureTelemetry } from '../client/telemetry'; +import { IVSCodeNotebook } from '../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../platform/common/constants'; +import '../platform/common/extensions'; +import { INotebookEditorProvider } from '../platform/datascience/types'; +import { captureTelemetry } from '../telemetry'; import { Telemetry, defaultNotebookFormat } from '../datascience-ui/common/constants'; import { JupyterNotebookView } from './constants'; diff --git a/src/notebooks/notebookUsageTracker.ts b/src/notebooks/notebookUsageTracker.ts index 11435c34e0a..3a24e01b40a 100644 --- a/src/notebooks/notebookUsageTracker.ts +++ b/src/notebooks/notebookUsageTracker.ts @@ -3,10 +3,10 @@ import { inject, injectable } from 'inversify'; import { notebooks, NotebookCellExecutionStateChangeEvent, NotebookDocument, NotebookCellExecutionState } from 'vscode'; -import { IExtensionSingleActivationService } from '../client/activation/types'; -import { IVSCodeNotebook } from '../client/common/application/types'; -import { IDisposableRegistry } from '../client/common/types'; -import { sendTelemetryEvent } from '../client/telemetry'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { IVSCodeNotebook } from '../platform/common/application/types'; +import { IDisposableRegistry } from '../platform/common/types'; +import { sendTelemetryEvent } from '../telemetry'; import { Telemetry } from '../datascience-ui/common/constants'; import { isJupyterNotebook } from './helpers'; diff --git a/src/notebooks/outputs/errorRendererComms.ts b/src/notebooks/outputs/errorRendererComms.ts index 3ff0ea62463..e36d8e1a923 100644 --- a/src/notebooks/outputs/errorRendererComms.ts +++ b/src/notebooks/outputs/errorRendererComms.ts @@ -3,17 +3,17 @@ import { inject, injectable } from 'inversify'; import { commands, NotebookRange, notebooks, Position, Range, Selection, TextEditorRevealType, Uri } from 'vscode'; -import { IExtensionSyncActivationService } from '../../client/activation/types'; +import { IExtensionSyncActivationService } from '../../platform/activation/types'; import { IDocumentManager, ICommandManager, IApplicationShell, IVSCodeNotebook -} from '../../client/common/application/types'; -import { arePathsSame } from '../../client/common/platform/fileUtils'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IDisposableRegistry } from '../../client/common/types'; -import { InteractiveWindowMessages } from '../../extension/messageTypes'; +} from '../../platform/common/application/types'; +import { arePathsSame } from '../../platform/common/platform/fileUtils'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IDisposableRegistry } from '../../platform/common/types'; +import { InteractiveWindowMessages } from '../../platform/messageTypes'; import { linkCommandAllowList, LineQueryRegex } from './linkProvider'; @injectable() diff --git a/src/notebooks/outputs/plotSaveHandler.ts b/src/notebooks/outputs/plotSaveHandler.ts index 1a9ecd9511f..89d2381dfd0 100644 --- a/src/notebooks/outputs/plotSaveHandler.ts +++ b/src/notebooks/outputs/plotSaveHandler.ts @@ -1,12 +1,12 @@ import { inject, injectable } from 'inversify'; import { NotebookCellOutput, NotebookDocument, Uri } from 'vscode'; import * as path from 'path'; -import { IApplicationShell, IWorkspaceService } from '../../client/common/application/types'; -import { traceError } from '../../client/common/logger'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; -import { IFileSystem } from '../../client/common/platform/types'; -import { DataScience } from '../../client/common/utils/localize'; -import { saveSvgToPdf } from '../../client/datascience/plotting/plotViewer'; +import { IApplicationShell, IWorkspaceService } from '../../platform/common/application/types'; +import { traceError } from '../../platform/common/logger'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { DataScience } from '../../platform/common/utils/localize'; +import { saveSvgToPdf } from '../../platform/datascience/plotting/plotViewer'; const svgMimeType = 'image/svg+xml'; const imageExtensionForMimeType: Record = { diff --git a/src/notebooks/outputs/plotViewHandler.ts b/src/notebooks/outputs/plotViewHandler.ts index 7fcae1a9b44..0beaef76e33 100644 --- a/src/notebooks/outputs/plotViewHandler.ts +++ b/src/notebooks/outputs/plotViewHandler.ts @@ -1,9 +1,9 @@ import sizeOf from 'image-size'; import { inject, injectable } from 'inversify'; import { NotebookCellOutputItem, NotebookDocument } from 'vscode'; -import { traceError } from '../../client/common/logger'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; -import { IPlotViewerProvider } from '../../client/datascience/types'; +import { traceError } from '../../platform/common/logger'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; +import { IPlotViewerProvider } from '../../platform/datascience/types'; const svgMimeType = 'image/svg+xml'; const pngMimeType = 'image/png'; diff --git a/src/notebooks/outputs/rendererCommunication.ts b/src/notebooks/outputs/rendererCommunication.ts index 43fc1f454d7..e8f8cdeeb15 100644 --- a/src/notebooks/outputs/rendererCommunication.ts +++ b/src/notebooks/outputs/rendererCommunication.ts @@ -3,10 +3,10 @@ import { inject, injectable } from 'inversify'; import { Event, extensions, NotebookEditor, window } from 'vscode'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { IDisposable } from '../../client/common/types'; -import { noop } from '../../client/common/utils/misc'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { IDisposable } from '../../platform/common/types'; +import { noop } from '../../platform/common/utils/misc'; import { PlotSaveHandler } from './plotSaveHandler'; import { PlotViewHandler } from './plotViewHandler'; diff --git a/src/notebooks/serviceRegistry.ts b/src/notebooks/serviceRegistry.ts index 9cb0c41dbeb..992824880ae 100644 --- a/src/notebooks/serviceRegistry.ts +++ b/src/notebooks/serviceRegistry.ts @@ -3,16 +3,14 @@ 'use strict'; -import { IExtensionSingleActivationService, IExtensionSyncActivationService } from '../client/activation/types'; -import { IDataScienceCommandListener, INotebookEditorProvider } from '../client/datascience/types'; -import { IServiceManager } from '../client/ioc/types'; -import { GitHubIssueCodeLensProvider } from '../client/logging/gitHubIssueCodeLensProvider'; +import { IExtensionSingleActivationService, IExtensionSyncActivationService } from '../platform/activation/types'; +import { IDataScienceCommandListener, INotebookEditorProvider } from '../platform/datascience/types'; +import { IServiceManager } from '../platform/ioc/types'; +import { GitHubIssueCodeLensProvider } from '../platform/logging/gitHubIssueCodeLensProvider'; import { NotebookCellLanguageService } from '../intellisense/cellLanguageService'; import { NotebookCellBangInstallDiagnosticsProvider } from '../intellisense/diagnosticsProvider'; import { EmptyNotebookCellLanguageService } from '../intellisense/emptyNotebookCellLanguageService'; import { IntellisenseProvider } from '../intellisense/intellisenseProvider'; -import { PythonKernelCompletionProvider } from '../intellisense/pythonKernelCompletionProvider'; -import { PythonKernelCompletionProviderRegistration } from '../intellisense/pythonKernelCompletionProviderRegistration'; import { KernelProvider } from '../kernels/kernelProvider'; import { IKernelProvider } from '../kernels/types'; import { KernelFilterService } from './controllers/kernelFilter/kernelFilterService'; @@ -28,6 +26,7 @@ import { PlotSaveHandler } from './outputs/plotSaveHandler'; import { PlotViewHandler } from './outputs/plotViewHandler'; import { RendererCommunication } from './outputs/rendererCommunication'; import { INotebookLanguageClientProvider, INotebookControllerManager } from './types'; +import { NotebookUsageTracker } from './notebookUsageTracker'; export function registerTypes(serviceManager: IServiceManager) { serviceManager.addSingleton(IExtensionSingleActivationService, RemoteSwitcher); @@ -50,14 +49,6 @@ export function registerTypes(serviceManager: IServiceManager) { NotebookCellBangInstallDiagnosticsProvider ); serviceManager.addSingleton(NotebookCellLanguageService, NotebookCellLanguageService); - serviceManager.addSingleton( - PythonKernelCompletionProvider, - PythonKernelCompletionProvider - ); - serviceManager.addSingleton( - IExtensionSingleActivationService, - PythonKernelCompletionProviderRegistration - ); serviceManager.addSingleton(INotebookLanguageClientProvider, IntellisenseProvider); serviceManager.addBinding(INotebookLanguageClientProvider, IExtensionSingleActivationService); serviceManager.addSingleton(INotebookControllerManager, NotebookControllerManager); @@ -81,4 +72,8 @@ export function registerTypes(serviceManager: IServiceManager) { ErrorRendererCommunicationHandler ); serviceManager.addSingleton(INotebookEditorProvider, NotebookEditorProvider); + serviceManager.addSingleton( + IExtensionSingleActivationService, + NotebookUsageTracker + ); } diff --git a/src/notebooks/types.ts b/src/notebooks/types.ts index bea67c2759d..9db2159d703 100644 --- a/src/notebooks/types.ts +++ b/src/notebooks/types.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { Event, NotebookDocument, NotebookEditor, Uri } from 'vscode'; import type * as vsc from 'vscode-languageclient/node'; -import { Resource } from '../client/common/types'; +import { Resource } from '../platform/common/types'; import { KernelConnectionMetadata, LiveKernelConnectionMetadata } from '../kernels/types'; import { InteractiveWindowView, JupyterNotebookView } from './constants'; import { VSCodeNotebookController } from './controllers/vscodeNotebookController'; diff --git a/src/client/.gitignore b/src/platform/.gitignore similarity index 100% rename from src/client/.gitignore rename to src/platform/.gitignore diff --git a/src/client/.vscodeignore b/src/platform/.vscodeignore similarity index 100% rename from src/client/.vscodeignore rename to src/platform/.vscodeignore diff --git a/src/client/activation/activationManager.ts b/src/platform/activation/activationManager.ts similarity index 98% rename from src/client/activation/activationManager.ts rename to src/platform/activation/activationManager.ts index e0ac7b741c0..abb878893c5 100644 --- a/src/client/activation/activationManager.ts +++ b/src/platform/activation/activationManager.ts @@ -13,7 +13,7 @@ import { IFileSystem } from '../common/platform/types'; import { IDisposable, Resource } from '../common/types'; import { Deferred } from '../common/utils/async'; import { IInterpreterService } from '../interpreter/contracts'; -import { sendActivationTelemetry } from '../telemetry/envFileTelemetry'; +import { sendActivationTelemetry } from '../../telemetry/envFileTelemetry'; import { IExtensionActivationManager, IExtensionActivationService, diff --git a/src/client/activation/migrateDataScienceSettingsService.ts b/src/platform/activation/migrateDataScienceSettingsService.ts similarity index 100% rename from src/client/activation/migrateDataScienceSettingsService.ts rename to src/platform/activation/migrateDataScienceSettingsService.ts diff --git a/src/client/activation/serviceRegistry.ts b/src/platform/activation/serviceRegistry.ts similarity index 100% rename from src/client/activation/serviceRegistry.ts rename to src/platform/activation/serviceRegistry.ts diff --git a/src/client/activation/types.ts b/src/platform/activation/types.ts similarity index 100% rename from src/client/activation/types.ts rename to src/platform/activation/types.ts diff --git a/src/client/api.ts b/src/platform/api.ts similarity index 100% rename from src/client/api.ts rename to src/platform/api.ts diff --git a/src/client/api/apiAccessService.ts b/src/platform/api/apiAccessService.ts similarity index 99% rename from src/client/api/apiAccessService.ts rename to src/platform/api/apiAccessService.ts index e80fd743a89..3935d350408 100644 --- a/src/client/api/apiAccessService.ts +++ b/src/platform/api/apiAccessService.ts @@ -9,7 +9,7 @@ import { GLOBAL_MEMENTO, IExtensionContext, IMemento } from '../common/types'; import { PromiseChain } from '../common/utils/async'; import { Common, DataScience } from '../common/utils/localize'; import { Telemetry } from '../datascience/constants'; -import { sendTelemetryEvent } from '../telemetry'; +import { sendTelemetryEvent } from '../../telemetry'; type ApiExtensionInfo = { extensionId: string; diff --git a/src/client/api/extension.d.ts b/src/platform/api/extension.d.ts similarity index 100% rename from src/client/api/extension.d.ts rename to src/platform/api/extension.d.ts diff --git a/src/client/api/kernelApi.ts b/src/platform/api/kernelApi.ts similarity index 99% rename from src/client/api/kernelApi.ts rename to src/platform/api/kernelApi.ts index 8175c6a01fe..f3c43cc29cb 100644 --- a/src/client/api/kernelApi.ts +++ b/src/platform/api/kernelApi.ts @@ -16,7 +16,7 @@ import { IDisposable, IDisposableRegistry, IExtensions } from '../common/types'; import { PromiseChain } from '../common/utils/async'; import { Telemetry } from '../datascience/constants'; import { IKernelSocket as ExtensionKernelSocket } from '../datascience/types'; -import { sendTelemetryEvent } from '../telemetry'; +import { sendTelemetryEvent } from '../../telemetry'; import { ApiAccessService } from './apiAccessService'; import { ActiveKernel, diff --git a/src/client/api/pythonApi.ts b/src/platform/api/pythonApi.ts similarity index 92% rename from src/client/api/pythonApi.ts rename to src/platform/api/pythonApi.ts index 4e9e7dba97b..de21eaef21c 100644 --- a/src/client/api/pythonApi.ts +++ b/src/platform/api/pythonApi.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ // eslint-disable-next-line /* eslint-disable comma-dangle */ // eslint-disable-next-line @@ -27,7 +28,7 @@ import { IInterpreterService } from '../interpreter/contracts'; import { TraceOptions } from '../logging/trace'; import { PythonEnvironment } from '../pythonEnvironments/info'; import { areInterpreterPathsSame } from '../pythonEnvironments/info/interpreter'; -import { captureTelemetry, sendTelemetryEvent } from '../telemetry'; +import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; import { ILanguageServer, ILanguageServerProvider, @@ -35,7 +36,8 @@ import { IPythonDebuggerPathProvider, IPythonExtensionChecker, IPythonProposedApi, - PythonApi + PythonApi, + RefreshInterpretersOptions } from './types'; /* eslint-disable max-classes-per-file */ @@ -89,6 +91,17 @@ export class PythonApiProvider implements IPythonApiProvider { const unifiedApi: PythonApi = {} as any; Object.assign(unifiedApi, pythonProposedApi.environment); Object.assign(unifiedApi, api); + + // Workaround API name changes (only used in test code at the moment) + if (!unifiedApi.refreshInterpreters && (unifiedApi as any).refreshEnvironment) { + unifiedApi.refreshInterpreters = (options: RefreshInterpretersOptions) => { + return (unifiedApi as any).refreshEnvironment(options); + }; + unifiedApi.setActiveInterpreter = (path: string, resource?: Resource) => { + return (unifiedApi as any).setActiveEnvironment(path, resource); + }; + } + this.api.resolve(unifiedApi); // Log experiment status here. Python extension is definitely loaded at this point. @@ -278,9 +291,15 @@ export class InterpreterService implements IInterpreterService { public async refreshInterpreters() { const api = await this.apiProvider.getApi(); try { - const newItems = await api.refreshInterpreters({ clearCache: false }); - this.interpreterListCachePromise = undefined; - traceVerbose(`Refreshed Environments and got ${newItems}`); + if (api.refreshInterpreters) { + const newItems = await api.refreshInterpreters({ clearCache: false }); + this.interpreterListCachePromise = undefined; + traceVerbose(`Refreshed Environments and got ${newItems}`); + } else if ((api as any).refreshEnvironment) { + const newItems = await (api as any).refreshEnvironment({ clearCache: false }); + this.interpreterListCachePromise = undefined; + traceVerbose(`Refreshed Environments and got ${newItems}`); + } } catch (ex) { traceError(`Failed to refresh the list of interpreters`); } diff --git a/src/client/api/serviceRegistry.ts b/src/platform/api/serviceRegistry.ts similarity index 100% rename from src/client/api/serviceRegistry.ts rename to src/platform/api/serviceRegistry.ts diff --git a/src/client/api/types.ts b/src/platform/api/types.ts similarity index 99% rename from src/client/api/types.ts rename to src/platform/api/types.ts index 1b35cd70f84..dc123f5e014 100644 --- a/src/client/api/types.ts +++ b/src/platform/api/types.ts @@ -126,7 +126,7 @@ export type PythonApi = { setActiveInterpreter(interpreterPath: string, resource?: Resource): Promise; }; -type RefreshInterpretersOptions = { +export type RefreshInterpretersOptions = { clearCache?: boolean; }; export type IPythonProposedApi = { diff --git a/src/extension/commands/commandLineSelector.ts b/src/platform/commands/commandLineSelector.ts similarity index 83% rename from src/extension/commands/commandLineSelector.ts rename to src/platform/commands/commandLineSelector.ts index a8bd8adc2a7..509fa06dc0a 100644 --- a/src/extension/commands/commandLineSelector.ts +++ b/src/platform/commands/commandLineSelector.ts @@ -5,9 +5,9 @@ import { inject, injectable } from 'inversify'; import { JupyterCommandLineSelector } from '../../kernels/jupyter/launcher/commandLineSelector'; -import { ICommandManager } from '../../client/common/application/types'; -import { IDisposable } from '../../client/common/types'; -import { Commands } from '../../client/datascience/constants'; +import { ICommandManager } from '../../platform/common/application/types'; +import { IDisposable } from '../../platform/common/types'; +import { Commands } from '../../platform/datascience/constants'; @injectable() export class JupyterCommandLineSelectorCommand implements IDisposable { diff --git a/src/extension/commands/commandRegistry.ts b/src/platform/commands/commandRegistry.ts similarity index 89% rename from src/extension/commands/commandRegistry.ts rename to src/platform/commands/commandRegistry.ts index 4b01cc31281..9ebfb661e5e 100644 --- a/src/extension/commands/commandRegistry.ts +++ b/src/platform/commands/commandRegistry.ts @@ -4,9 +4,9 @@ 'use strict'; import { inject, injectable } from 'inversify'; -import { IWorkspaceService } from '../../client/common/application/types'; +import { IWorkspaceService } from '../../platform/common/application/types'; -import { IDisposable } from '../../client/common/types'; +import { IDisposable } from '../../platform/common/types'; import { JupyterCommandLineSelectorCommand } from './commandLineSelector'; import { JupyterServerSelectorCommand } from './serverSelector'; diff --git a/src/extension/commands/serverSelector.ts b/src/platform/commands/serverSelector.ts similarity index 85% rename from src/extension/commands/serverSelector.ts rename to src/platform/commands/serverSelector.ts index 318c2d1493d..438e34b289d 100644 --- a/src/extension/commands/serverSelector.ts +++ b/src/platform/commands/serverSelector.ts @@ -4,10 +4,10 @@ 'use strict'; import { inject, injectable } from 'inversify'; -import { ICommandManager } from '../../client/common/application/types'; -import { IDisposable } from '../../client/common/types'; -import { Commands } from '../../client/datascience/constants'; -import { traceInfo } from '../../client/common/logger'; +import { ICommandManager } from '../../platform/common/application/types'; +import { IDisposable } from '../../platform/common/types'; +import { Commands } from '../../platform/datascience/constants'; +import { traceInfo } from '../../platform/common/logger'; import { Uri } from 'vscode'; import { JupyterServerSelector } from '../../kernels/jupyter/serverSelector'; diff --git a/src/client/common/amlContext.ts b/src/platform/common/amlContext.ts similarity index 92% rename from src/client/common/amlContext.ts rename to src/platform/common/amlContext.ts index 626b1f5e1c2..fe81c914bcb 100644 --- a/src/client/common/amlContext.ts +++ b/src/platform/common/amlContext.ts @@ -4,7 +4,7 @@ import { injectable } from 'inversify'; import { env } from 'vscode'; import { IExtensionSingleActivationService } from '../activation/types'; -import { setSharedProperty } from '../telemetry'; +import { setSharedProperty } from '../../telemetry'; const amlComputeRemoteName = 'amlext'; diff --git a/src/client/common/application/activeResource.ts b/src/platform/common/application/activeResource.ts similarity index 100% rename from src/client/common/application/activeResource.ts rename to src/platform/common/application/activeResource.ts diff --git a/src/client/common/application/applicationEnvironment.ts b/src/platform/common/application/applicationEnvironment.ts similarity index 100% rename from src/client/common/application/applicationEnvironment.ts rename to src/platform/common/application/applicationEnvironment.ts diff --git a/src/client/common/application/applicationShell.ts b/src/platform/common/application/applicationShell.ts similarity index 99% rename from src/client/common/application/applicationShell.ts rename to src/platform/common/application/applicationShell.ts index 2d22bf3ad58..8639e966f36 100644 --- a/src/client/common/application/applicationShell.ts +++ b/src/platform/common/application/applicationShell.ts @@ -104,7 +104,7 @@ export class ApplicationShell implements IApplicationShell { return window.showInputBox(options, token); } public openUrl(url: string): void { - env.openExternal(Uri.parse(url)); + void env.openExternal(Uri.parse(url)); } public setStatusBarMessage(text: string, hideAfterTimeout: number): Disposable; diff --git a/src/client/common/application/clipboard.ts b/src/platform/common/application/clipboard.ts similarity index 100% rename from src/client/common/application/clipboard.ts rename to src/platform/common/application/clipboard.ts diff --git a/src/client/common/application/commandManager.ts b/src/platform/common/application/commandManager.ts similarity index 98% rename from src/client/common/application/commandManager.ts rename to src/platform/common/application/commandManager.ts index 8b8f33a88b9..54eaad1aa4e 100644 --- a/src/client/common/application/commandManager.ts +++ b/src/platform/common/application/commandManager.ts @@ -6,7 +6,7 @@ import { injectable } from 'inversify'; import { commands, Disposable, TextEditor, TextEditorEdit } from 'vscode'; import { Telemetry } from '../../datascience/constants'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { ICommandNameArgumentTypeMapping } from './commands'; import { ICommandManager } from './types'; diff --git a/src/client/common/application/commands.ts b/src/platform/common/application/commands.ts similarity index 99% rename from src/client/common/application/commands.ts rename to src/platform/common/application/commands.ts index ff1333bb7d6..286d427cc44 100644 --- a/src/client/common/application/commands.ts +++ b/src/platform/common/application/commands.ts @@ -13,7 +13,7 @@ import { Uri, ViewColumn } from 'vscode'; -import { IShowDataViewerFromVariablePanel } from '../../../extension/messageTypes'; +import { IShowDataViewerFromVariablePanel } from '../../../platform/messageTypes'; import { Commands as DSCommands } from '../../datascience/constants'; import { PythonEnvironment } from '../../pythonEnvironments/info'; import { CommandSource } from '../../testing/common/constants'; diff --git a/src/client/common/application/commands/reloadCommand.ts b/src/platform/common/application/commands/reloadCommand.ts similarity index 100% rename from src/client/common/application/commands/reloadCommand.ts rename to src/platform/common/application/commands/reloadCommand.ts diff --git a/src/client/common/application/debugService.ts b/src/platform/common/application/debugService.ts similarity index 100% rename from src/client/common/application/debugService.ts rename to src/platform/common/application/debugService.ts diff --git a/src/client/common/application/documentManager.ts b/src/platform/common/application/documentManager.ts similarity index 100% rename from src/client/common/application/documentManager.ts rename to src/platform/common/application/documentManager.ts diff --git a/src/client/common/application/encryptedStorage.ts b/src/platform/common/application/encryptedStorage.ts similarity index 87% rename from src/client/common/application/encryptedStorage.ts rename to src/platform/common/application/encryptedStorage.ts index e76f61879a0..f3939892ae1 100644 --- a/src/client/common/application/encryptedStorage.ts +++ b/src/platform/common/application/encryptedStorage.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { inject, injectable } from 'inversify'; import { ExtensionMode } from 'vscode'; -import { IS_REMOTE_NATIVE_TEST } from '../../../test/constants'; +import { isCI } from '../constants'; import { traceError } from '../logger'; import { IExtensionContext } from '../types'; import { IEncryptedStorage } from './types'; @@ -19,7 +19,7 @@ export class EncryptedStorage implements IEncryptedStorage { public async store(service: string, key: string, value: string | undefined): Promise { // On CI we don't need to use keytar for testing (else it hangs). - if (IS_REMOTE_NATIVE_TEST && this.extensionContext.extensionMode !== ExtensionMode.Production) { + if (isCI && this.extensionContext.extensionMode !== ExtensionMode.Production) { this.testingState.set(`${service}#${key}`, value || ''); return; } @@ -36,7 +36,7 @@ export class EncryptedStorage implements IEncryptedStorage { } public async retrieve(service: string, key: string): Promise { // On CI we don't need to use keytar for testing (else it hangs). - if (IS_REMOTE_NATIVE_TEST && this.extensionContext.extensionMode !== ExtensionMode.Production) { + if (isCI && this.extensionContext.extensionMode !== ExtensionMode.Production) { return this.testingState.get(`${service}#${key}`); } try { diff --git a/src/client/common/application/extensions.ts b/src/platform/common/application/extensions.ts similarity index 100% rename from src/client/common/application/extensions.ts rename to src/platform/common/application/extensions.ts diff --git a/src/client/common/application/languageService.ts b/src/platform/common/application/languageService.ts similarity index 100% rename from src/client/common/application/languageService.ts rename to src/platform/common/application/languageService.ts diff --git a/src/client/common/application/notebook.ts b/src/platform/common/application/notebook.ts similarity index 100% rename from src/client/common/application/notebook.ts rename to src/platform/common/application/notebook.ts diff --git a/src/client/common/application/types.ts b/src/platform/common/application/types.ts similarity index 100% rename from src/client/common/application/types.ts rename to src/platform/common/application/types.ts diff --git a/src/client/common/application/webviewPanels/webviewPanel.ts b/src/platform/common/application/webviewPanels/webviewPanel.ts similarity index 100% rename from src/client/common/application/webviewPanels/webviewPanel.ts rename to src/platform/common/application/webviewPanels/webviewPanel.ts diff --git a/src/client/common/application/webviewPanels/webviewPanelProvider.ts b/src/platform/common/application/webviewPanels/webviewPanelProvider.ts similarity index 100% rename from src/client/common/application/webviewPanels/webviewPanelProvider.ts rename to src/platform/common/application/webviewPanels/webviewPanelProvider.ts diff --git a/src/client/common/application/webviewViews/webviewView.ts b/src/platform/common/application/webviewViews/webviewView.ts similarity index 100% rename from src/client/common/application/webviewViews/webviewView.ts rename to src/platform/common/application/webviewViews/webviewView.ts diff --git a/src/client/common/application/webviewViews/webviewViewProvider.ts b/src/platform/common/application/webviewViews/webviewViewProvider.ts similarity index 100% rename from src/client/common/application/webviewViews/webviewViewProvider.ts rename to src/platform/common/application/webviewViews/webviewViewProvider.ts diff --git a/src/client/common/application/webviews/webview.ts b/src/platform/common/application/webviews/webview.ts similarity index 100% rename from src/client/common/application/webviews/webview.ts rename to src/platform/common/application/webviews/webview.ts diff --git a/src/client/common/application/workspace.ts b/src/platform/common/application/workspace.ts similarity index 100% rename from src/client/common/application/workspace.ts rename to src/platform/common/application/workspace.ts diff --git a/src/client/common/asyncDisposableRegistry.ts b/src/platform/common/asyncDisposableRegistry.ts similarity index 100% rename from src/client/common/asyncDisposableRegistry.ts rename to src/platform/common/asyncDisposableRegistry.ts diff --git a/src/client/common/cancellation.ts b/src/platform/common/cancellation.ts similarity index 98% rename from src/client/common/cancellation.ts rename to src/platform/common/cancellation.ts index bc31e61755a..889a50ac133 100644 --- a/src/client/common/cancellation.ts +++ b/src/platform/common/cancellation.ts @@ -3,7 +3,7 @@ 'use strict'; import { CancellationToken, CancellationTokenSource } from 'vscode'; -import { BaseError } from '../../extension/errors/types'; +import { BaseError } from '../../platform/errors/types'; import { createDeferred } from './utils/async'; import * as localize from './utils/localize'; diff --git a/src/client/common/configSettings.ts b/src/platform/common/configSettings.ts similarity index 100% rename from src/client/common/configSettings.ts rename to src/platform/common/configSettings.ts diff --git a/src/client/common/configuration/service.ts b/src/platform/common/configuration/service.ts similarity index 100% rename from src/client/common/configuration/service.ts rename to src/platform/common/configuration/service.ts diff --git a/src/client/common/constants.ts b/src/platform/common/constants.ts similarity index 100% rename from src/client/common/constants.ts rename to src/platform/common/constants.ts diff --git a/src/client/common/contextKey.ts b/src/platform/common/contextKey.ts similarity index 100% rename from src/client/common/contextKey.ts rename to src/platform/common/contextKey.ts diff --git a/src/client/common/crypto.ts b/src/platform/common/crypto.ts similarity index 100% rename from src/client/common/crypto.ts rename to src/platform/common/crypto.ts diff --git a/src/client/common/experiments/groups.ts b/src/platform/common/experiments/groups.ts similarity index 100% rename from src/client/common/experiments/groups.ts rename to src/platform/common/experiments/groups.ts diff --git a/src/client/common/experiments/service.ts b/src/platform/common/experiments/service.ts similarity index 98% rename from src/client/common/experiments/service.ts rename to src/platform/common/experiments/service.ts index 16038691dcc..bd068c0f4b9 100644 --- a/src/client/common/experiments/service.ts +++ b/src/platform/common/experiments/service.ts @@ -6,8 +6,8 @@ import { inject, injectable, named } from 'inversify'; import { Memento } from 'vscode'; import { getExperimentationService, IExperimentationService, TargetPopulation } from 'vscode-tas-client'; -import { sendTelemetryEvent } from '../../telemetry'; -import { EventName } from '../../telemetry/constants'; +import { sendTelemetryEvent } from '../../../telemetry'; +import { EventName } from '../../../telemetry/constants'; import { IApplicationEnvironment } from '../application/types'; import { JVSC_EXTENSION_ID, STANDARD_OUTPUT_CHANNEL } from '../constants'; import { traceVerbose } from '../logger'; diff --git a/src/client/common/experiments/telemetry.ts b/src/platform/common/experiments/telemetry.ts similarity index 93% rename from src/client/common/experiments/telemetry.ts rename to src/platform/common/experiments/telemetry.ts index b596cd4f2ed..6c1128339e6 100644 --- a/src/client/common/experiments/telemetry.ts +++ b/src/platform/common/experiments/telemetry.ts @@ -4,7 +4,7 @@ 'use strict'; import { IExperimentationTelemetry } from 'vscode-tas-client'; -import { sendTelemetryEvent, setSharedProperty } from '../../telemetry'; +import { sendTelemetryEvent, setSharedProperty } from '../../../telemetry'; export class ExperimentationTelemetry implements IExperimentationTelemetry { public setSharedProperty(name: string, value: string): void { diff --git a/src/client/common/extensions.ts b/src/platform/common/extensions.ts similarity index 100% rename from src/client/common/extensions.ts rename to src/platform/common/extensions.ts diff --git a/src/client/common/featureDeprecationManager.ts b/src/platform/common/featureDeprecationManager.ts similarity index 100% rename from src/client/common/featureDeprecationManager.ts rename to src/platform/common/featureDeprecationManager.ts diff --git a/src/client/common/helpers.ts b/src/platform/common/helpers.ts similarity index 91% rename from src/client/common/helpers.ts rename to src/platform/common/helpers.ts index 9bf079cd6cb..57c270b0579 100644 --- a/src/client/common/helpers.ts +++ b/src/platform/common/helpers.ts @@ -3,7 +3,7 @@ 'use strict'; -import { ModuleNotInstalledError } from '../../extension/errors/moduleNotInstalledError'; +import { ModuleNotInstalledError } from '../../platform/errors/moduleNotInstalledError'; import { IDisposable } from './types'; export function isNotInstalledError(error: Error): boolean { diff --git a/src/client/common/helpers.unit.test.ts b/src/platform/common/helpers.unit.test.ts similarity index 100% rename from src/client/common/helpers.unit.test.ts rename to src/platform/common/helpers.unit.test.ts diff --git a/src/client/common/logger.ts b/src/platform/common/logger.ts similarity index 100% rename from src/client/common/logger.ts rename to src/platform/common/logger.ts diff --git a/src/client/common/net/browser.ts b/src/platform/common/net/browser.ts similarity index 91% rename from src/client/common/net/browser.ts rename to src/platform/common/net/browser.ts index 20ffa9771e8..e183e0fdcf4 100644 --- a/src/client/common/net/browser.ts +++ b/src/platform/common/net/browser.ts @@ -10,7 +10,7 @@ import { env, Uri } from 'vscode'; import { IBrowserService } from '../types'; export function launch(url: string) { - env.openExternal(Uri.parse(url)); + void env.openExternal(Uri.parse(url)); } @injectable() diff --git a/src/client/common/net/fileDownloader.ts b/src/platform/common/net/fileDownloader.ts similarity index 100% rename from src/client/common/net/fileDownloader.ts rename to src/platform/common/net/fileDownloader.ts diff --git a/src/client/common/net/httpClient.ts b/src/platform/common/net/httpClient.ts similarity index 100% rename from src/client/common/net/httpClient.ts rename to src/platform/common/net/httpClient.ts diff --git a/src/client/common/net/portAttributeProvider.ts b/src/platform/common/net/portAttributeProvider.ts similarity index 100% rename from src/client/common/net/portAttributeProvider.ts rename to src/platform/common/net/portAttributeProvider.ts diff --git a/src/client/common/net/socket/SocketStream.ts b/src/platform/common/net/socket/SocketStream.ts similarity index 100% rename from src/client/common/net/socket/SocketStream.ts rename to src/platform/common/net/socket/SocketStream.ts diff --git a/src/client/common/net/socket/socketCallbackHandler.ts b/src/platform/common/net/socket/socketCallbackHandler.ts similarity index 100% rename from src/client/common/net/socket/socketCallbackHandler.ts rename to src/platform/common/net/socket/socketCallbackHandler.ts diff --git a/src/client/common/net/socket/socketServer.ts b/src/platform/common/net/socket/socketServer.ts similarity index 97% rename from src/client/common/net/socket/socketServer.ts rename to src/platform/common/net/socket/socketServer.ts index 70bccde3124..e5996e1d10e 100644 --- a/src/client/common/net/socket/socketServer.ts +++ b/src/platform/common/net/socket/socketServer.ts @@ -1,11 +1,9 @@ import { EventEmitter } from 'events'; -import { injectable } from 'inversify'; import * as net from 'net'; import { ISocketServer } from '../../types'; import { createDeferred, Deferred } from '../../utils/async'; import { noop } from '../../utils/misc'; -@injectable() export class SocketServer extends EventEmitter implements ISocketServer { private socketServer: net.Server | undefined; private clientSocket: Deferred; diff --git a/src/client/common/persistentState.ts b/src/platform/common/persistentState.ts similarity index 100% rename from src/client/common/persistentState.ts rename to src/platform/common/persistentState.ts diff --git a/src/client/common/platform/constants.ts b/src/platform/common/platform/constants.ts similarity index 100% rename from src/client/common/platform/constants.ts rename to src/platform/common/platform/constants.ts diff --git a/src/client/common/platform/errors.ts b/src/platform/common/platform/errors.ts similarity index 100% rename from src/client/common/platform/errors.ts rename to src/platform/common/platform/errors.ts diff --git a/src/client/common/platform/fileSystem.ts b/src/platform/common/platform/fileSystem.ts similarity index 100% rename from src/client/common/platform/fileSystem.ts rename to src/platform/common/platform/fileSystem.ts diff --git a/src/client/common/platform/fileSystemUtils.ts b/src/platform/common/platform/fileSystemUtils.ts similarity index 100% rename from src/client/common/platform/fileSystemUtils.ts rename to src/platform/common/platform/fileSystemUtils.ts diff --git a/src/client/common/platform/fileUtils.ts b/src/platform/common/platform/fileUtils.ts similarity index 100% rename from src/client/common/platform/fileUtils.ts rename to src/platform/common/platform/fileUtils.ts diff --git a/src/client/common/platform/fs-paths.ts b/src/platform/common/platform/fs-paths.ts similarity index 100% rename from src/client/common/platform/fs-paths.ts rename to src/platform/common/platform/fs-paths.ts diff --git a/src/client/common/platform/fs-temp.ts b/src/platform/common/platform/fs-temp.ts similarity index 100% rename from src/client/common/platform/fs-temp.ts rename to src/platform/common/platform/fs-temp.ts diff --git a/src/client/common/platform/pathUtils.ts b/src/platform/common/platform/pathUtils.ts similarity index 100% rename from src/client/common/platform/pathUtils.ts rename to src/platform/common/platform/pathUtils.ts diff --git a/src/client/common/platform/platformService.ts b/src/platform/common/platform/platformService.ts similarity index 95% rename from src/client/common/platform/platformService.ts rename to src/platform/common/platform/platformService.ts index 3ad5b6af3f0..b04633ed7ad 100644 --- a/src/client/common/platform/platformService.ts +++ b/src/platform/common/platform/platformService.ts @@ -5,8 +5,8 @@ import { injectable } from 'inversify'; import * as os from 'os'; import { coerce, SemVer } from 'semver'; -import { sendTelemetryEvent } from '../../telemetry'; -import { EventName, PlatformErrors } from '../../telemetry/constants'; +import { sendTelemetryEvent } from '../../../telemetry'; +import { EventName, PlatformErrors } from '../../../telemetry/constants'; import { getOSType, OSType } from '../utils/platform'; import { parseVersion } from '../utils/version'; import { NON_WINDOWS_PATH_VARIABLE_NAME, WINDOWS_PATH_VARIABLE_NAME } from './constants'; diff --git a/src/client/common/platform/serviceRegistry.ts b/src/platform/common/platform/serviceRegistry.ts similarity index 100% rename from src/client/common/platform/serviceRegistry.ts rename to src/platform/common/platform/serviceRegistry.ts diff --git a/src/client/common/platform/types.ts b/src/platform/common/platform/types.ts similarity index 100% rename from src/client/common/platform/types.ts rename to src/platform/common/platform/types.ts diff --git a/src/client/common/process/baseDaemon.ts b/src/platform/common/process/baseDaemon.ts similarity index 99% rename from src/client/common/process/baseDaemon.ts rename to src/platform/common/process/baseDaemon.ts index 976c4c146dc..41ea39bfac0 100644 --- a/src/client/common/process/baseDaemon.ts +++ b/src/platform/common/process/baseDaemon.ts @@ -10,7 +10,7 @@ import * as util from 'util'; import { MessageConnection, NotificationType, RequestType, RequestType0 } from 'vscode-jsonrpc'; import { IPlatformService } from '../../common/platform/types'; import { PythonEnvironment } from '../../pythonEnvironments/info'; -import { BaseError } from '../../../extension/errors/types'; +import { BaseError } from '../../../platform/errors/types'; import { traceError, traceVerbose, traceWarning } from '../logger'; import { IDisposable } from '../types'; import { createDeferred, Deferred } from '../utils/async'; diff --git a/src/client/common/process/condaService.ts b/src/platform/common/process/condaService.ts similarity index 100% rename from src/client/common/process/condaService.ts rename to src/platform/common/process/condaService.ts diff --git a/src/client/common/process/constants.ts b/src/platform/common/process/constants.ts similarity index 100% rename from src/client/common/process/constants.ts rename to src/platform/common/process/constants.ts diff --git a/src/client/common/process/currentProcess.ts b/src/platform/common/process/currentProcess.ts similarity index 100% rename from src/client/common/process/currentProcess.ts rename to src/platform/common/process/currentProcess.ts diff --git a/src/client/common/process/decoder.ts b/src/platform/common/process/decoder.ts similarity index 100% rename from src/client/common/process/decoder.ts rename to src/platform/common/process/decoder.ts diff --git a/src/client/common/process/environmentActivationService.ts b/src/platform/common/process/environmentActivationService.ts similarity index 99% rename from src/client/common/process/environmentActivationService.ts rename to src/platform/common/process/environmentActivationService.ts index b9e6d144a0c..3bd159e437f 100644 --- a/src/client/common/process/environmentActivationService.ts +++ b/src/platform/common/process/environmentActivationService.ts @@ -15,7 +15,7 @@ import { createDeferredFromPromise, sleep } from '../utils/async'; import { OSType } from '../utils/platform'; import { EnvironmentVariables, IEnvironmentVariablesProvider } from '../variables/types'; import { EnvironmentType, PythonEnvironment } from '../../pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { logValue, TraceOptions } from '../../logging/trace'; import { getInterpreterHash } from '../../pythonEnvironments/info/interpreter'; import { IPythonApiProvider } from '../../api/types'; @@ -27,7 +27,7 @@ import { IEnvironmentActivationService } from '../../interpreter/activation/type import { IInterpreterService } from '../../interpreter/contracts'; import { CurrentProcess } from './currentProcess'; import { traceDecorators, traceError, traceInfo, traceVerbose, traceWarning } from '../logger'; -import { getTelemetrySafeHashedString } from '../../telemetry/helpers'; +import { getTelemetrySafeHashedString } from '../../../telemetry/helpers'; import { CondaService } from './condaService'; import { condaVersionSupportsLiveStreaming, createCondaEnv } from './pythonEnvironment'; import { printEnvVariablesToFile } from './internal/scripts'; diff --git a/src/client/common/process/internal/python.ts b/src/platform/common/process/internal/python.ts similarity index 100% rename from src/client/common/process/internal/python.ts rename to src/platform/common/process/internal/python.ts diff --git a/src/client/common/process/internal/scripts/index.ts b/src/platform/common/process/internal/scripts/index.ts similarity index 100% rename from src/client/common/process/internal/scripts/index.ts rename to src/platform/common/process/internal/scripts/index.ts diff --git a/src/client/common/process/internal/scripts/testing_tools.ts b/src/platform/common/process/internal/scripts/testing_tools.ts similarity index 100% rename from src/client/common/process/internal/scripts/testing_tools.ts rename to src/platform/common/process/internal/scripts/testing_tools.ts diff --git a/src/client/common/process/internal/scripts/vscode_datascience_helpers.ts b/src/platform/common/process/internal/scripts/vscode_datascience_helpers.ts similarity index 100% rename from src/client/common/process/internal/scripts/vscode_datascience_helpers.ts rename to src/platform/common/process/internal/scripts/vscode_datascience_helpers.ts diff --git a/src/client/common/process/logger.ts b/src/platform/common/process/logger.ts similarity index 100% rename from src/client/common/process/logger.ts rename to src/platform/common/process/logger.ts diff --git a/src/client/common/process/proc.ts b/src/platform/common/process/proc.ts similarity index 100% rename from src/client/common/process/proc.ts rename to src/platform/common/process/proc.ts diff --git a/src/client/common/process/processFactory.ts b/src/platform/common/process/processFactory.ts similarity index 100% rename from src/client/common/process/processFactory.ts rename to src/platform/common/process/processFactory.ts diff --git a/src/client/common/process/pythonDaemon.ts b/src/platform/common/process/pythonDaemon.ts similarity index 100% rename from src/client/common/process/pythonDaemon.ts rename to src/platform/common/process/pythonDaemon.ts diff --git a/src/client/common/process/pythonDaemonFactory.ts b/src/platform/common/process/pythonDaemonFactory.ts similarity index 100% rename from src/client/common/process/pythonDaemonFactory.ts rename to src/platform/common/process/pythonDaemonFactory.ts diff --git a/src/client/common/process/pythonDaemonPool.ts b/src/platform/common/process/pythonDaemonPool.ts similarity index 100% rename from src/client/common/process/pythonDaemonPool.ts rename to src/platform/common/process/pythonDaemonPool.ts diff --git a/src/client/common/process/pythonEnvironment.ts b/src/platform/common/process/pythonEnvironment.ts similarity index 100% rename from src/client/common/process/pythonEnvironment.ts rename to src/platform/common/process/pythonEnvironment.ts diff --git a/src/client/common/process/pythonExecutionFactory.ts b/src/platform/common/process/pythonExecutionFactory.ts similarity index 98% rename from src/client/common/process/pythonExecutionFactory.ts rename to src/platform/common/process/pythonExecutionFactory.ts index ec06922f377..5ffd8be93ba 100644 --- a/src/client/common/process/pythonExecutionFactory.ts +++ b/src/platform/common/process/pythonExecutionFactory.ts @@ -6,8 +6,8 @@ import { IEnvironmentActivationService } from '../../interpreter/activation/type import { IServiceContainer } from '../../ioc/types'; import { ignoreLogging, TraceOptions } from '../../logging/trace'; import { EnvironmentType, PythonEnvironment } from '../../pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../telemetry'; -import { EventName } from '../../telemetry/constants'; +import { sendTelemetryEvent } from '../../../telemetry'; +import { EventName } from '../../../telemetry/constants'; import { IWorkspaceService } from '../application/types'; import { traceDecorators, traceError, traceInfo } from '../logger'; import { getDisplayPath } from '../platform/fs-paths'; diff --git a/src/client/common/process/pythonProcess.ts b/src/platform/common/process/pythonProcess.ts similarity index 96% rename from src/client/common/process/pythonProcess.ts rename to src/platform/common/process/pythonProcess.ts index 4f3e6672124..f33ddfcc802 100644 --- a/src/client/common/process/pythonProcess.ts +++ b/src/platform/common/process/pythonProcess.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. import { PythonExecInfo } from '../../pythonEnvironments/exec'; -import { ErrorUtils } from '../../../extension/errors/errorUtils'; -import { ModuleNotInstalledError } from '../../../extension/errors/moduleNotInstalledError'; +import { ErrorUtils } from '../../../platform/errors/errorUtils'; +import { ModuleNotInstalledError } from '../../../platform/errors/moduleNotInstalledError'; import * as internalPython from './internal/python'; import { ExecutionResult, IProcessService, ObservableExecutionResult, SpawnOptions } from './types'; diff --git a/src/client/common/process/serviceRegistry.ts b/src/platform/common/process/serviceRegistry.ts similarity index 100% rename from src/client/common/process/serviceRegistry.ts rename to src/platform/common/process/serviceRegistry.ts diff --git a/src/client/common/process/types.ts b/src/platform/common/process/types.ts similarity index 99% rename from src/client/common/process/types.ts rename to src/platform/common/process/types.ts index 912568f94fa..285b506ccc9 100644 --- a/src/client/common/process/types.ts +++ b/src/platform/common/process/types.ts @@ -8,7 +8,7 @@ import { CancellationToken, Uri } from 'vscode'; import { Newable } from '../../ioc/types'; import { PythonExecInfo } from '../../pythonEnvironments/exec'; import { InterpreterInformation, PythonEnvironment } from '../../pythonEnvironments/info'; -import { BaseError } from '../../../extension/errors/types'; +import { BaseError } from '../../../platform/errors/types'; import { IDisposable } from '../types'; import { EnvironmentVariables } from '../variables/types'; diff --git a/src/client/common/refBool.ts b/src/platform/common/refBool.ts similarity index 100% rename from src/client/common/refBool.ts rename to src/platform/common/refBool.ts diff --git a/src/client/common/serviceRegistry.ts b/src/platform/common/serviceRegistry.ts similarity index 89% rename from src/client/common/serviceRegistry.ts rename to src/platform/common/serviceRegistry.ts index ff5be612b12..b50aaa592cb 100644 --- a/src/client/common/serviceRegistry.ts +++ b/src/platform/common/serviceRegistry.ts @@ -4,8 +4,8 @@ import { IExtensionSingleActivationService, IExtensionSyncActivationService } fr import { IExperimentService, IFileDownloader, IHttpClient } from '../common/types'; import { AmlComputeContext } from './amlContext'; import { IServiceManager } from '../ioc/types'; -import { ImportTracker } from '../telemetry/importTracker'; -import { IImportTracker } from '../telemetry/types'; +import { ImportTracker } from '../../telemetry/importTracker'; +import { IImportTracker } from '../../telemetry/types'; import { ActiveResourceService } from './application/activeResource'; import { ApplicationEnvironment } from './application/applicationEnvironment'; import { ClipboardService } from './application/clipboard'; @@ -50,7 +50,10 @@ import { } from './types'; import { IMultiStepInputFactory, MultiStepInputFactory } from './utils/multiStepInput'; import { PortAttributesProviders } from './net/portAttributeProvider'; -import { LanguageInitializer } from '../telemetry/languageInitializer'; +import { LanguageInitializer } from '../../telemetry/languageInitializer'; +import { registerTypes as registerPlatformTypes } from './platform/serviceRegistry'; +import { registerTypes as processRegisterTypes } from './process/serviceRegistry'; +import { registerTypes as variableRegisterTypes } from './variables/serviceRegistry'; // eslint-disable-next-line export function registerTypes(serviceManager: IServiceManager) { @@ -97,4 +100,8 @@ export function registerTypes(serviceManager: IServiceManager) { PortAttributesProviders ); serviceManager.addSingleton(AmlComputeContext, AmlComputeContext); + + registerPlatformTypes(serviceManager); + processRegisterTypes(serviceManager); + variableRegisterTypes(serviceManager); } diff --git a/src/client/common/types.ts b/src/platform/common/types.ts similarity index 100% rename from src/client/common/types.ts rename to src/platform/common/types.ts diff --git a/src/client/common/utils/async.ts b/src/platform/common/utils/async.ts similarity index 99% rename from src/client/common/utils/async.ts rename to src/platform/common/utils/async.ts index 35faf78c45b..a6c63a14741 100644 --- a/src/client/common/utils/async.ts +++ b/src/platform/common/utils/async.ts @@ -3,7 +3,7 @@ 'use strict'; -import { BaseError } from '../../../extension/errors/types'; +import { BaseError } from '../../../platform/errors/types'; /** * Error type thrown when a timeout occurs diff --git a/src/client/common/utils/cacheUtils.ts b/src/platform/common/utils/cacheUtils.ts similarity index 100% rename from src/client/common/utils/cacheUtils.ts rename to src/platform/common/utils/cacheUtils.ts diff --git a/src/client/common/utils/decorators.ts b/src/platform/common/utils/decorators.ts similarity index 100% rename from src/client/common/utils/decorators.ts rename to src/platform/common/utils/decorators.ts diff --git a/src/client/common/utils/icons.ts b/src/platform/common/utils/icons.ts similarity index 100% rename from src/client/common/utils/icons.ts rename to src/platform/common/utils/icons.ts diff --git a/src/client/common/utils/localize.ts b/src/platform/common/utils/localize.ts similarity index 100% rename from src/client/common/utils/localize.ts rename to src/platform/common/utils/localize.ts diff --git a/src/client/common/utils/logging.ts b/src/platform/common/utils/logging.ts similarity index 100% rename from src/client/common/utils/logging.ts rename to src/platform/common/utils/logging.ts diff --git a/src/client/common/utils/misc.ts b/src/platform/common/utils/misc.ts similarity index 100% rename from src/client/common/utils/misc.ts rename to src/platform/common/utils/misc.ts diff --git a/src/client/common/utils/multiStepInput.ts b/src/platform/common/utils/multiStepInput.ts similarity index 100% rename from src/client/common/utils/multiStepInput.ts rename to src/platform/common/utils/multiStepInput.ts diff --git a/src/client/common/utils/platform.ts b/src/platform/common/utils/platform.ts similarity index 100% rename from src/client/common/utils/platform.ts rename to src/platform/common/utils/platform.ts diff --git a/src/client/common/utils/regexp.ts b/src/platform/common/utils/regexp.ts similarity index 100% rename from src/client/common/utils/regexp.ts rename to src/platform/common/utils/regexp.ts diff --git a/src/client/common/utils/serializers.ts b/src/platform/common/utils/serializers.ts similarity index 100% rename from src/client/common/utils/serializers.ts rename to src/platform/common/utils/serializers.ts diff --git a/src/client/common/utils/stopWatch.ts b/src/platform/common/utils/stopWatch.ts similarity index 100% rename from src/client/common/utils/stopWatch.ts rename to src/platform/common/utils/stopWatch.ts diff --git a/src/client/common/utils/sysTypes.ts b/src/platform/common/utils/sysTypes.ts similarity index 100% rename from src/client/common/utils/sysTypes.ts rename to src/platform/common/utils/sysTypes.ts diff --git a/src/client/common/utils/text.ts b/src/platform/common/utils/text.ts similarity index 100% rename from src/client/common/utils/text.ts rename to src/platform/common/utils/text.ts diff --git a/src/client/common/utils/version.ts b/src/platform/common/utils/version.ts similarity index 100% rename from src/client/common/utils/version.ts rename to src/platform/common/utils/version.ts diff --git a/src/client/common/variables/environment.ts b/src/platform/common/variables/environment.ts similarity index 98% rename from src/client/common/variables/environment.ts rename to src/platform/common/variables/environment.ts index 42edbf6fa3f..1f484e12e46 100644 --- a/src/client/common/variables/environment.ts +++ b/src/platform/common/variables/environment.ts @@ -3,8 +3,8 @@ import { inject, injectable } from 'inversify'; import * as path from 'path'; -import { sendTelemetryEvent } from '../../telemetry'; -import { EventName } from '../../telemetry/constants'; +import { sendTelemetryEvent } from '../../../telemetry'; +import { EventName } from '../../../telemetry/constants'; import { traceError } from '../logger'; import { isFileNotFoundError } from '../platform/errors'; import { IFileSystem } from '../platform/types'; diff --git a/src/client/common/variables/environmentVariablesProvider.ts b/src/platform/common/variables/environmentVariablesProvider.ts similarity index 98% rename from src/client/common/variables/environmentVariablesProvider.ts rename to src/platform/common/variables/environmentVariablesProvider.ts index 5bea7fbbcb3..16bc36e07c0 100644 --- a/src/client/common/variables/environmentVariablesProvider.ts +++ b/src/platform/common/variables/environmentVariablesProvider.ts @@ -4,7 +4,7 @@ import { inject, injectable, optional } from 'inversify'; import * as path from 'path'; import { ConfigurationChangeEvent, Disposable, Event, EventEmitter, FileSystemWatcher, Uri } from 'vscode'; import { TraceOptions } from '../../logging/trace'; -import { sendFileCreationTelemetry } from '../../telemetry/envFileTelemetry'; +import { sendFileCreationTelemetry } from '../../../telemetry/envFileTelemetry'; import { IWorkspaceService } from '../application/types'; import { traceDecorators, traceInfoIfCI, traceVerbose } from '../logger'; import { IDisposableRegistry } from '../types'; diff --git a/src/client/common/variables/serviceRegistry.ts b/src/platform/common/variables/serviceRegistry.ts similarity index 100% rename from src/client/common/variables/serviceRegistry.ts rename to src/platform/common/variables/serviceRegistry.ts diff --git a/src/client/common/variables/sysTypes.ts b/src/platform/common/variables/sysTypes.ts similarity index 100% rename from src/client/common/variables/sysTypes.ts rename to src/platform/common/variables/sysTypes.ts diff --git a/src/client/common/variables/systemVariables.ts b/src/platform/common/variables/systemVariables.ts similarity index 100% rename from src/client/common/variables/systemVariables.ts rename to src/platform/common/variables/systemVariables.ts diff --git a/src/client/common/variables/types.ts b/src/platform/common/variables/types.ts similarity index 100% rename from src/client/common/variables/types.ts rename to src/platform/common/variables/types.ts diff --git a/src/platform/constants.ts b/src/platform/constants.ts new file mode 100644 index 00000000000..61e1d9ebd14 --- /dev/null +++ b/src/platform/constants.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +'use strict'; + +import * as path from 'path'; + +const webpacked = !path.basename(__dirname).includes('platform'); + +export const EXTENSION_ROOT_DIR = webpacked ? path.join(__dirname, '..') : path.join(__dirname, '..', '..'); + +export const HiddenFileFormatString = '_HiddenFile_{0}.py'; + +export const MillisecondsInADay = 24 * 60 * 60 * 1_000; diff --git a/src/client/datascience/activation.ts b/src/platform/datascience/activation.ts similarity index 98% rename from src/client/datascience/activation.ts rename to src/platform/datascience/activation.ts index 6c3aedb16d4..9c244215d2b 100644 --- a/src/client/datascience/activation.ts +++ b/src/platform/datascience/activation.ts @@ -10,7 +10,7 @@ import '../common/extensions'; import { IPythonDaemonExecutionService, IPythonExecutionFactory } from '../common/process/types'; import { IDisposableRegistry } from '../common/types'; import { debounceAsync, swallowExceptions } from '../common/utils/decorators'; -import { sendTelemetryEvent } from '../telemetry'; +import { sendTelemetryEvent } from '../../telemetry'; import { JupyterDaemonModule, Telemetry } from './constants'; import { ActiveEditorContextService } from '../../interactive-window/commands/activeEditorContext'; import { IRawNotebookSupportedService } from './types'; diff --git a/src/client/datascience/cellFactory.ts b/src/platform/datascience/cellFactory.ts similarity index 98% rename from src/client/datascience/cellFactory.ts rename to src/platform/datascience/cellFactory.ts index 9a981f4295b..a49c702f346 100644 --- a/src/client/datascience/cellFactory.ts +++ b/src/platform/datascience/cellFactory.ts @@ -149,7 +149,7 @@ export function generateCellsFromNotebookDocument( const data = createJupyterCellFromVSCNotebookCell(cell); data.source = cell.kind === NotebookCellKind.Code - ? appendLineFeed(code, magicCommandsAsComments ? uncommentMagicCommands : undefined) + ? appendLineFeed(code, '\n', magicCommandsAsComments ? uncommentMagicCommands : undefined) : appendLineFeed(code); return { data, diff --git a/src/client/datascience/cellMatcher.ts b/src/platform/datascience/cellMatcher.ts similarity index 100% rename from src/client/datascience/cellMatcher.ts rename to src/platform/datascience/cellMatcher.ts diff --git a/src/client/datascience/codeCssGenerator.ts b/src/platform/datascience/codeCssGenerator.ts similarity index 100% rename from src/client/datascience/codeCssGenerator.ts rename to src/platform/datascience/codeCssGenerator.ts diff --git a/src/client/datascience/common.ts b/src/platform/datascience/common.ts similarity index 98% rename from src/client/datascience/common.ts rename to src/platform/datascience/common.ts index 421651d3682..f249975b82b 100644 --- a/src/client/datascience/common.ts +++ b/src/platform/datascience/common.ts @@ -9,10 +9,10 @@ import { Uri } from 'vscode'; import { splitMultilineString } from '../../datascience-ui/common'; import { traceError, traceInfo } from '../common/logger'; import { DataScience } from '../common/utils/localize'; -import { sendTelemetryEvent } from '../telemetry'; +import { sendTelemetryEvent } from '../../telemetry'; import { jupyterLanguageToMonacoLanguageMapping, Telemetry } from './constants'; import { ICell } from './types'; -import { getTelemetrySafeLanguage } from '../telemetry/helpers'; +import { getTelemetrySafeLanguage } from '../../telemetry/helpers'; // Can't figure out a better way to do this. Enumerate // the allowed keys of different output formats. diff --git a/src/client/datascience/constants.ts b/src/platform/datascience/constants.ts similarity index 100% rename from src/client/datascience/constants.ts rename to src/platform/datascience/constants.ts diff --git a/src/client/datascience/data-viewing/dataViewer.ts b/src/platform/datascience/data-viewing/dataViewer.ts similarity index 98% rename from src/client/datascience/data-viewing/dataViewer.ts rename to src/platform/datascience/data-viewing/dataViewer.ts index d99c00727c6..d072e628706 100644 --- a/src/client/datascience/data-viewing/dataViewer.ts +++ b/src/platform/datascience/data-viewing/dataViewer.ts @@ -14,9 +14,9 @@ import { GLOBAL_MEMENTO, IConfigurationService, IDisposable, IMemento, Resource import * as localize from '../../common/utils/localize'; import { noop } from '../../common/utils/misc'; import { StopWatch } from '../../common/utils/stopWatch'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { HelpLinks, Telemetry } from '../constants'; -import { JupyterDataRateLimitError } from '../../../extension/errors/jupyterDataRateLimitError'; +import { JupyterDataRateLimitError } from '../../../platform/errors/jupyterDataRateLimitError'; import { ICodeCssGenerator, IDataScienceErrorHandler, @@ -36,7 +36,7 @@ import { IGetSliceRequest } from './types'; import { isValidSliceExpression, preselectedSliceExpression } from '../../../datascience-ui/data-explorer/helpers'; -import { CheckboxState } from '../../telemetry/constants'; +import { CheckboxState } from '../../../telemetry/constants'; import { IKernel } from '../../../kernels/types'; const PREFERRED_VIEWGROUP = 'JupyterDataViewerPreferredViewColumn'; diff --git a/src/client/datascience/data-viewing/dataViewerDependencyService.ts b/src/platform/datascience/data-viewing/dataViewerDependencyService.ts similarity index 98% rename from src/client/datascience/data-viewing/dataViewerDependencyService.ts rename to src/platform/datascience/data-viewing/dataViewerDependencyService.ts index 82a57e103e8..30f433ad2e5 100644 --- a/src/client/datascience/data-viewing/dataViewerDependencyService.ts +++ b/src/platform/datascience/data-viewing/dataViewerDependencyService.ts @@ -16,7 +16,7 @@ import { IsCodeSpace } from '../../common/types'; import { Common, DataScience } from '../../common/utils/localize'; import { IInterpreterService } from '../../interpreter/contracts'; import { PythonEnvironment } from '../../pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { parseSemVer } from '../common'; import { Telemetry } from '../constants'; diff --git a/src/client/datascience/data-viewing/dataViewerFactory.ts b/src/platform/datascience/data-viewing/dataViewerFactory.ts similarity index 98% rename from src/client/datascience/data-viewing/dataViewerFactory.ts rename to src/platform/datascience/data-viewing/dataViewerFactory.ts index 4f64085f83f..24627051337 100644 --- a/src/client/datascience/data-viewing/dataViewerFactory.ts +++ b/src/platform/datascience/data-viewing/dataViewerFactory.ts @@ -7,7 +7,7 @@ import { inject, injectable } from 'inversify'; import { IAsyncDisposable, IAsyncDisposableRegistry, IDisposableRegistry } from '../../common/types'; import { IServiceContainer } from '../../ioc/types'; -import { captureTelemetry } from '../../telemetry'; +import { captureTelemetry } from '../../../telemetry'; import { Commands, EditorContexts, Telemetry } from '../constants'; import { IDataViewer, IDataViewerDataProvider, IDataViewerFactory } from './types'; import { ICommandManager } from '../../common/application/types'; diff --git a/src/client/datascience/data-viewing/dataViewerMessageListener.ts b/src/platform/datascience/data-viewing/dataViewerMessageListener.ts similarity index 100% rename from src/client/datascience/data-viewing/dataViewerMessageListener.ts rename to src/platform/datascience/data-viewing/dataViewerMessageListener.ts diff --git a/src/client/datascience/data-viewing/jupyterVariableDataProvider.ts b/src/platform/datascience/data-viewing/jupyterVariableDataProvider.ts similarity index 100% rename from src/client/datascience/data-viewing/jupyterVariableDataProvider.ts rename to src/platform/datascience/data-viewing/jupyterVariableDataProvider.ts diff --git a/src/client/datascience/data-viewing/jupyterVariableDataProviderFactory.ts b/src/platform/datascience/data-viewing/jupyterVariableDataProviderFactory.ts similarity index 100% rename from src/client/datascience/data-viewing/jupyterVariableDataProviderFactory.ts rename to src/platform/datascience/data-viewing/jupyterVariableDataProviderFactory.ts diff --git a/src/client/datascience/data-viewing/types.ts b/src/platform/datascience/data-viewing/types.ts similarity index 98% rename from src/client/datascience/data-viewing/types.ts rename to src/platform/datascience/data-viewing/types.ts index fe17ad57e5a..aefaf9e4ba3 100644 --- a/src/client/datascience/data-viewing/types.ts +++ b/src/platform/datascience/data-viewing/types.ts @@ -5,8 +5,8 @@ import { IDisposable } from '../../common/types'; import { SharedMessages } from '../messages'; import { Event } from 'vscode'; -import { SliceOperationSource } from '../../telemetry/constants'; import { IKernel } from '../../../kernels/types'; +import { SliceOperationSource } from '../../../telemetry/constants'; export const CellFetchAllLimit = 100000; export const CellFetchSizeFirst = 100000; diff --git a/src/client/datascience/dataScienceSurveyBanner.ts b/src/platform/datascience/dataScienceSurveyBanner.ts similarity index 100% rename from src/client/datascience/dataScienceSurveyBanner.ts rename to src/platform/datascience/dataScienceSurveyBanner.ts diff --git a/src/client/datascience/datascience.ts b/src/platform/datascience/datascience.ts similarity index 99% rename from src/client/datascience/datascience.ts rename to src/platform/datascience/datascience.ts index 3e13717bd60..349a7fd1927 100644 --- a/src/client/datascience/datascience.ts +++ b/src/platform/datascience/datascience.ts @@ -11,7 +11,7 @@ import '../common/extensions'; import { IConfigurationService, IDisposable, IDisposableRegistry, IExtensionContext } from '../common/types'; import { debounceAsync, swallowExceptions } from '../common/utils/decorators'; import { noop } from '../common/utils/misc'; -import { sendTelemetryEvent } from '../telemetry'; +import { sendTelemetryEvent } from '../../telemetry'; import { hasCells } from './cellFactory'; import { CommandRegistry } from '../../interactive-window/commands/commandRegistry'; import { EditorContexts, Telemetry } from './constants'; diff --git a/src/client/datascience/debugLocationTracker.ts b/src/platform/datascience/debugLocationTracker.ts similarity index 99% rename from src/client/datascience/debugLocationTracker.ts rename to src/platform/datascience/debugLocationTracker.ts index b63ce689924..50107090b1b 100644 --- a/src/client/datascience/debugLocationTracker.ts +++ b/src/platform/datascience/debugLocationTracker.ts @@ -1,14 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { injectable } from 'inversify'; import { DebugAdapterTracker, Event, EventEmitter } from 'vscode'; import { DebugProtocol } from 'vscode-debugprotocol'; import { IDebugLocation } from './types'; // When a python debugging session is active keep track of the current debug location -@injectable() export class DebugLocationTracker implements DebugAdapterTracker { protected topMostFrameId = 0; protected sequenceNumbersOfRequestsPendingResponses = new Set(); diff --git a/src/client/datascience/debugLocationTrackerFactory.ts b/src/platform/datascience/debugLocationTrackerFactory.ts similarity index 100% rename from src/client/datascience/debugLocationTrackerFactory.ts rename to src/platform/datascience/debugLocationTrackerFactory.ts diff --git a/src/client/datascience/displayOptions.ts b/src/platform/datascience/displayOptions.ts similarity index 100% rename from src/client/datascience/displayOptions.ts rename to src/platform/datascience/displayOptions.ts diff --git a/src/client/datascience/export/README.md b/src/platform/datascience/export/README.md similarity index 100% rename from src/client/datascience/export/README.md rename to src/platform/datascience/export/README.md diff --git a/src/client/datascience/export/exportBase.ts b/src/platform/datascience/export/exportBase.ts similarity index 100% rename from src/client/datascience/export/exportBase.ts rename to src/platform/datascience/export/exportBase.ts diff --git a/src/client/datascience/export/exportDialog.ts b/src/platform/datascience/export/exportDialog.ts similarity index 100% rename from src/client/datascience/export/exportDialog.ts rename to src/platform/datascience/export/exportDialog.ts diff --git a/src/client/datascience/export/exportFileOpener.ts b/src/platform/datascience/export/exportFileOpener.ts similarity index 96% rename from src/client/datascience/export/exportFileOpener.ts rename to src/platform/datascience/export/exportFileOpener.ts index 28271a3bb7c..c928a2ebd10 100644 --- a/src/client/datascience/export/exportFileOpener.ts +++ b/src/platform/datascience/export/exportFileOpener.ts @@ -6,7 +6,7 @@ import { PYTHON_LANGUAGE } from '../../common/constants'; import { IFileSystem } from '../../common/platform/types'; import { IBrowserService } from '../../common/types'; import * as localize from '../../common/utils/localize'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../constants'; import { ExportFormat } from './types'; @@ -43,7 +43,7 @@ export class ExportFileOpener { const doc = await this.documentManager.openTextDocument({ language: PYTHON_LANGUAGE, content: contents }); const editor = await this.documentManager.showTextDocument(doc); // Edit the document so that it is dirty (add a space at the end) - editor.edit((editBuilder) => { + await editor.edit((editBuilder) => { editBuilder.insert(new Position(editor.document.lineCount, 0), '\n'); }); } diff --git a/src/client/datascience/export/exportInterpreterFinder.ts b/src/platform/datascience/export/exportInterpreterFinder.ts similarity index 100% rename from src/client/datascience/export/exportInterpreterFinder.ts rename to src/platform/datascience/export/exportInterpreterFinder.ts diff --git a/src/client/datascience/export/exportToHTML.ts b/src/platform/datascience/export/exportToHTML.ts similarity index 100% rename from src/client/datascience/export/exportToHTML.ts rename to src/platform/datascience/export/exportToHTML.ts diff --git a/src/client/datascience/export/exportToPDF.ts b/src/platform/datascience/export/exportToPDF.ts similarity index 100% rename from src/client/datascience/export/exportToPDF.ts rename to src/platform/datascience/export/exportToPDF.ts diff --git a/src/client/datascience/export/exportToPython.ts b/src/platform/datascience/export/exportToPython.ts similarity index 100% rename from src/client/datascience/export/exportToPython.ts rename to src/platform/datascience/export/exportToPython.ts diff --git a/src/client/datascience/export/exportToPythonPlain.ts b/src/platform/datascience/export/exportToPythonPlain.ts similarity index 95% rename from src/client/datascience/export/exportToPythonPlain.ts rename to src/platform/datascience/export/exportToPythonPlain.ts index e7aa44fd351..df4b623ca0c 100644 --- a/src/client/datascience/export/exportToPythonPlain.ts +++ b/src/platform/datascience/export/exportToPythonPlain.ts @@ -56,7 +56,7 @@ export class ExportToPythonPlain implements IExport { // Check to see if we should comment out Shell / Magic commands const commentMagic = this.configuration.getSettings(cell.notebook.uri).pythonExportMethod === 'commentMagics'; - return appendLineFeed(code, commentMagic ? commentMagicCommands : undefined).join(''); + return appendLineFeed(code, os.EOL, commentMagic ? commentMagicCommands : undefined).join(''); } // Convert one Markup cell to a string @@ -64,7 +64,7 @@ export class ExportToPythonPlain implements IExport { let code = cell.document.getText().splitLines({ trim: false, removeEmptyEntries: false }); // Comment out lines of markdown cells - return appendLineFeed(code, commentLine).join(''); + return appendLineFeed(code, os.EOL, commentLine).join(''); } // Determine the cell marker for a notebook cell, if it's in the metadata use that diff --git a/src/client/datascience/export/exportUtil.ts b/src/platform/datascience/export/exportUtil.ts similarity index 100% rename from src/client/datascience/export/exportUtil.ts rename to src/platform/datascience/export/exportUtil.ts diff --git a/src/client/datascience/export/fileConverter.ts b/src/platform/datascience/export/fileConverter.ts similarity index 99% rename from src/client/datascience/export/fileConverter.ts rename to src/platform/datascience/export/fileConverter.ts index 75c7b2642a9..c8257a8f9cf 100644 --- a/src/client/datascience/export/fileConverter.ts +++ b/src/platform/datascience/export/fileConverter.ts @@ -7,7 +7,7 @@ import { IFileSystem, TemporaryDirectory } from '../../common/platform/types'; import { IConfigurationService, IExtensions } from '../../common/types'; import * as localize from '../../common/utils/localize'; import { PythonEnvironment } from '../../pythonEnvironments/info'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../constants'; import { ProgressReporter } from '../progress/progressReporter'; import { ExportFileOpener } from './exportFileOpener'; diff --git a/src/client/datascience/export/types.ts b/src/platform/datascience/export/types.ts similarity index 100% rename from src/client/datascience/export/types.ts rename to src/platform/datascience/export/types.ts diff --git a/src/client/datascience/extensionRecommendation.ts b/src/platform/datascience/extensionRecommendation.ts similarity index 99% rename from src/client/datascience/extensionRecommendation.ts rename to src/platform/datascience/extensionRecommendation.ts index fa2503af288..a078562f0fe 100644 --- a/src/client/datascience/extensionRecommendation.ts +++ b/src/platform/datascience/extensionRecommendation.ts @@ -9,7 +9,7 @@ import { disposeAllDisposables } from '../common/helpers'; import { GLOBAL_MEMENTO, IDisposable, IDisposableRegistry, IExtensions, IMemento } from '../common/types'; import { Common, DataScience } from '../common/utils/localize'; import { noop } from '../common/utils/misc'; -import { sendTelemetryEvent } from '../telemetry'; +import { sendTelemetryEvent } from '../../telemetry'; import { Telemetry } from './constants'; import { getKernelConnectionLanguage, diff --git a/src/client/datascience/messages.ts b/src/platform/datascience/messages.ts similarity index 100% rename from src/client/datascience/messages.ts rename to src/platform/datascience/messages.ts diff --git a/src/client/datascience/multiplexingDebugService.ts b/src/platform/datascience/multiplexingDebugService.ts similarity index 100% rename from src/client/datascience/multiplexingDebugService.ts rename to src/platform/datascience/multiplexingDebugService.ts diff --git a/src/client/datascience/plotting/plotViewer.ts b/src/platform/datascience/plotting/plotViewer.ts similarity index 98% rename from src/client/datascience/plotting/plotViewer.ts rename to src/platform/datascience/plotting/plotViewer.ts index 7bbc8c02aa4..0859fce18cc 100644 --- a/src/client/datascience/plotting/plotViewer.ts +++ b/src/platform/datascience/plotting/plotViewer.ts @@ -7,8 +7,8 @@ import { inject, injectable } from 'inversify'; import * as path from 'path'; import { Event, EventEmitter, Uri, ViewColumn } from 'vscode'; -import { traceInfo } from '../../../client/common/logger'; -import { createDeferred } from '../../../client/common/utils/async'; +import { traceInfo } from '../../../platform/common/logger'; +import { createDeferred } from '../../../platform/common/utils/async'; import { IApplicationShell, IWebviewPanelProvider, IWorkspaceService } from '../../common/application/types'; import { EXTENSION_ROOT_DIR } from '../../common/constants'; import { traceError } from '../../common/logger'; diff --git a/src/client/datascience/plotting/plotViewerMessageListener.ts b/src/platform/datascience/plotting/plotViewerMessageListener.ts similarity index 100% rename from src/client/datascience/plotting/plotViewerMessageListener.ts rename to src/platform/datascience/plotting/plotViewerMessageListener.ts diff --git a/src/client/datascience/plotting/plotViewerProvider.ts b/src/platform/datascience/plotting/plotViewerProvider.ts similarity index 97% rename from src/client/datascience/plotting/plotViewerProvider.ts rename to src/platform/datascience/plotting/plotViewerProvider.ts index 57cd2119597..e5d2bfd3c65 100644 --- a/src/client/datascience/plotting/plotViewerProvider.ts +++ b/src/platform/datascience/plotting/plotViewerProvider.ts @@ -7,7 +7,7 @@ import { inject, injectable } from 'inversify'; import { IAsyncDisposable, IAsyncDisposableRegistry, IDisposable } from '../../common/types'; import { IServiceContainer } from '../../ioc/types'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../constants'; import { IPlotViewer, IPlotViewerProvider } from '../types'; diff --git a/src/client/datascience/plotting/types.ts b/src/platform/datascience/plotting/types.ts similarity index 100% rename from src/client/datascience/plotting/types.ts rename to src/platform/datascience/plotting/types.ts diff --git a/src/client/datascience/prereleaseChecker.ts b/src/platform/datascience/prereleaseChecker.ts similarity index 100% rename from src/client/datascience/prereleaseChecker.ts rename to src/platform/datascience/prereleaseChecker.ts diff --git a/src/client/datascience/progress/decorator.ts b/src/platform/datascience/progress/decorator.ts similarity index 100% rename from src/client/datascience/progress/decorator.ts rename to src/platform/datascience/progress/decorator.ts diff --git a/src/client/datascience/progress/kernelProgressReporter.ts b/src/platform/datascience/progress/kernelProgressReporter.ts similarity index 100% rename from src/client/datascience/progress/kernelProgressReporter.ts rename to src/platform/datascience/progress/kernelProgressReporter.ts diff --git a/src/client/datascience/progress/messages.ts b/src/platform/datascience/progress/messages.ts similarity index 100% rename from src/client/datascience/progress/messages.ts rename to src/platform/datascience/progress/messages.ts diff --git a/src/client/datascience/progress/progressReporter.ts b/src/platform/datascience/progress/progressReporter.ts similarity index 100% rename from src/client/datascience/progress/progressReporter.ts rename to src/platform/datascience/progress/progressReporter.ts diff --git a/src/client/datascience/progress/types.ts b/src/platform/datascience/progress/types.ts similarity index 100% rename from src/client/datascience/progress/types.ts rename to src/platform/datascience/progress/types.ts diff --git a/src/platform/datascience/serviceRegistry.ts b/src/platform/datascience/serviceRegistry.ts new file mode 100644 index 00000000000..0910ba75d9d --- /dev/null +++ b/src/platform/datascience/serviceRegistry.ts @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; +import { IExtensionSingleActivationService, IExtensionSyncActivationService } from '../activation/types'; +import { FileSystemPathUtils } from '../common/platform/fs-paths'; +import { IFileSystemPathUtils } from '../common/platform/types'; +import { IServiceManager } from '../ioc/types'; +import { GitHubIssueCommandListener } from '../logging/gitHubIssueCommandListener'; +import { Activation } from './activation'; +import { CodeCssGenerator } from './codeCssGenerator'; +import { DataScienceStartupTime } from './constants'; +import { DataViewer } from './data-viewing/dataViewer'; +import { DataViewerDependencyService } from './data-viewing/dataViewerDependencyService'; +import { DataViewerFactory } from './data-viewing/dataViewerFactory'; +import { IDataViewer, IDataViewerFactory } from './data-viewing/types'; +import { GlobalActivation } from './datascience'; +import { DebugLocationTrackerFactory } from './debugLocationTrackerFactory'; +import { DataScienceErrorHandler } from '../../platform/errors/errorHandler'; +import { ExportBase } from './export/exportBase'; +import { ExportDialog } from './export/exportDialog'; +import { ExportFileOpener } from './export/exportFileOpener'; +import { ExportInterpreterFinder } from './export/exportInterpreterFinder'; +import { FileConverter } from './export/fileConverter'; +import { ExportToHTML } from './export/exportToHTML'; +import { ExportToPDF } from './export/exportToPDF'; +import { ExportToPython } from './export/exportToPython'; +import { ExportUtil } from './export/exportUtil'; +import { ExportFormat, INbConvertExport, IExportDialog, IFileConverter, IExport } from './export/types'; +import { PlotViewer } from './plotting/plotViewer'; +import { PlotViewerProvider } from './plotting/plotViewerProvider'; +import { StatusProvider } from './statusProvider'; +import { ThemeFinder } from './themeFinder'; +import { ICodeCssGenerator, IDataScience, IDataScienceCommandListener, IDataScienceErrorHandler, IDebugLocationTracker, IPlotViewer, IPlotViewerProvider, IStatusProvider, IThemeFinder } from './types'; +import { NotebookWatcher } from './variablesView/notebookWatcher'; +import { INotebookWatcher, IVariableViewProvider } from './variablesView/types'; +import { VariableViewActivationService } from './variablesView/variableViewActivationService'; +import { VariableViewProvider } from './variablesView/variableViewProvider'; +import { ExtensionRecommendationService } from './extensionRecommendation'; +import { IDebuggingManager } from '../debugger/types'; +import { DebuggingManager } from '../debugger/jupyter/debuggingManager'; +import { ExportToPythonPlain } from './export/exportToPythonPlain'; +import { KernelProgressReporter } from './progress/kernelProgressReporter'; +import { PreReleaseChecker } from './prereleaseChecker'; +import { ProgressReporter } from './progress/progressReporter'; +import { LogReplayService } from '../../intellisense/logReplayService'; + +// eslint-disable-next-line +export function registerTypes(serviceManager: IServiceManager, isDevMode: boolean) { + serviceManager.addSingletonInstance(DataScienceStartupTime, Date.now()); + + // This file should go away soon. + serviceManager.addSingleton(IDataScienceErrorHandler, DataScienceErrorHandler); + serviceManager.add(IDataViewer, DataViewer); + serviceManager.add(IPlotViewer, PlotViewer); + serviceManager.addSingleton(DataViewerDependencyService, DataViewerDependencyService); + serviceManager.addSingleton(ICodeCssGenerator, CodeCssGenerator); + serviceManager.addSingleton(IDataScience, GlobalActivation); + serviceManager.addSingleton(IVariableViewProvider, VariableViewProvider); + serviceManager.addSingleton(IDataScienceCommandListener, GitHubIssueCommandListener); + serviceManager.addSingleton(IDataViewerFactory, DataViewerFactory); + serviceManager.addSingleton(IDebugLocationTracker, DebugLocationTrackerFactory); + serviceManager.addSingleton(IExtensionSingleActivationService, Activation); + serviceManager.addSingleton(IExtensionSingleActivationService, VariableViewActivationService); + if (isDevMode) { + serviceManager.addSingleton(IExtensionSingleActivationService, LogReplayService); + } + serviceManager.addSingleton(IPlotViewerProvider, PlotViewerProvider); + serviceManager.addSingleton(IStatusProvider, StatusProvider); + serviceManager.addSingleton(IThemeFinder, ThemeFinder); + serviceManager.addSingleton(ProgressReporter, ProgressReporter); + serviceManager.addSingleton(IFileConverter, FileConverter); + serviceManager.addSingleton(ExportInterpreterFinder, ExportInterpreterFinder); + serviceManager.addSingleton(ExportFileOpener, ExportFileOpener); + serviceManager.addSingleton(INbConvertExport, ExportToPDF, ExportFormat.pdf); + serviceManager.addSingleton(INbConvertExport, ExportToHTML, ExportFormat.html); + serviceManager.addSingleton(INbConvertExport, ExportToPython, ExportFormat.python); + serviceManager.addSingleton(INbConvertExport, ExportBase, 'Export Base'); + serviceManager.addSingleton(IExport, ExportToPythonPlain, ExportFormat.python); + serviceManager.addSingleton(ExportUtil, ExportUtil); + serviceManager.addSingleton(IExportDialog, ExportDialog); + serviceManager.addSingleton(IFileSystemPathUtils, FileSystemPathUtils); + serviceManager.addSingleton(INotebookWatcher, NotebookWatcher); + serviceManager.addSingleton(IExtensionSyncActivationService, ExtensionRecommendationService); + serviceManager.addSingleton(IExtensionSyncActivationService, KernelProgressReporter); + serviceManager.addSingleton(IDebuggingManager, DebuggingManager, undefined, [IExtensionSingleActivationService]); + serviceManager.addSingleton(IExtensionSingleActivationService, PreReleaseChecker); +} diff --git a/src/client/datascience/shiftEnterBanner.ts b/src/platform/datascience/shiftEnterBanner.ts similarity index 98% rename from src/client/datascience/shiftEnterBanner.ts rename to src/platform/datascience/shiftEnterBanner.ts index de9811261ed..5260d205527 100644 --- a/src/client/datascience/shiftEnterBanner.ts +++ b/src/platform/datascience/shiftEnterBanner.ts @@ -9,7 +9,7 @@ import { IApplicationShell } from '../common/application/types'; import '../common/extensions'; import { IConfigurationService, IJupyterExtensionBanner, IPersistentStateFactory } from '../common/types'; import * as localize from '../common/utils/localize'; -import { captureTelemetry, sendTelemetryEvent } from '../telemetry'; +import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; import { Telemetry } from './constants'; export enum InteractiveShiftEnterStateKeys { diff --git a/src/client/datascience/statusProvider.ts b/src/platform/datascience/statusProvider.ts similarity index 100% rename from src/client/datascience/statusProvider.ts rename to src/platform/datascience/statusProvider.ts diff --git a/src/client/datascience/telemetry/types.ts b/src/platform/datascience/telemetry/types.ts similarity index 100% rename from src/client/datascience/telemetry/types.ts rename to src/platform/datascience/telemetry/types.ts diff --git a/src/client/datascience/themeFinder.ts b/src/platform/datascience/themeFinder.ts similarity index 100% rename from src/client/datascience/themeFinder.ts rename to src/platform/datascience/themeFinder.ts diff --git a/src/client/datascience/types.ts b/src/platform/datascience/types.ts similarity index 99% rename from src/client/datascience/types.ts rename to src/platform/datascience/types.ts index 5e8c088111b..85db1f459ea 100644 --- a/src/client/datascience/types.ts +++ b/src/platform/datascience/types.ts @@ -34,7 +34,7 @@ import { StopWatch } from '../common/utils/stopWatch'; import { PythonEnvironment } from '../pythonEnvironments/info'; import { JupyterCommands } from './constants'; import { IDataViewerDataProvider } from './data-viewing/types'; -import { JupyterInstallError } from '../../extension/errors/jupyterInstallError'; +import { JupyterInstallError } from '../../platform/errors/jupyterInstallError'; import { IKernel, KernelConnectionMetadata } from '../../kernels/types'; import { JupyterServerInfo } from '../../kernels/jupyter/launcher/jupyterConnection'; import { JupyterInterpreterDependencyResponse } from '../../kernels/jupyter/interpreter/jupyterInterpreterDependencyService'; diff --git a/src/client/datascience/utils.ts b/src/platform/datascience/utils.ts similarity index 100% rename from src/client/datascience/utils.ts rename to src/platform/datascience/utils.ts diff --git a/src/client/datascience/variablesView/notebookWatcher.ts b/src/platform/datascience/variablesView/notebookWatcher.ts similarity index 100% rename from src/client/datascience/variablesView/notebookWatcher.ts rename to src/platform/datascience/variablesView/notebookWatcher.ts diff --git a/src/client/datascience/variablesView/types.ts b/src/platform/datascience/variablesView/types.ts similarity index 98% rename from src/client/datascience/variablesView/types.ts rename to src/platform/datascience/variablesView/types.ts index 177393799ca..6e2559789a6 100644 --- a/src/client/datascience/variablesView/types.ts +++ b/src/platform/datascience/variablesView/types.ts @@ -1,6 +1,6 @@ import { Event } from 'vscode'; import { IVariableExplorerHeight } from '../../../datascience-ui/interactive-common/redux/reducers/types'; -import { InteractiveWindowMessages, IShowDataViewer, IFinishCell } from '../../../extension/messageTypes'; +import { InteractiveWindowMessages, IShowDataViewer, IFinishCell } from '../../../platform/messageTypes'; import { IKernel } from '../../../kernels/types'; import { CssMessages, IGetCssRequest, IGetCssResponse, SharedMessages } from '../messages'; import { IJupyterVariablesRequest, IJupyterVariablesResponse, IVSCWebviewViewProvider } from '../types'; diff --git a/src/client/datascience/variablesView/variableView.ts b/src/platform/datascience/variablesView/variableView.ts similarity index 90% rename from src/client/datascience/variablesView/variableView.ts rename to src/platform/datascience/variablesView/variableView.ts index a000307d722..592128b90c7 100644 --- a/src/client/datascience/variablesView/variableView.ts +++ b/src/platform/datascience/variablesView/variableView.ts @@ -3,7 +3,6 @@ 'use strict'; import '../../common/extensions'; -import { injectable, unmanaged } from 'inversify'; import * as path from 'path'; import { WebviewView as vscodeWebviewView } from 'vscode'; @@ -18,7 +17,7 @@ import { EXTENSION_ROOT_DIR } from '../../common/constants'; import { traceError } from '../../common/logger'; import { IConfigurationService, IDisposable, IDisposableRegistry, Resource } from '../../common/types'; import * as localize from '../../common/utils/localize'; -import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; +import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry'; import { Telemetry } from '../constants'; import { IDataViewer, IDataViewerFactory } from '../data-viewing/types'; import { @@ -33,7 +32,7 @@ import { WebviewViewHost } from '../webviews/webviewViewHost'; import { INotebookWatcher, IVariableViewPanelMapping } from './types'; import { VariableViewMessageListener } from './variableViewMessageListener'; import { ContextKey } from '../../common/contextKey'; -import { InteractiveWindowMessages, IShowDataViewer } from '../../../extension/messageTypes'; +import { InteractiveWindowMessages, IShowDataViewer } from '../../../platform/messageTypes'; import { DataViewerChecker } from '../../../webviews/dataviewer/dataViewerChecker'; const variableViewDir = path.join(EXTENSION_ROOT_DIR, 'out', 'datascience-ui', 'viewers'); @@ -41,26 +40,25 @@ const variableViewDir = path.join(EXTENSION_ROOT_DIR, 'out', 'datascience-ui', ' // This is the client side host for the native notebook variable view webview // It handles passing messages to and from the react view as well as the connection // to execution and changing of the active notebook -@injectable() export class VariableView extends WebviewViewHost implements IDisposable { private dataViewerChecker: DataViewerChecker; protected get owningResource(): Resource { return undefined; } constructor( - @unmanaged() configuration: IConfigurationService, - @unmanaged() cssGenerator: ICodeCssGenerator, - @unmanaged() themeFinder: IThemeFinder, - @unmanaged() workspaceService: IWorkspaceService, - @unmanaged() provider: IWebviewViewProvider, - @unmanaged() private readonly variables: IJupyterVariables, - @unmanaged() private readonly disposables: IDisposableRegistry, - @unmanaged() private readonly appShell: IApplicationShell, - @unmanaged() private readonly jupyterVariableDataProviderFactory: IJupyterVariableDataProviderFactory, - @unmanaged() private readonly dataViewerFactory: IDataViewerFactory, - @unmanaged() private readonly notebookWatcher: INotebookWatcher, - @unmanaged() private readonly commandManager: ICommandManager, - @unmanaged() private readonly documentManager: IDocumentManager + configuration: IConfigurationService, + cssGenerator: ICodeCssGenerator, + themeFinder: IThemeFinder, + workspaceService: IWorkspaceService, + provider: IWebviewViewProvider, + private readonly variables: IJupyterVariables, + private readonly disposables: IDisposableRegistry, + private readonly appShell: IApplicationShell, + private readonly jupyterVariableDataProviderFactory: IJupyterVariableDataProviderFactory, + private readonly dataViewerFactory: IDataViewerFactory, + private readonly notebookWatcher: INotebookWatcher, + private readonly commandManager: ICommandManager, + private readonly documentManager: IDocumentManager ) { super( configuration, diff --git a/src/client/datascience/variablesView/variableViewActivationService.ts b/src/platform/datascience/variablesView/variableViewActivationService.ts similarity index 100% rename from src/client/datascience/variablesView/variableViewActivationService.ts rename to src/platform/datascience/variablesView/variableViewActivationService.ts diff --git a/src/client/datascience/variablesView/variableViewMessageListener.ts b/src/platform/datascience/variablesView/variableViewMessageListener.ts similarity index 100% rename from src/client/datascience/variablesView/variableViewMessageListener.ts rename to src/platform/datascience/variablesView/variableViewMessageListener.ts diff --git a/src/client/datascience/variablesView/variableViewProvider.ts b/src/platform/datascience/variablesView/variableViewProvider.ts similarity index 100% rename from src/client/datascience/variablesView/variableViewProvider.ts rename to src/platform/datascience/variablesView/variableViewProvider.ts diff --git a/src/client/datascience/webviews/webviewHost.ts b/src/platform/datascience/webviews/webviewHost.ts similarity index 95% rename from src/client/datascience/webviews/webviewHost.ts rename to src/platform/datascience/webviews/webviewHost.ts index eea3d1c5a70..07f6ead0c1f 100644 --- a/src/client/datascience/webviews/webviewHost.ts +++ b/src/platform/datascience/webviews/webviewHost.ts @@ -5,7 +5,6 @@ import '../../common/extensions'; -import { injectable, unmanaged } from 'inversify'; import { ConfigurationChangeEvent, EventEmitter, @@ -23,15 +22,14 @@ import { IConfigurationService, IDisposable, Resource } from '../../common/types import { createDeferred, Deferred } from '../../common/utils/async'; import * as localize from '../../common/utils/localize'; import { StopWatch } from '../../common/utils/stopWatch'; -import { captureTelemetry, sendTelemetryEvent } from '../../telemetry'; +import { captureTelemetry, sendTelemetryEvent } from '../../../telemetry'; import { DefaultTheme, PythonExtension, Telemetry } from '../constants'; import { CssMessages, IGetCssRequest, SharedMessages } from '../messages'; import { ICodeCssGenerator, IJupyterExtraSettings, IThemeFinder } from '../types'; import { testOnlyMethod } from '../../common/utils/decorators'; -import { InteractiveWindowMessages } from '../../../extension/messageTypes'; +import { InteractiveWindowMessages } from '../../../platform/messageTypes'; /* eslint-disable @typescript-eslint/no-explicit-any */ -@injectable() // For some reason this is necessary to get the class hierarchy to work. export abstract class WebviewHost implements IDisposable { protected abstract get owningResource(): Resource; @@ -61,12 +59,12 @@ export abstract class WebviewHost implements IDisposable { protected _onDidDisposeWebviewPanel = new EventEmitter(); constructor( - @unmanaged() protected configService: IConfigurationService, - @unmanaged() private cssGenerator: ICodeCssGenerator, - @unmanaged() protected themeFinder: IThemeFinder, - @unmanaged() protected workspaceService: IWorkspaceService, - @unmanaged() protected rootPath: string, - @unmanaged() protected scripts: string[] + protected configService: IConfigurationService, + private cssGenerator: ICodeCssGenerator, + protected themeFinder: IThemeFinder, + protected workspaceService: IWorkspaceService, + protected rootPath: string, + protected scripts: string[] ) { // Listen for settings changes from vscode. this._disposables.push(this.workspaceService.onDidChangeConfiguration(this.onPossibleSettingsChange, this)); diff --git a/src/client/datascience/webviews/webviewPanelHost.ts b/src/platform/datascience/webviews/webviewPanelHost.ts similarity index 85% rename from src/client/datascience/webviews/webviewPanelHost.ts rename to src/platform/datascience/webviews/webviewPanelHost.ts index 4b1dbc2e10f..63d821d75fe 100644 --- a/src/client/datascience/webviews/webviewPanelHost.ts +++ b/src/platform/datascience/webviews/webviewPanelHost.ts @@ -3,7 +3,6 @@ 'use strict'; import '../../common/extensions'; -import { injectable, unmanaged } from 'inversify'; import { ViewColumn, WebviewPanel as vscodeWebviewPanel } from 'vscode'; import { @@ -18,7 +17,6 @@ import { noop } from '../../common/utils/misc'; import { ICodeCssGenerator, IJupyterExtraSettings, IThemeFinder, WebViewViewChangeEventArgs } from '../types'; import { WebviewHost } from './webviewHost'; -@injectable() // For some reason this is necessary to get the class hierarchy to work. export abstract class WebviewPanelHost extends WebviewHost implements IDisposable { protected get isDisposed(): boolean { return this.disposed; @@ -34,21 +32,20 @@ export abstract class WebviewPanelHost extends WebviewHost i private messageListener: IWebviewPanelMessageListener; constructor( - @unmanaged() protected configService: IConfigurationService, - @unmanaged() private provider: IWebviewPanelProvider, - @unmanaged() cssGenerator: ICodeCssGenerator, - @unmanaged() protected themeFinder: IThemeFinder, - @unmanaged() protected workspaceService: IWorkspaceService, - @unmanaged() + protected configService: IConfigurationService, + private provider: IWebviewPanelProvider, + cssGenerator: ICodeCssGenerator, + protected themeFinder: IThemeFinder, + protected workspaceService: IWorkspaceService, messageListenerCtor: ( callback: (message: string, payload: {}) => void, viewChanged: (panel: IWebviewPanel) => void, disposed: () => void ) => IWebviewPanelMessageListener, - @unmanaged() rootPath: string, - @unmanaged() scripts: string[], - @unmanaged() private _title: string, - @unmanaged() private viewColumn: ViewColumn + rootPath: string, + scripts: string[], + private _title: string, + private viewColumn: ViewColumn ) { super(configService, cssGenerator, themeFinder, workspaceService, rootPath, scripts); diff --git a/src/client/datascience/webviews/webviewViewHost.ts b/src/platform/datascience/webviews/webviewViewHost.ts similarity index 79% rename from src/client/datascience/webviews/webviewViewHost.ts rename to src/platform/datascience/webviews/webviewViewHost.ts index 1b3ff19e815..b1a51b4c7eb 100644 --- a/src/client/datascience/webviews/webviewViewHost.ts +++ b/src/platform/datascience/webviews/webviewViewHost.ts @@ -3,7 +3,6 @@ 'use strict'; import '../../common/extensions'; -import { injectable, unmanaged } from 'inversify'; import { WebviewView as vscodeWebviewView } from 'vscode'; import { @@ -17,7 +16,6 @@ import { IConfigurationService, IDisposable, Resource } from '../../common/types import { ICodeCssGenerator, IJupyterExtraSettings, IThemeFinder } from '../types'; import { WebviewHost } from './webviewHost'; -@injectable() // For some reason this is necessary to get the class hierarchy to work. export abstract class WebviewViewHost extends WebviewHost implements IDisposable { protected get isDisposed(): boolean { return this.disposed; @@ -31,18 +29,17 @@ export abstract class WebviewViewHost extends WebviewHost im private messageListener: IWebviewViewMessageListener; constructor( - @unmanaged() protected configService: IConfigurationService, - @unmanaged() cssGenerator: ICodeCssGenerator, - @unmanaged() protected themeFinder: IThemeFinder, - @unmanaged() protected workspaceService: IWorkspaceService, - @unmanaged() + protected configService: IConfigurationService, + cssGenerator: ICodeCssGenerator, + protected themeFinder: IThemeFinder, + protected workspaceService: IWorkspaceService, messageListenerCtor: ( callback: (message: string, payload: {}) => void, disposed: () => void ) => IWebviewViewMessageListener, - @unmanaged() protected provider: IWebviewViewProvider, - @unmanaged() rootPath: string, - @unmanaged() scripts: string[] + protected provider: IWebviewViewProvider, + rootPath: string, + scripts: string[] ) { super(configService, cssGenerator, themeFinder, workspaceService, rootPath, scripts); diff --git a/src/client/debugger/constants.ts b/src/platform/debugger/constants.ts similarity index 100% rename from src/client/debugger/constants.ts rename to src/platform/debugger/constants.ts diff --git a/src/client/debugger/extension/helpers/protocolParser.ts b/src/platform/debugger/extension/helpers/protocolParser.ts similarity index 100% rename from src/client/debugger/extension/helpers/protocolParser.ts rename to src/platform/debugger/extension/helpers/protocolParser.ts diff --git a/src/client/debugger/extension/types.ts b/src/platform/debugger/extension/types.ts similarity index 100% rename from src/client/debugger/extension/types.ts rename to src/platform/debugger/extension/types.ts diff --git a/src/client/debugger/jupyter/debugControllers.ts b/src/platform/debugger/jupyter/debugControllers.ts similarity index 99% rename from src/client/debugger/jupyter/debugControllers.ts rename to src/platform/debugger/jupyter/debugControllers.ts index 0378a528b3a..bc29339a330 100644 --- a/src/client/debugger/jupyter/debugControllers.ts +++ b/src/platform/debugger/jupyter/debugControllers.ts @@ -11,7 +11,7 @@ import { IConfigurationService } from '../../common/types'; import { noop } from '../../common/utils/misc'; import { Commands } from '../../datascience/constants'; import { IKernel } from '../../../kernels/types'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { DebuggingTelemetry } from '../constants'; import { IDebuggingDelegate, IKernelDebugAdapter, KernelDebugMode } from '../types'; diff --git a/src/client/debugger/jupyter/debugger.ts b/src/platform/debugger/jupyter/debugger.ts similarity index 100% rename from src/client/debugger/jupyter/debugger.ts rename to src/platform/debugger/jupyter/debugger.ts diff --git a/src/client/debugger/jupyter/debuggingManager.ts b/src/platform/debugger/jupyter/debuggingManager.ts similarity index 99% rename from src/client/debugger/jupyter/debuggingManager.ts rename to src/platform/debugger/jupyter/debuggingManager.ts index e5ff5dffec0..1e3d22a2a45 100644 --- a/src/client/debugger/jupyter/debuggingManager.ts +++ b/src/platform/debugger/jupyter/debuggingManager.ts @@ -31,7 +31,7 @@ import { Commands as DSCommands } from '../../datascience/constants'; import { IFileSystem, IPlatformService } from '../../common/platform/types'; import { IDebuggingManager, IKernelDebugAdapterConfig, KernelDebugMode } from '../types'; import { DebuggingTelemetry, pythonKernelDebugAdapter } from '../constants'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { DebugCellController, RunByLineController } from './debugControllers'; import { assertIsDebugConfig, IpykernelCheckResult, isUsingIpykernel6OrLater } from './helper'; import { Debugger } from './debugger'; diff --git a/src/client/debugger/jupyter/helper.ts b/src/platform/debugger/jupyter/helper.ts similarity index 100% rename from src/client/debugger/jupyter/helper.ts rename to src/platform/debugger/jupyter/helper.ts diff --git a/src/client/debugger/jupyter/kernelDebugAdapter.ts b/src/platform/debugger/jupyter/kernelDebugAdapter.ts similarity index 99% rename from src/client/debugger/jupyter/kernelDebugAdapter.ts rename to src/platform/debugger/jupyter/kernelDebugAdapter.ts index eed236b77b4..098aa208bdd 100644 --- a/src/client/debugger/jupyter/kernelDebugAdapter.ts +++ b/src/platform/debugger/jupyter/kernelDebugAdapter.ts @@ -26,7 +26,7 @@ import { IFileSystem, IPlatformService } from '../../common/platform/types'; import { IDisposable } from '../../common/types'; import { IKernel } from '../../../kernels/types'; import { IJupyterSession } from '../../datascience/types'; -import { sendTelemetryEvent } from '../../telemetry'; +import { sendTelemetryEvent } from '../../../telemetry'; import { DebuggingTelemetry } from '../constants'; import { IDebuggingDelegate, diff --git a/src/client/debugger/types.ts b/src/platform/debugger/types.ts similarity index 100% rename from src/client/debugger/types.ts rename to src/platform/debugger/types.ts diff --git a/src/client/datascience/devTools/README.md b/src/platform/devTools/README.md similarity index 100% rename from src/client/datascience/devTools/README.md rename to src/platform/devTools/README.md diff --git a/src/client/datascience/devTools/clearCache.ts b/src/platform/devTools/clearCache.ts similarity index 91% rename from src/client/datascience/devTools/clearCache.ts rename to src/platform/devTools/clearCache.ts index 07c5407fbbe..7dc78fe2cd3 100644 --- a/src/client/datascience/devTools/clearCache.ts +++ b/src/platform/devTools/clearCache.ts @@ -1,5 +1,5 @@ import { commands } from 'vscode'; -import { IExtensionContext } from '../../common/types'; +import { IExtensionContext } from '../common/types'; export function addClearCacheCommand(context: IExtensionContext, isDevMode: boolean) { if (!isDevMode) { diff --git a/src/client/datascience/devTools/jupyterOutputChannel.ts b/src/platform/devTools/jupyterOutputChannel.ts similarity index 92% rename from src/client/datascience/devTools/jupyterOutputChannel.ts rename to src/platform/devTools/jupyterOutputChannel.ts index 0467ea47d5c..054e299cafb 100644 --- a/src/client/datascience/devTools/jupyterOutputChannel.ts +++ b/src/platform/devTools/jupyterOutputChannel.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. import { window, workspace } from 'vscode'; -import { IDisposableRegistry, IOutputChannel } from '../../common/types'; -import * as localize from '../../common/utils/localize'; +import { IDisposableRegistry, IOutputChannel } from '../common/types'; +import * as localize from '../common/utils/localize'; /** * Returns the output panel for output related to Jupyter Server. diff --git a/src/platform/devTools/serviceRegistry.ts b/src/platform/devTools/serviceRegistry.ts new file mode 100644 index 00000000000..af0d74cc293 --- /dev/null +++ b/src/platform/devTools/serviceRegistry.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; + +import { IExtensionContext } from '../common/types'; +import { IServiceManager } from '../ioc/types'; +import { addClearCacheCommand } from './clearCache'; + +export function registerTypes(context: IExtensionContext, _serviceManager: IServiceManager, isDevMode: boolean) { + addClearCacheCommand(context, isDevMode); +} diff --git a/src/extension/errors/errorHandler.ts b/src/platform/errors/errorHandler.ts similarity index 96% rename from src/extension/errors/errorHandler.ts rename to src/platform/errors/errorHandler.ts index 87c35f4d055..89b1f96795b 100644 --- a/src/extension/errors/errorHandler.ts +++ b/src/platform/errors/errorHandler.ts @@ -14,18 +14,18 @@ import { KernelConnectionTimeoutError } from './kernelConnectionTimeoutError'; import { KernelDiedError } from './kernelDiedError'; import { KernelPortNotUsedTimeoutError } from './kernelPortNotUsedTimeoutError'; import { KernelProcessExitedError } from './kernelProcessExitedError'; -import { IApplicationShell, IWorkspaceService } from '../../client/common/application/types'; -import { traceWarning } from '../../client/common/logger'; -import { IBrowserService, IConfigurationService, Resource } from '../../client/common/types'; -import { DataScience, Common } from '../../client/common/utils/localize'; -import { DisplayOptions } from '../../client/datascience/displayOptions'; +import { IApplicationShell, IWorkspaceService } from '../../platform/common/application/types'; +import { traceWarning } from '../../platform/common/logger'; +import { IBrowserService, IConfigurationService, Resource } from '../../platform/common/types'; +import { DataScience, Common } from '../../platform/common/utils/localize'; +import { DisplayOptions } from '../../platform/datascience/displayOptions'; import { IDataScienceErrorHandler, IJupyterInterpreterDependencyManager, IKernelDependencyService, KernelInterpreterDependencyResponse -} from '../../client/datascience/types'; -import { sendTelemetryEvent } from '../../client/telemetry'; +} from '../../platform/datascience/types'; +import { sendTelemetryEvent } from '../../telemetry'; import { Telemetry, Commands } from '../../datascience-ui/common/constants'; import { getDisplayNameOrNameOfKernelConnection } from '../../kernels/helpers'; import { translateProductToModule } from '../../kernels/installer/moduleInstaller'; @@ -37,8 +37,8 @@ import { analyzeKernelErrors, KernelFailureReason, getErrorMessageFromPythonTrac import { JupyterConnectError } from './jupyterConnectError'; import { JupyterKernelDependencyError } from './jupyterKernelDependencyError'; import { WrappedError, BaseKernelError, WrappedKernelError, BaseError } from './types'; -import { noop } from '../../client/common/utils/misc'; -import { EnvironmentType } from '../../client/pythonEnvironments/info'; +import { noop } from '../../platform/common/utils/misc'; +import { EnvironmentType } from '../../platform/pythonEnvironments/info'; import { KernelDeadError } from './kernelDeadError'; @injectable() diff --git a/src/extension/errors/errorUtils.ts b/src/platform/errors/errorUtils.ts similarity index 99% rename from src/extension/errors/errorUtils.ts rename to src/platform/errors/errorUtils.ts index 019b3bb76be..b0dec3cf41f 100644 --- a/src/extension/errors/errorUtils.ts +++ b/src/platform/errors/errorUtils.ts @@ -8,8 +8,8 @@ import { NotebookCellOutputItem, WorkspaceFolder } from 'vscode'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; -import { DataScience } from '../../client/common/utils/localize'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; +import { DataScience } from '../../platform/common/utils/localize'; import { JupyterConnectError } from './jupyterConnectError'; import { BaseError } from './types'; diff --git a/src/extension/errors/errors.ts b/src/platform/errors/errors.ts similarity index 100% rename from src/extension/errors/errors.ts rename to src/platform/errors/errors.ts diff --git a/src/extension/errors/index.ts b/src/platform/errors/index.ts similarity index 97% rename from src/extension/errors/index.ts rename to src/platform/errors/index.ts index 212d4f7494b..f20fe6eed00 100644 --- a/src/extension/errors/index.ts +++ b/src/platform/errors/index.ts @@ -3,7 +3,7 @@ import { FetchError } from 'node-fetch'; import * as stackTrace from 'stack-trace'; -import { getTelemetrySafeHashedString } from '../../client/telemetry/helpers'; +import { getTelemetrySafeHashedString } from '../../telemetry/helpers'; import { getErrorTags } from './errors'; import { getLastFrameFromPythonTraceback } from './errorUtils'; import { BaseError, getErrorCategory, TelemetryErrorProperties, WrappedError } from './types'; diff --git a/src/extension/errors/interactiveCellResultError.ts b/src/platform/errors/interactiveCellResultError.ts similarity index 100% rename from src/extension/errors/interactiveCellResultError.ts rename to src/platform/errors/interactiveCellResultError.ts diff --git a/src/extension/errors/jupyterConnectError.ts b/src/platform/errors/jupyterConnectError.ts similarity index 100% rename from src/extension/errors/jupyterConnectError.ts rename to src/platform/errors/jupyterConnectError.ts diff --git a/src/extension/errors/jupyterDataRateLimitError.ts b/src/platform/errors/jupyterDataRateLimitError.ts similarity index 81% rename from src/extension/errors/jupyterDataRateLimitError.ts rename to src/platform/errors/jupyterDataRateLimitError.ts index ab38fde8fd8..ba88f4f116c 100644 --- a/src/extension/errors/jupyterDataRateLimitError.ts +++ b/src/platform/errors/jupyterDataRateLimitError.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. 'use strict'; -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { BaseError } from './types'; export class JupyterDataRateLimitError extends BaseError { diff --git a/src/extension/errors/jupyterDebuggerNotInstalledError.ts b/src/platform/errors/jupyterDebuggerNotInstalledError.ts similarity index 89% rename from src/extension/errors/jupyterDebuggerNotInstalledError.ts rename to src/platform/errors/jupyterDebuggerNotInstalledError.ts index ec785202211..9c973242dac 100644 --- a/src/extension/errors/jupyterDebuggerNotInstalledError.ts +++ b/src/platform/errors/jupyterDebuggerNotInstalledError.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. 'use strict'; -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { KernelConnectionMetadata } from '../../kernels/types'; import { BaseKernelError } from './types'; diff --git a/src/extension/errors/jupyterDebuggerRemoteNotSupportedError.ts b/src/platform/errors/jupyterDebuggerRemoteNotSupportedError.ts similarity index 87% rename from src/extension/errors/jupyterDebuggerRemoteNotSupportedError.ts rename to src/platform/errors/jupyterDebuggerRemoteNotSupportedError.ts index 93929775122..0f9e9c9b511 100644 --- a/src/extension/errors/jupyterDebuggerRemoteNotSupportedError.ts +++ b/src/platform/errors/jupyterDebuggerRemoteNotSupportedError.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. 'use strict'; -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { KernelConnectionMetadata } from '../../kernels/types'; import { BaseKernelError } from './types'; diff --git a/src/extension/errors/jupyterInstallError.ts b/src/platform/errors/jupyterInstallError.ts similarity index 100% rename from src/extension/errors/jupyterInstallError.ts rename to src/platform/errors/jupyterInstallError.ts diff --git a/src/extension/errors/jupyterInvalidKernelError.ts b/src/platform/errors/jupyterInvalidKernelError.ts similarity index 85% rename from src/extension/errors/jupyterInvalidKernelError.ts rename to src/platform/errors/jupyterInvalidKernelError.ts index 7a8452a039e..016155351fc 100644 --- a/src/extension/errors/jupyterInvalidKernelError.ts +++ b/src/platform/errors/jupyterInvalidKernelError.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { DataScience } from '../../client/common/utils/localize'; -import { sendTelemetryEvent } from '../../client/telemetry'; +import { DataScience } from '../../platform/common/utils/localize'; +import { sendTelemetryEvent } from '../../telemetry'; import { Telemetry } from '../../datascience-ui/common/constants'; import { getDisplayNameOrNameOfKernelConnection } from '../../kernels/helpers'; import { KernelConnectionMetadata } from '../../kernels/types'; diff --git a/src/extension/errors/jupyterKernelDependencyError.ts b/src/platform/errors/jupyterKernelDependencyError.ts similarity index 82% rename from src/extension/errors/jupyterKernelDependencyError.ts rename to src/platform/errors/jupyterKernelDependencyError.ts index 66602fd233f..49e13259f08 100644 --- a/src/extension/errors/jupyterKernelDependencyError.ts +++ b/src/platform/errors/jupyterKernelDependencyError.ts @@ -3,8 +3,8 @@ 'use strict'; -import { DataScience } from '../../client/common/utils/localize'; -import { KernelInterpreterDependencyResponse } from '../../client/datascience/types'; +import { DataScience } from '../../platform/common/utils/localize'; +import { KernelInterpreterDependencyResponse } from '../../platform/datascience/types'; import { getDisplayNameOrNameOfKernelConnection } from '../../kernels/helpers'; import { KernelConnectionMetadata } from '../../kernels/types'; import { BaseKernelError } from './types'; diff --git a/src/extension/errors/jupyterSelfCertsError.ts b/src/platform/errors/jupyterSelfCertsError.ts similarity index 100% rename from src/extension/errors/jupyterSelfCertsError.ts rename to src/platform/errors/jupyterSelfCertsError.ts diff --git a/src/extension/errors/jupyterWaitForIdleError.ts b/src/platform/errors/jupyterWaitForIdleError.ts similarity index 81% rename from src/extension/errors/jupyterWaitForIdleError.ts rename to src/platform/errors/jupyterWaitForIdleError.ts index 95dee0db6c9..e3455c8c5a2 100644 --- a/src/extension/errors/jupyterWaitForIdleError.ts +++ b/src/platform/errors/jupyterWaitForIdleError.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. 'use strict'; -import { DataScience } from '../../client/common/utils/localize'; -import { sendTelemetryEvent } from '../../client/telemetry'; +import { DataScience } from '../../platform/common/utils/localize'; +import { sendTelemetryEvent } from '../../telemetry'; import { Telemetry } from '../../datascience-ui/common/constants'; import { KernelConnectionMetadata } from '../../kernels/types'; import { BaseKernelError } from './types'; diff --git a/src/extension/errors/kernelConnectionTimeoutError.ts b/src/platform/errors/kernelConnectionTimeoutError.ts similarity index 90% rename from src/extension/errors/kernelConnectionTimeoutError.ts rename to src/platform/errors/kernelConnectionTimeoutError.ts index 27d0721c2aa..01042b257cc 100644 --- a/src/extension/errors/kernelConnectionTimeoutError.ts +++ b/src/platform/errors/kernelConnectionTimeoutError.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { getDisplayNameOrNameOfKernelConnection } from '../../kernels/helpers'; import { KernelConnectionMetadata } from '../../kernels/types'; import { BaseKernelError } from './types'; diff --git a/src/extension/errors/kernelDeadError.ts b/src/platform/errors/kernelDeadError.ts similarity index 90% rename from src/extension/errors/kernelDeadError.ts rename to src/platform/errors/kernelDeadError.ts index ebc8d973247..25e59de28aa 100644 --- a/src/extension/errors/kernelDeadError.ts +++ b/src/platform/errors/kernelDeadError.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { getDisplayNameOrNameOfKernelConnection } from '../../kernels/helpers'; import { KernelConnectionMetadata } from '../../kernels/types'; import { WrappedKernelError } from './types'; diff --git a/src/extension/errors/kernelDiedError.ts b/src/platform/errors/kernelDiedError.ts similarity index 100% rename from src/extension/errors/kernelDiedError.ts rename to src/platform/errors/kernelDiedError.ts diff --git a/src/extension/errors/kernelInterruptTimeoutError.ts b/src/platform/errors/kernelInterruptTimeoutError.ts similarity index 86% rename from src/extension/errors/kernelInterruptTimeoutError.ts rename to src/platform/errors/kernelInterruptTimeoutError.ts index 81a5fdda243..64e58a7c28a 100644 --- a/src/extension/errors/kernelInterruptTimeoutError.ts +++ b/src/platform/errors/kernelInterruptTimeoutError.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { KernelConnectionMetadata } from '../../kernels/types'; import { BaseKernelError } from './types'; diff --git a/src/extension/errors/kernelPortNotUsedTimeoutError.ts b/src/platform/errors/kernelPortNotUsedTimeoutError.ts similarity index 90% rename from src/extension/errors/kernelPortNotUsedTimeoutError.ts rename to src/platform/errors/kernelPortNotUsedTimeoutError.ts index 5a0e3e49e42..9572cfc3ed8 100644 --- a/src/extension/errors/kernelPortNotUsedTimeoutError.ts +++ b/src/platform/errors/kernelPortNotUsedTimeoutError.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { getDisplayNameOrNameOfKernelConnection } from '../../kernels/helpers'; import { KernelConnectionMetadata } from '../../kernels/types'; import { BaseKernelError } from './types'; diff --git a/src/extension/errors/kernelProcessExitedError.ts b/src/platform/errors/kernelProcessExitedError.ts similarity index 89% rename from src/extension/errors/kernelProcessExitedError.ts rename to src/platform/errors/kernelProcessExitedError.ts index 5f5442c16f8..b3df931c9d9 100644 --- a/src/extension/errors/kernelProcessExitedError.ts +++ b/src/platform/errors/kernelProcessExitedError.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { KernelConnectionMetadata } from '../../kernels/types'; import { BaseKernelError } from './types'; diff --git a/src/extension/errors/moduleNotInstalledError.ts b/src/platform/errors/moduleNotInstalledError.ts similarity index 100% rename from src/extension/errors/moduleNotInstalledError.ts rename to src/platform/errors/moduleNotInstalledError.ts diff --git a/src/extension/errors/sessionDisposedError.ts b/src/platform/errors/sessionDisposedError.ts similarity index 80% rename from src/extension/errors/sessionDisposedError.ts rename to src/platform/errors/sessionDisposedError.ts index df417499e90..3f24452e754 100644 --- a/src/extension/errors/sessionDisposedError.ts +++ b/src/platform/errors/sessionDisposedError.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { DataScience } from '../../client/common/utils/localize'; +import { DataScience } from '../../platform/common/utils/localize'; import { BaseError } from './types'; export class SessionDisposedError extends BaseError { diff --git a/src/extension/errors/types.ts b/src/platform/errors/types.ts similarity index 100% rename from src/extension/errors/types.ts rename to src/platform/errors/types.ts diff --git a/src/client/interpreter/activation/types.ts b/src/platform/interpreter/activation/types.ts similarity index 100% rename from src/client/interpreter/activation/types.ts rename to src/platform/interpreter/activation/types.ts diff --git a/src/client/interpreter/configuration/types.ts b/src/platform/interpreter/configuration/types.ts similarity index 100% rename from src/client/interpreter/configuration/types.ts rename to src/platform/interpreter/configuration/types.ts diff --git a/src/client/interpreter/contracts.ts b/src/platform/interpreter/contracts.ts similarity index 100% rename from src/client/interpreter/contracts.ts rename to src/platform/interpreter/contracts.ts diff --git a/src/client/interpreter/display/visibilityFilter.ts b/src/platform/interpreter/display/visibilityFilter.ts similarity index 100% rename from src/client/interpreter/display/visibilityFilter.ts rename to src/platform/interpreter/display/visibilityFilter.ts diff --git a/src/client/ioc/container.ts b/src/platform/ioc/container.ts similarity index 100% rename from src/client/ioc/container.ts rename to src/platform/ioc/container.ts diff --git a/src/client/ioc/index.ts b/src/platform/ioc/index.ts similarity index 100% rename from src/client/ioc/index.ts rename to src/platform/ioc/index.ts diff --git a/src/client/ioc/serviceManager.ts b/src/platform/ioc/serviceManager.ts similarity index 95% rename from src/client/ioc/serviceManager.ts rename to src/platform/ioc/serviceManager.ts index e5b7dcb494f..a6fea44f85b 100644 --- a/src/client/ioc/serviceManager.ts +++ b/src/platform/ioc/serviceManager.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { Container, injectable, interfaces } from 'inversify'; +import { testOnlyMethod } from '../common/utils/decorators'; import { Abstract, ClassType, IServiceManager, Newable } from './types'; @@ -8,7 +9,11 @@ type identifier = string | symbol | Newable | Abstract; @injectable() export class ServiceManager implements IServiceManager { - constructor(private container: Container) {} + @testOnlyMethod() + public getContainer() { + return this.container; + } + constructor(private readonly container: Container) {} public add( serviceIdentifier: identifier, // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/client/ioc/types.ts b/src/platform/ioc/types.ts similarity index 96% rename from src/client/ioc/types.ts rename to src/platform/ioc/types.ts index d3f32c1e473..ee256e5c735 100644 --- a/src/client/ioc/types.ts +++ b/src/platform/ioc/types.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { interfaces } from 'inversify'; +import { Container, interfaces } from 'inversify'; import { IDisposable } from '../common/types'; /* eslint-disable @typescript-eslint/prefer-function-type */ @@ -67,6 +67,7 @@ export interface IServiceManager extends IDisposable { instance: T, name?: string | number | symbol ): void; + getContainer(): Container; // For testing } export const IServiceContainer = Symbol('IServiceContainer'); diff --git a/src/client/language/languageConfiguration.ts b/src/platform/language/languageConfiguration.ts similarity index 100% rename from src/client/language/languageConfiguration.ts rename to src/platform/language/languageConfiguration.ts diff --git a/src/client/logging/_global.ts b/src/platform/logging/_global.ts similarity index 100% rename from src/client/logging/_global.ts rename to src/platform/logging/_global.ts diff --git a/src/client/logging/formatters.ts b/src/platform/logging/formatters.ts similarity index 100% rename from src/client/logging/formatters.ts rename to src/platform/logging/formatters.ts diff --git a/src/client/logging/gitHubIssueCodeLensProvider.ts b/src/platform/logging/gitHubIssueCodeLensProvider.ts similarity index 100% rename from src/client/logging/gitHubIssueCodeLensProvider.ts rename to src/platform/logging/gitHubIssueCodeLensProvider.ts diff --git a/src/client/logging/gitHubIssueCommandListener.ts b/src/platform/logging/gitHubIssueCommandListener.ts similarity index 100% rename from src/client/logging/gitHubIssueCommandListener.ts rename to src/platform/logging/gitHubIssueCommandListener.ts diff --git a/src/client/logging/index.ts b/src/platform/logging/index.ts similarity index 100% rename from src/client/logging/index.ts rename to src/platform/logging/index.ts diff --git a/src/client/logging/levels.ts b/src/platform/logging/levels.ts similarity index 93% rename from src/client/logging/levels.ts rename to src/platform/logging/levels.ts index c0982dd3c28..f7bfd663e4b 100644 --- a/src/client/logging/levels.ts +++ b/src/platform/logging/levels.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. 'use strict'; -// IMPORTANT: This file should only be importing from the '../client/logging' directory, as we -// delete everything in '../client' except for '../client/logging' before running smoke tests. +// IMPORTANT: This file should only be importing from the '../platform/logging' directory, as we +// delete everything in '../platform' except for '../platform/logging' before running smoke tests. import * as winston from 'winston'; diff --git a/src/client/logging/logger.ts b/src/platform/logging/logger.ts similarity index 93% rename from src/client/logging/logger.ts rename to src/platform/logging/logger.ts index ac23f1d7976..7d7efe0b8e1 100644 --- a/src/client/logging/logger.ts +++ b/src/platform/logging/logger.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. 'use strict'; -// IMPORTANT: This file should only be importing from the '../client/logging' directory, as we -// delete everything in '../client' except for '../client/logging' before running smoke tests. +// IMPORTANT: This file should only be importing from the '../platform/logging' directory, as we +// delete everything in '../platform' except for '../platform/logging' before running smoke tests. import * as util from 'util'; import * as winston from 'winston'; @@ -43,7 +43,7 @@ interface IConfigurableLogger { // eslint-disable-next-line /** * TODO: We should actually have this method in `./_global.ts` as this is exported globally. - * But for some reason, importing '../client/logging/_global' fails when launching the tests. + * But for some reason, importing '../platform/logging/_global' fails when launching the tests. * More details in the comment https://github.com/microsoft/vscode-python/pull/11897#discussion_r433954993 * https://github.com/microsoft/vscode-python/issues/12137 */ diff --git a/src/client/logging/serviceRegistry.ts b/src/platform/logging/serviceRegistry.ts similarity index 100% rename from src/client/logging/serviceRegistry.ts rename to src/platform/logging/serviceRegistry.ts diff --git a/src/client/logging/trace.ts b/src/platform/logging/trace.ts similarity index 99% rename from src/client/logging/trace.ts rename to src/platform/logging/trace.ts index da109093521..2bb04c90650 100644 --- a/src/client/logging/trace.ts +++ b/src/platform/logging/trace.ts @@ -5,7 +5,7 @@ import type { Uri } from 'vscode'; import { CallInfo, trace as traceDecorator } from '../common/utils/decorators'; import { TraceInfo, tracing as _tracing } from '../common/utils/misc'; -import { sendTelemetryEvent } from '../telemetry'; +import { sendTelemetryEvent } from '../../telemetry'; import { LogLevel } from './levels'; import { ILogger, logToAll } from './logger'; import { argsToLogString, returnValueToLogString } from './util'; diff --git a/src/client/logging/transports.ts b/src/platform/logging/transports.ts similarity index 95% rename from src/client/logging/transports.ts rename to src/platform/logging/transports.ts index f96be912b11..2d60a39c3ae 100644 --- a/src/client/logging/transports.ts +++ b/src/platform/logging/transports.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. 'use strict'; -// IMPORTANT: This file should only be importing from the '../client/logging' directory, as we -// delete everything in '../client' except for '../client/logging' before running smoke tests. +// IMPORTANT: This file should only be importing from the '../platform/logging' directory, as we +// delete everything in '../platform' except for '../platform/logging' before running smoke tests. import * as logform from 'logform'; import * as path from 'path'; diff --git a/src/client/logging/util.ts b/src/platform/logging/util.ts similarity index 100% rename from src/client/logging/util.ts rename to src/platform/logging/util.ts diff --git a/src/extension/messageTypes.ts b/src/platform/messageTypes.ts similarity index 99% rename from src/extension/messageTypes.ts rename to src/platform/messageTypes.ts index 895c8915142..98bcdf75144 100644 --- a/src/extension/messageTypes.ts +++ b/src/platform/messageTypes.ts @@ -3,14 +3,14 @@ 'use strict'; import { Uri } from 'vscode'; import type { KernelMessage } from '@jupyterlab/services'; -import { CssMessages, IGetCssRequest, IGetCssResponse, SharedMessages } from '../client/datascience/messages'; +import { CssMessages, IGetCssRequest, IGetCssResponse, SharedMessages } from '../platform/datascience/messages'; import { IJupyterVariable, KernelSocketOptions, IJupyterVariablesRequest, IJupyterVariablesResponse, ICell -} from '../client/datascience/types'; +} from '../platform/datascience/types'; import { NativeKeyboardCommandTelemetry, NativeMouseCommandTelemetry } from '../datascience-ui/common/constants'; import { IVariableExplorerHeight, diff --git a/src/client/pythonEnvironments/exec.ts b/src/platform/pythonEnvironments/exec.ts similarity index 100% rename from src/client/pythonEnvironments/exec.ts rename to src/platform/pythonEnvironments/exec.ts diff --git a/src/client/pythonEnvironments/info/executable.ts b/src/platform/pythonEnvironments/info/executable.ts similarity index 100% rename from src/client/pythonEnvironments/info/executable.ts rename to src/platform/pythonEnvironments/info/executable.ts diff --git a/src/client/pythonEnvironments/info/index.ts b/src/platform/pythonEnvironments/info/index.ts similarity index 100% rename from src/client/pythonEnvironments/info/index.ts rename to src/platform/pythonEnvironments/info/index.ts diff --git a/src/client/pythonEnvironments/info/interpreter.ts b/src/platform/pythonEnvironments/info/interpreter.ts similarity index 100% rename from src/client/pythonEnvironments/info/interpreter.ts rename to src/platform/pythonEnvironments/info/interpreter.ts diff --git a/src/client/pythonEnvironments/info/pythonVersion.ts b/src/platform/pythonEnvironments/info/pythonVersion.ts similarity index 100% rename from src/client/pythonEnvironments/info/pythonVersion.ts rename to src/platform/pythonEnvironments/info/pythonVersion.ts diff --git a/src/platform/serviceRegistry.ts b/src/platform/serviceRegistry.ts new file mode 100644 index 00000000000..ee6ae25e82f --- /dev/null +++ b/src/platform/serviceRegistry.ts @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; + +import { IServiceManager } from '../platform/ioc/types'; +import { CommandRegistry } from './commands/commandRegistry'; +import { registerTypes as registerApiTypes } from './api/serviceRegistry'; +import { registerTypes as commonRegisterTypes } from './common/serviceRegistry'; +import { registerTypes as dataScienceRegisterTypes } from './datascience/serviceRegistry'; +import { registerLoggerTypes } from './logging/serviceRegistry'; +import { registerTypes as commonRegisterTerminalTypes } from './terminals/serviceRegistry'; +import { registerTypes as activationRegisterTypes } from './activation/serviceRegistry'; + +export function registerTypes(serviceManager: IServiceManager, isDevMode: boolean) { + // Logging should be done first so we get logging going asap + registerLoggerTypes(serviceManager); + serviceManager.addSingleton(CommandRegistry, CommandRegistry); + activationRegisterTypes(serviceManager); + registerApiTypes(serviceManager); + commonRegisterTypes(serviceManager); + dataScienceRegisterTypes(serviceManager, isDevMode); + commonRegisterTerminalTypes(serviceManager); +} diff --git a/src/client/startupTelemetry.ts b/src/platform/startupTelemetry.ts similarity index 93% rename from src/client/startupTelemetry.ts rename to src/platform/startupTelemetry.ts index 9e4ef4aea04..786a3aa3293 100644 --- a/src/client/startupTelemetry.ts +++ b/src/platform/startupTelemetry.ts @@ -5,9 +5,9 @@ import { IWorkspaceService } from './common/application/types'; import { isTestExecution } from './common/constants'; import { traceError } from './common/logger'; import { IServiceContainer } from './ioc/types'; -import { sendTelemetryEvent } from './telemetry'; -import { EventName } from './telemetry/constants'; -import { EditorLoadTelemetry } from './telemetry/types'; +import { sendTelemetryEvent } from '../telemetry'; +import { EventName } from '../telemetry/constants'; +import { EditorLoadTelemetry } from '../telemetry/types'; interface IStopWatch { elapsedTime: number; diff --git a/src/client/terminals/codeExecution/helper.ts b/src/platform/terminals/codeExecution/helper.ts similarity index 100% rename from src/client/terminals/codeExecution/helper.ts rename to src/platform/terminals/codeExecution/helper.ts diff --git a/src/client/terminals/serviceRegistry.ts b/src/platform/terminals/serviceRegistry.ts similarity index 100% rename from src/client/terminals/serviceRegistry.ts rename to src/platform/terminals/serviceRegistry.ts diff --git a/src/client/terminals/types.ts b/src/platform/terminals/types.ts similarity index 100% rename from src/client/terminals/types.ts rename to src/platform/terminals/types.ts diff --git a/src/client/testing/common/constants.ts b/src/platform/testing/common/constants.ts similarity index 100% rename from src/client/testing/common/constants.ts rename to src/platform/testing/common/constants.ts diff --git a/src/client/telemetry/constants.ts b/src/telemetry/constants.ts similarity index 100% rename from src/client/telemetry/constants.ts rename to src/telemetry/constants.ts diff --git a/src/client/telemetry/envFileTelemetry.ts b/src/telemetry/envFileTelemetry.ts similarity index 89% rename from src/client/telemetry/envFileTelemetry.ts rename to src/telemetry/envFileTelemetry.ts index 394f5b16726..1111a6b0864 100644 --- a/src/client/telemetry/envFileTelemetry.ts +++ b/src/telemetry/envFileTelemetry.ts @@ -3,12 +3,12 @@ 'use strict'; -import { IWorkspaceService } from '../common/application/types'; -import { Resource } from '../common/types'; -import { SystemVariables } from '../common/variables/systemVariables'; +import { IWorkspaceService } from '../platform/common/application/types'; +import { Resource } from '../platform/common/types'; +import { SystemVariables } from '../platform/common/variables/systemVariables'; import { sendTelemetryEvent } from '.'; -import { IFileSystem } from '../common/platform/types'; +import { IFileSystem } from '../platform/common/platform/types'; import { EventName } from './constants'; let _defaultEnvFileSetting: string | undefined; diff --git a/src/client/telemetry/extensionInstallTelemetry.ts b/src/telemetry/extensionInstallTelemetry.ts similarity index 92% rename from src/client/telemetry/extensionInstallTelemetry.ts rename to src/telemetry/extensionInstallTelemetry.ts index 326024e99dd..29c627c6376 100644 --- a/src/client/telemetry/extensionInstallTelemetry.ts +++ b/src/telemetry/extensionInstallTelemetry.ts @@ -3,8 +3,8 @@ import * as path from 'path'; import { setSharedProperty } from '.'; -import { IFileSystem } from '../common/platform/types'; -import { EXTENSION_ROOT_DIR } from '../constants'; +import { IFileSystem } from '../platform/common/platform/types'; +import { EXTENSION_ROOT_DIR } from '../platform/constants'; /** * Sets shared telemetry property about where the extension was installed from diff --git a/src/client/telemetry/helpers.ts b/src/telemetry/helpers.ts similarity index 93% rename from src/client/telemetry/helpers.ts rename to src/telemetry/helpers.ts index c4dff27fe04..f76b6fb75d4 100644 --- a/src/client/telemetry/helpers.ts +++ b/src/telemetry/helpers.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. import * as hashjs from 'hash.js'; -import { traceError } from '../common/logger'; -import { KnownKernelLanguageAliases, VSCodeKnownNotebookLanguages } from '../datascience/constants'; +import { traceError } from '../platform/common/logger'; +import { KnownKernelLanguageAliases, VSCodeKnownNotebookLanguages } from '../platform/datascience/constants'; export function getTelemetrySafeLanguage(language: string = 'unknown') { language = (language || 'unknown').toLowerCase(); diff --git a/src/client/telemetry/importTracker.ts b/src/telemetry/importTracker.ts similarity index 94% rename from src/client/telemetry/importTracker.ts rename to src/telemetry/importTracker.ts index 69c4aa291ea..30c1ace896d 100644 --- a/src/client/telemetry/importTracker.ts +++ b/src/telemetry/importTracker.ts @@ -7,15 +7,15 @@ import { inject, injectable } from 'inversify'; import * as path from 'path'; import { NotebookCellExecutionStateChangeEvent, NotebookCellKind, NotebookDocument, TextDocument } from 'vscode'; import { captureTelemetry, sendTelemetryEvent } from '.'; -import { splitMultilineString } from '../../datascience-ui/common'; -import { getAssociatedJupyterNotebook, isJupyterNotebook } from '../../notebooks/helpers'; -import { IExtensionSingleActivationService } from '../activation/types'; -import { IDocumentManager, IVSCodeNotebook } from '../common/application/types'; -import { isCI, isTestExecution, PYTHON_LANGUAGE } from '../common/constants'; -import '../common/extensions'; -import { disposeAllDisposables } from '../common/helpers'; -import { IDisposable, IDisposableRegistry } from '../common/types'; -import { noop } from '../common/utils/misc'; +import { splitMultilineString } from '../datascience-ui/common'; +import { getAssociatedJupyterNotebook, isJupyterNotebook } from '../notebooks/helpers'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { IDocumentManager, IVSCodeNotebook } from '../platform/common/application/types'; +import { isCI, isTestExecution, PYTHON_LANGUAGE } from '../platform/common/constants'; +import '../platform/common/extensions'; +import { disposeAllDisposables } from '../platform/common/helpers'; +import { IDisposable, IDisposableRegistry } from '../platform/common/types'; +import { noop } from '../platform/common/utils/misc'; import { EventName } from './constants'; import { getTelemetrySafeHashedString } from './helpers'; diff --git a/src/client/telemetry/index.ts b/src/telemetry/index.ts similarity index 98% rename from src/client/telemetry/index.ts rename to src/telemetry/index.ts index d023051f34b..fe9b702f0a9 100644 --- a/src/client/telemetry/index.ts +++ b/src/telemetry/index.ts @@ -5,28 +5,28 @@ import type { JSONObject } from '@lumino/coreutils'; // eslint-disable-next-line import TelemetryReporter from 'vscode-extension-telemetry/lib/telemetryReporter'; -import { IWorkspaceService } from '../common/application/types'; -import { AppinsightsKey, isTestExecution, isUnitTestExecution, JVSC_EXTENSION_ID } from '../common/constants'; -import { traceError, traceInfo } from '../common/logger'; -import { StopWatch } from '../common/utils/stopWatch'; +import { IWorkspaceService } from '../platform/common/application/types'; +import { AppinsightsKey, isTestExecution, isUnitTestExecution, JVSC_EXTENSION_ID } from '../platform/common/constants'; +import { traceError, traceInfo } from '../platform/common/logger'; +import { StopWatch } from '../platform/common/utils/stopWatch'; import { JupyterCommands, NativeKeyboardCommandTelemetry, NativeMouseCommandTelemetry, Telemetry, VSCodeNativeTelemetry -} from '../datascience/constants'; -import { ResourceSpecificTelemetryProperties } from '../datascience/telemetry/types'; -import { ExportFormat } from '../datascience/export/types'; -import { InterruptResult, KernelInterpreterDependencyResponse } from '../datascience/types'; +} from '../platform/datascience/constants'; +import { ResourceSpecificTelemetryProperties } from './types'; +import { ExportFormat } from '../platform/datascience/export/types'; +import { InterruptResult, KernelInterpreterDependencyResponse } from '../platform/datascience/types'; import { CheckboxState, EventName, PlatformErrors, SliceOperationSource } from './constants'; -import { noop } from '../common/utils/misc'; +import { noop } from '../platform/common/utils/misc'; import { isPromise } from 'rxjs/internal-compatibility'; -import { DebuggingTelemetry } from '../debugger/constants'; -import { EnvironmentType } from '../pythonEnvironments/info'; -import { IExportedKernelService } from '../api/extension'; -import { populateTelemetryWithErrorInfo } from '../../extension/errors'; -import { TelemetryErrorProperties, ErrorCategory } from '../../extension/errors/types'; +import { DebuggingTelemetry } from '../platform/debugger/constants'; +import { EnvironmentType } from '../platform/pythonEnvironments/info'; +import { IExportedKernelService } from '../platform/api/extension'; +import { populateTelemetryWithErrorInfo } from '../platform/../platform/errors'; +import { TelemetryErrorProperties, ErrorCategory } from '../platform/../platform/errors/types'; export const waitBeforeSending = 'waitBeforeSending'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/client/datascience/telemetry/interpreterCountTracker.ts b/src/telemetry/interpreterCountTracker.ts similarity index 84% rename from src/client/datascience/telemetry/interpreterCountTracker.ts rename to src/telemetry/interpreterCountTracker.ts index bcd7e24adee..0bf267d1657 100644 --- a/src/client/datascience/telemetry/interpreterCountTracker.ts +++ b/src/telemetry/interpreterCountTracker.ts @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { IExtensionSingleActivationService } from '../../activation/types'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; import { inject, injectable } from 'inversify'; -import { IInterpreterService } from '../../interpreter/contracts'; -import { IPythonApiProvider, IPythonExtensionChecker } from '../../api/types'; -import { noop } from '../../common/utils/misc'; -import { IDisposableRegistry } from '../../common/types'; +import { IInterpreterService } from '../platform/interpreter/contracts'; +import { IPythonApiProvider, IPythonExtensionChecker } from '../platform/api/types'; +import { noop } from '../platform/common/utils/misc'; +import { IDisposableRegistry } from '../platform/common/types'; @injectable() export class InterpreterCountTracker implements IExtensionSingleActivationService { diff --git a/src/client/datascience/telemetry/interpreterPackageTracker.ts b/src/telemetry/interpreterPackageTracker.ts similarity index 87% rename from src/client/datascience/telemetry/interpreterPackageTracker.ts rename to src/telemetry/interpreterPackageTracker.ts index 15e4084c71d..fce36c4900d 100644 --- a/src/client/datascience/telemetry/interpreterPackageTracker.ts +++ b/src/telemetry/interpreterPackageTracker.ts @@ -3,16 +3,16 @@ import { inject, injectable } from 'inversify'; import { NotebookDocument } from 'vscode'; -import { IExtensionSingleActivationService } from '../../activation/types'; -import { IPythonExtensionChecker, IPythonApiProvider } from '../../api/types'; -import { IExtensions, IDisposableRegistry, InterpreterUri } from '../../common/types'; -import { isResource, noop } from '../../common/utils/misc'; -import { IInterpreterService } from '../../interpreter/contracts'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { IPythonExtensionChecker, IPythonApiProvider } from '../platform/api/types'; +import { IExtensions, IDisposableRegistry, InterpreterUri } from '../platform/common/types'; +import { isResource, noop } from '../platform/common/utils/misc'; +import { IInterpreterService } from '../platform/interpreter/contracts'; import { InterpreterPackages } from './interpreterPackages'; -import { INotebookControllerManager } from '../../../notebooks/types'; +import { INotebookControllerManager } from '../platform/../notebooks/types'; import { trackKernelResourceInformation } from './telemetry'; -import { IInstaller, Product } from '../../../kernels/installer/types'; -import { VSCodeNotebookController } from '../../../notebooks/controllers/vscodeNotebookController'; +import { IInstaller, Product } from '../platform/../kernels/installer/types'; +import { VSCodeNotebookController } from '../platform/../notebooks/controllers/vscodeNotebookController'; @injectable() export class InterpreterPackageTracker implements IExtensionSingleActivationService { diff --git a/src/client/datascience/telemetry/interpreterPackages.ts b/src/telemetry/interpreterPackages.ts similarity index 92% rename from src/client/datascience/telemetry/interpreterPackages.ts rename to src/telemetry/interpreterPackages.ts index 5468689954d..2f31b252f5a 100644 --- a/src/client/datascience/telemetry/interpreterPackages.ts +++ b/src/telemetry/interpreterPackages.ts @@ -2,14 +2,14 @@ // Licensed under the MIT License. import { inject, injectable } from 'inversify'; -import { IPythonApiProvider, IPythonExtensionChecker } from '../../api/types'; -import { IPythonExecutionFactory } from '../../common/process/types'; -import { IDisposableRegistry, InterpreterUri } from '../../common/types'; -import { createDeferred, Deferred } from '../../common/utils/async'; -import { isResource, noop } from '../../common/utils/misc'; -import { IInterpreterService } from '../../interpreter/contracts'; -import { PythonEnvironment } from '../../pythonEnvironments/info'; -import { getTelemetrySafeHashedString, getTelemetrySafeVersion } from '../../telemetry/helpers'; +import { IPythonApiProvider, IPythonExtensionChecker } from '../platform/api/types'; +import { IPythonExecutionFactory } from '../platform/common/process/types'; +import { IDisposableRegistry, InterpreterUri } from '../platform/common/types'; +import { createDeferred, Deferred } from '../platform/common/utils/async'; +import { isResource, noop } from '../platform/common/utils/misc'; +import { IInterpreterService } from '../platform/interpreter/contracts'; +import { PythonEnvironment } from '../platform/pythonEnvironments/info'; +import { getTelemetrySafeHashedString, getTelemetrySafeVersion } from '../platform/../telemetry/helpers'; const interestedPackages = new Set( [ diff --git a/src/client/datascience/telemetry/kernelTelemetry.ts b/src/telemetry/kernelTelemetry.ts similarity index 86% rename from src/client/datascience/telemetry/kernelTelemetry.ts rename to src/telemetry/kernelTelemetry.ts index 5835c0c0fa8..fa6e913f2ef 100644 --- a/src/client/datascience/telemetry/kernelTelemetry.ts +++ b/src/telemetry/kernelTelemetry.ts @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { Resource } from '../../common/types'; -import { StopWatch } from '../../common/utils/stopWatch'; -import { EnvironmentType } from '../../pythonEnvironments/info'; -import { Telemetry } from '../constants'; -import { KernelConnectionMetadata } from '../../../kernels/types'; +import { Resource } from '../platform/common/types'; +import { StopWatch } from '../platform/common/utils/stopWatch'; +import { EnvironmentType } from '../platform/pythonEnvironments/info'; +import { KernelConnectionMetadata } from '../platform/../kernels/types'; import { sendKernelTelemetryEvent, trackKernelResourceInformation } from './telemetry'; +import { Telemetry } from '../platform/datascience/constants'; export function sendKernelListTelemetry( resource: Resource, diff --git a/src/client/telemetry/languageInitializer.ts b/src/telemetry/languageInitializer.ts similarity index 78% rename from src/client/telemetry/languageInitializer.ts rename to src/telemetry/languageInitializer.ts index f967eba6cae..e2f307ddf1c 100644 --- a/src/client/telemetry/languageInitializer.ts +++ b/src/telemetry/languageInitializer.ts @@ -3,9 +3,9 @@ import { injectable } from 'inversify'; import { languages } from 'vscode'; -import { IExtensionSingleActivationService } from '../activation/types'; -import { noop } from '../common/utils/misc'; -import { VSCodeKnownNotebookLanguages } from '../datascience/constants'; +import { IExtensionSingleActivationService } from '../platform/activation/types'; +import { noop } from '../platform/common/utils/misc'; +import { VSCodeKnownNotebookLanguages } from '../platform/datascience/constants'; /** * Initializes the list of known languages with whats registered in VS Code. diff --git a/src/client/datascience/telemetry/serviceRegistry.ts b/src/telemetry/serviceRegistry.ts similarity index 84% rename from src/client/datascience/telemetry/serviceRegistry.ts rename to src/telemetry/serviceRegistry.ts index 2fde31fcff0..ec148bdaaae 100644 --- a/src/client/datascience/telemetry/serviceRegistry.ts +++ b/src/telemetry/serviceRegistry.ts @@ -3,9 +3,9 @@ 'use strict'; -import { IExtensionSingleActivationService, IExtensionSyncActivationService } from '../../activation/types'; -import { IServiceManager } from '../../ioc/types'; -import { ActiveEditorContextService } from '../../../interactive-window/commands/activeEditorContext'; +import { IExtensionSingleActivationService, IExtensionSyncActivationService } from '../platform/activation/types'; +import { IServiceManager } from '../platform/ioc/types'; +import { ActiveEditorContextService } from '../platform/../interactive-window/commands/activeEditorContext'; import { InterpreterCountTracker } from './interpreterCountTracker'; import { InterpreterPackages } from './interpreterPackages'; import { InterpreterPackageTracker } from './interpreterPackageTracker'; diff --git a/src/client/datascience/telemetry/telemetry.ts b/src/telemetry/telemetry.ts similarity index 94% rename from src/client/datascience/telemetry/telemetry.ts rename to src/telemetry/telemetry.ts index a77d18ec5f5..2c4d2045f30 100644 --- a/src/client/datascience/telemetry/telemetry.ts +++ b/src/telemetry/telemetry.ts @@ -4,24 +4,29 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports import cloneDeep = require('lodash/cloneDeep'); import { Uri } from 'vscode'; -import { getOSType } from '../../common/utils/platform'; -import { KernelConnectionMetadata } from '../../../kernels/types'; -import { Resource } from '../../common/types'; -import { IEventNamePropertyMapping, sendTelemetryEvent, setSharedProperty, waitBeforeSending } from '../../telemetry'; -import { StopWatch } from '../../common/utils/stopWatch'; +import { getOSType } from '../platform/common/utils/platform'; +import { KernelConnectionMetadata } from '../platform/../kernels/types'; +import { Resource } from '../platform/common/types'; +import { + IEventNamePropertyMapping, + sendTelemetryEvent, + setSharedProperty, + waitBeforeSending +} from '../platform/../telemetry'; +import { StopWatch } from '../platform/common/utils/stopWatch'; import { ResourceSpecificTelemetryProperties } from './types'; -import { Telemetry } from '../constants'; import { WorkspaceInterpreterTracker } from './workspaceInterpreterTracker'; -import { InterruptResult } from '../types'; -import { getResourceType } from '../common'; -import { PYTHON_LANGUAGE } from '../../common/constants'; +import { PYTHON_LANGUAGE } from '../platform/common/constants'; import { InterpreterCountTracker } from './interpreterCountTracker'; -import { getTelemetrySafeHashedString, getTelemetrySafeLanguage } from '../../telemetry/helpers'; -import { PythonEnvironment } from '../../pythonEnvironments/info'; +import { getTelemetrySafeHashedString, getTelemetrySafeLanguage } from '../platform/../telemetry/helpers'; +import { PythonEnvironment } from '../platform/pythonEnvironments/info'; import { InterpreterPackages } from './interpreterPackages'; -import { populateTelemetryWithErrorInfo } from '../../../extension/errors'; -import { createDeferred } from '../../common/utils/async'; -import { getNormalizedInterpreterPath } from '../../pythonEnvironments/info/interpreter'; +import { populateTelemetryWithErrorInfo } from '../platform/../platform/errors'; +import { createDeferred } from '../platform/common/utils/async'; +import { getNormalizedInterpreterPath } from '../platform/pythonEnvironments/info/interpreter'; +import { Telemetry } from '../platform/datascience/constants'; +import { getResourceType } from '../platform/datascience/common'; +import { InterruptResult } from '../platform/datascience/types'; /** * This information is sent with each telemetry event. diff --git a/src/telemetry/types.ts b/src/telemetry/types.ts new file mode 100644 index 00000000000..7996e4dbbcf --- /dev/null +++ b/src/telemetry/types.ts @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; + +import { EnvironmentType } from '../platform/pythonEnvironments/info'; +import { KernelConnectionMetadata } from '../kernels/types'; +import { IEventNamePropertyMapping } from '../telemetry/index'; +import { EventName } from './constants'; + +export type EditorLoadTelemetry = IEventNamePropertyMapping[EventName.EXTENSION_LOAD]; +export const IImportTracker = Symbol('IImportTracker'); +export interface IImportTracker {} + +export type ResourceSpecificTelemetryProperties = Partial<{ + resourceType: 'notebook' | 'interactive'; + /** + * Whether the notebook startup UI (progress indicator & the like) was displayed to the user or not. + * If its not displayed, then its considered an auto start (start in the background, like pre-warming kernel) + */ + disableUI?: boolean; + /** + * Hash of the resource (notebook.uri or pythonfile.uri associated with this). + * If we run the same notebook tomorrow, the hash will be the same. + */ + resourceHash?: string; + /** + * Unique identifier for an instance of a notebook session. + * If we restart or run this notebook tomorrow, this id will be different. + * Id could be something as simple as a hash of the current Epoch time. + */ + kernelSessionId: string; + /** + * Whether this resource is using the active Python interpreter or not. + */ + isUsingActiveInterpreter?: boolean; + /** + * Found plenty of issues when starting kernels with conda, hence useful to capture this info. + */ + pythonEnvironmentType?: EnvironmentType; + /** + * A key, so that rest of the information is tied to this. (hash) + */ + pythonEnvironmentPath?: string; + /** + * Found plenty of issues when starting Conda Python 3.7, Python 3.7 Python 3.9 (in early days when ipykernel was not up to date) + */ + pythonEnvironmentVersion?: string; + /** + * Total number of python environments. + */ + pythonEnvironmentCount?: number; + /** + * Comma delimited list of hashed packages & their versions. + */ + pythonEnvironmentPackages?: string; + /** + * Whether kernel was started using kernel spec, interpreter, etc. + */ + kernelConnectionType?: KernelConnectionMetadata['kind']; + /** + * Language of the kernel connection. + */ + kernelLanguage: string; + /** + * This number gets reset after we attempt a restart or change kernel. + */ + interruptCount?: number; + /** + * This number gets reset after change the kernel. + */ + restartCount?: number; + /** + * Number of times starting the kernel failed. + */ + startFailureCount?: number; + /** + * Number of times the kernel was changed. + */ + switchKernelCount?: number; + /** + * Total number of kernel specs in the kernel spec list. + */ + kernelSpecCount: number; + /** + * Total number of interpreters in the kernel spec list. + */ + kernelInterpreterCount: number; + /** + * Total number of live kernels in the kernel spec list. + */ + kernelLiveCount: number; +}>; diff --git a/src/client/datascience/telemetry/workspaceInterpreterTracker.ts b/src/telemetry/workspaceInterpreterTracker.ts similarity index 84% rename from src/client/datascience/telemetry/workspaceInterpreterTracker.ts rename to src/telemetry/workspaceInterpreterTracker.ts index 007ba7f2ca5..7f0c2314736 100644 --- a/src/client/datascience/telemetry/workspaceInterpreterTracker.ts +++ b/src/telemetry/workspaceInterpreterTracker.ts @@ -2,14 +2,14 @@ // Licensed under the MIT License. import { Uri } from 'vscode'; -import { IDisposableRegistry, IExtensions, Resource } from '../../common/types'; -import { PythonEnvironment } from '../../pythonEnvironments/info'; -import { IExtensionSyncActivationService } from '../../activation/types'; -import { IWorkspaceService } from '../../common/application/types'; +import { IDisposableRegistry, IExtensions, Resource } from '../platform/common/types'; +import { PythonEnvironment } from '../platform/pythonEnvironments/info'; +import { IExtensionSyncActivationService } from '../platform/activation/types'; +import { IWorkspaceService } from '../platform/common/application/types'; import { inject, injectable } from 'inversify'; -import { IInterpreterService } from '../../interpreter/contracts'; -import { IPythonExtensionChecker } from '../../api/types'; -import { areInterpreterPathsSame } from '../../pythonEnvironments/info/interpreter'; +import { IInterpreterService } from '../platform/interpreter/contracts'; +import { IPythonExtensionChecker } from '../platform/api/types'; +import { areInterpreterPathsSame } from '../platform/pythonEnvironments/info/interpreter'; @injectable() export class WorkspaceInterpreterTracker implements IExtensionSyncActivationService { diff --git a/src/test/activation/migrateDataScienceSettingsService.unit.test.ts b/src/test/activation/migrateDataScienceSettingsService.unit.test.ts index d86b33e0618..10158f431a5 100644 --- a/src/test/activation/migrateDataScienceSettingsService.unit.test.ts +++ b/src/test/activation/migrateDataScienceSettingsService.unit.test.ts @@ -1,12 +1,12 @@ import { assert } from 'chai'; import { anyString, anything, instance, mock, when } from 'ts-mockito'; -import { MigrateDataScienceSettingsService } from '../../client/activation/migrateDataScienceSettingsService'; -import { ApplicationEnvironment } from '../../client/common/application/applicationEnvironment'; -import { IApplicationEnvironment, IWorkspaceService } from '../../client/common/application/types'; -import { WorkspaceService } from '../../client/common/application/workspace'; -import { PersistentStateFactory, PersistentState } from '../../client/common/persistentState'; -import { IPersistentStateFactory } from '../../client/common/types'; -import { IJupyterServerUriStorage } from '../../client/datascience/types'; +import { MigrateDataScienceSettingsService } from '../../platform/activation/migrateDataScienceSettingsService'; +import { ApplicationEnvironment } from '../../platform/common/application/applicationEnvironment'; +import { IApplicationEnvironment, IWorkspaceService } from '../../platform/common/application/types'; +import { WorkspaceService } from '../../platform/common/application/workspace'; +import { PersistentStateFactory, PersistentState } from '../../platform/common/persistentState'; +import { IPersistentStateFactory } from '../../platform/common/types'; +import { IJupyterServerUriStorage } from '../../platform/datascience/types'; import { JupyterServerUriStorage } from '../../kernels/jupyter/launcher/serverUriStorage'; import { MockFileSystem } from '../datascience/mockFileSystem'; diff --git a/src/test/client/api.vscode.test.ts b/src/test/client/api.vscode.test.ts index 3860314c828..abaee33aea5 100644 --- a/src/test/client/api.vscode.test.ts +++ b/src/test/client/api.vscode.test.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. import { assert } from 'chai'; import * as path from 'path'; -import { traceInfo } from '../../client/common/logger'; -import { IDisposable } from '../../client/common/types'; +import { traceInfo } from '../../platform/common/logger'; +import { IDisposable } from '../../platform/common/types'; import { closeNotebooksAndCleanUpAfterTests, createEmptyPythonNotebook, @@ -18,7 +18,7 @@ import { import { initialize } from '../initialize'; import * as sinon from 'sinon'; import { captureScreenShot, createEventHandler, IExtensionTestApi } from '../common'; -import { IVSCodeNotebook } from '../../client/common/application/types'; +import { IVSCodeNotebook } from '../../platform/common/application/types'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST } from '../constants'; import { Uri, workspace } from 'vscode'; diff --git a/src/test/common.ts b/src/test/common.ts index 5117aebbd71..9a9799aaf29 100644 --- a/src/test/common.ts +++ b/src/test/common.ts @@ -10,13 +10,13 @@ import * as path from 'path'; import * as uuid from 'uuid/v4'; import { coerce, SemVer } from 'semver'; import type { ConfigurationTarget, Event, TextDocument, Uri } from 'vscode'; -import { IExtensionApi } from '../client/api'; -import { IProcessService } from '../client/common/process/types'; -import { IDisposable, IJupyterSettings } from '../client/common/types'; -import { IServiceContainer, IServiceManager } from '../client/ioc/types'; +import { IExtensionApi } from '../platform/api'; +import { IProcessService } from '../platform/common/process/types'; +import { IDisposable, IJupyterSettings } from '../platform/common/types'; +import { IServiceContainer, IServiceManager } from '../platform/ioc/types'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_MULTI_ROOT_TEST, IS_PERF_TEST, IS_SMOKE_TEST } from './constants'; import { noop } from './core'; -import { isCI } from '../client/common/constants'; +import { isCI } from '../platform/common/constants'; const StreamZip = require('node-stream-zip'); @@ -90,7 +90,7 @@ function getWorkspaceRoot() { } export function getExtensionSettings(resource: Uri | undefined): IJupyterSettings { - const pythonSettings = require('../client/common/configSettings') as typeof import('../client/common/configSettings'); + const pythonSettings = require('../platform/common/configSettings') as typeof import('../platform/common/configSettings'); return pythonSettings.JupyterSettings.getInstance(resource); } export function retryAsync(this: any, wrapped: Function, retryCount: number = 2) { @@ -187,8 +187,8 @@ export function getOSType(): OSType { * @return `SemVer` version of the Python interpreter, or `undefined` if an error occurs. */ export async function getPythonSemVer(procService?: IProcessService): Promise { - const decoder = await import('../client/common/process/decoder'); - const proc = await import('../client/common/process/proc'); + const decoder = await import('../platform/common/process/decoder'); + const proc = await import('../platform/common/process/proc'); const pythonProcRunner = procService ? procService : new proc.ProcessService(new decoder.BufferDecoder()); const pyVerArgs = ['-c', 'import sys;print("{0}.{1}.{2}".format(*sys.version_info[:3]))']; diff --git a/src/test/common/application/commands/reloadCommand.unit.test.ts b/src/test/common/application/commands/reloadCommand.unit.test.ts index 5f5a4fe32f5..17e602d763b 100644 --- a/src/test/common/application/commands/reloadCommand.unit.test.ts +++ b/src/test/common/application/commands/reloadCommand.unit.test.ts @@ -4,11 +4,11 @@ 'use strict'; import { anything, capture, instance, mock, verify, when } from 'ts-mockito'; -import { ApplicationShell } from '../../../../client/common/application/applicationShell'; -import { CommandManager } from '../../../../client/common/application/commandManager'; -import { ReloadVSCodeCommandHandler } from '../../../../client/common/application/commands/reloadCommand'; -import { IApplicationShell, ICommandManager } from '../../../../client/common/application/types'; -import { Common } from '../../../../client/common/utils/localize'; +import { ApplicationShell } from '../../../../platform/common/application/applicationShell'; +import { CommandManager } from '../../../../platform/common/application/commandManager'; +import { ReloadVSCodeCommandHandler } from '../../../../platform/common/application/commands/reloadCommand'; +import { IApplicationShell, ICommandManager } from '../../../../platform/common/application/types'; +import { Common } from '../../../../platform/common/utils/localize'; // Defines a Mocha test suite to group tests of similar kind together suite('Common Commands ReloadCommand', () => { diff --git a/src/test/common/configuration/service.unit.test.ts b/src/test/common/configuration/service.unit.test.ts index ba2faaa0860..e78df7f0dab 100644 --- a/src/test/common/configuration/service.unit.test.ts +++ b/src/test/common/configuration/service.unit.test.ts @@ -6,11 +6,11 @@ import { expect } from 'chai'; import * as TypeMoq from 'typemoq'; import { ConfigurationTarget, Uri, WorkspaceConfiguration } from 'vscode'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { JupyterSettings } from '../../../client/common/configSettings'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { IExperimentService } from '../../../client/common/types'; -import { IServiceContainer } from '../../../client/ioc/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { JupyterSettings } from '../../../platform/common/configSettings'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { IExperimentService } from '../../../platform/common/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; suite('Configuration Service', () => { const resource = Uri.parse('a'); diff --git a/src/test/common/configuration/service.vscode.test.ts b/src/test/common/configuration/service.vscode.test.ts index 30fad699918..ece5a36d2df 100644 --- a/src/test/common/configuration/service.vscode.test.ts +++ b/src/test/common/configuration/service.vscode.test.ts @@ -2,9 +2,9 @@ // Licensed under the MIT License. import { expect } from 'chai'; import { workspace } from 'vscode'; -import { AsyncDisposableRegistry } from '../../../client/common/asyncDisposableRegistry'; -import { IAsyncDisposableRegistry, IConfigurationService } from '../../../client/common/types'; -import { IServiceContainer } from '../../../client/ioc/types'; +import { AsyncDisposableRegistry } from '../../../platform/common/asyncDisposableRegistry'; +import { IAsyncDisposableRegistry, IConfigurationService } from '../../../platform/common/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; import { getExtensionSettings } from '../../common'; import { initialize } from '../../initialize'; diff --git a/src/test/common/crypto.unit.test.ts b/src/test/common/crypto.unit.test.ts index d8d79f54025..f895794dac9 100644 --- a/src/test/common/crypto.unit.test.ts +++ b/src/test/common/crypto.unit.test.ts @@ -6,7 +6,7 @@ import { assert, expect } from 'chai'; import * as fs from 'fs-extra'; import * as path from 'path'; -import { CryptoUtils } from '../../client/common/crypto'; +import { CryptoUtils } from '../../platform/common/crypto'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../constants'; const RANDOM_WORDS = path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src', 'test', 'common', 'randomWords.txt'); diff --git a/src/test/common/experiments/service.unit.test.ts b/src/test/common/experiments/service.unit.test.ts index efa1dca3c91..5b3e3f24ba0 100644 --- a/src/test/common/experiments/service.unit.test.ts +++ b/src/test/common/experiments/service.unit.test.ts @@ -7,14 +7,14 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { anything, instance, mock, when } from 'ts-mockito'; import * as tasClient from 'vscode-tas-client'; -import { ApplicationEnvironment } from '../../../client/common/application/applicationEnvironment'; -import { Channel, IApplicationEnvironment, IWorkspaceService } from '../../../client/common/application/types'; -import { WorkspaceService } from '../../../client/common/application/workspace'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { ExperimentService } from '../../../client/common/experiments/service'; -import { IConfigurationService } from '../../../client/common/types'; -import * as Telemetry from '../../../client/telemetry'; -import { EventName } from '../../../client/telemetry/constants'; +import { ApplicationEnvironment } from '../../../platform/common/application/applicationEnvironment'; +import { Channel, IApplicationEnvironment, IWorkspaceService } from '../../../platform/common/application/types'; +import { WorkspaceService } from '../../../platform/common/application/workspace'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { ExperimentService } from '../../../platform/common/experiments/service'; +import { IConfigurationService } from '../../../platform/common/types'; +import * as Telemetry from '../../../telemetry'; +import { EventName } from '../../../telemetry/constants'; import { JVSC_EXTENSION_ID_FOR_TESTS } from '../../constants'; import { MockOutputChannel } from '../../mockClasses'; import { MockMemento } from '../../mocks/mementos'; diff --git a/src/test/common/experiments/telemetry.unit.test.ts b/src/test/common/experiments/telemetry.unit.test.ts index 43f362b0ff8..b931e064c3d 100644 --- a/src/test/common/experiments/telemetry.unit.test.ts +++ b/src/test/common/experiments/telemetry.unit.test.ts @@ -5,8 +5,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { ExperimentationTelemetry } from '../../../client/common/experiments/telemetry'; -import * as Telemetry from '../../../client/telemetry'; +import { ExperimentationTelemetry } from '../../../platform/common/experiments/telemetry'; +import * as Telemetry from '../../../telemetry'; suite('Experimentation telemetry', () => { const event = 'SomeEventName'; diff --git a/src/test/common/extensions.unit.test.ts b/src/test/common/extensions.unit.test.ts index adbf2af873c..8b57d076856 100644 --- a/src/test/common/extensions.unit.test.ts +++ b/src/test/common/extensions.unit.test.ts @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import '../../client/common/extensions'; +import '../../platform/common/extensions'; // Defines a Mocha test suite to group tests of similar kind together suite('String Extensions', () => { diff --git a/src/test/common/helpers.vscode.test.ts b/src/test/common/helpers.vscode.test.ts index 062c699eca9..689a852e952 100644 --- a/src/test/common/helpers.vscode.test.ts +++ b/src/test/common/helpers.vscode.test.ts @@ -2,7 +2,7 @@ import * as assert from 'assert'; // You can import and use all API from the 'vscode' module // as well as import your extension to test it -import { isNotInstalledError } from '../../client/common/helpers'; +import { isNotInstalledError } from '../../platform/common/helpers'; // Defines a Mocha test suite to group tests of similar kind together suite('helpers', () => { diff --git a/src/test/common/misc.vscode.test.ts b/src/test/common/misc.vscode.test.ts index 370668d40e7..d95ff9d9ca1 100644 --- a/src/test/common/misc.vscode.test.ts +++ b/src/test/common/misc.vscode.test.ts @@ -4,7 +4,7 @@ 'use strict'; import { expect } from 'chai'; -import { isTestExecution } from '../../client/common/constants'; +import { isTestExecution } from '../../platform/common/constants'; // Defines a Mocha test suite to group tests of similar kind together suite('Common - Misc', () => { diff --git a/src/test/common/net/fileDownloader.unit.test.ts b/src/test/common/net/fileDownloader.unit.test.ts index 5119cb38b49..393889ac2bf 100644 --- a/src/test/common/net/fileDownloader.unit.test.ts +++ b/src/test/common/net/fileDownloader.unit.test.ts @@ -14,16 +14,16 @@ import * as sinon from 'sinon'; import { Readable } from 'stream'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import { Progress } from 'vscode'; -import { ApplicationShell } from '../../../client/common/application/applicationShell'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { FileDownloader } from '../../../client/common/net/fileDownloader'; -import { HttpClient } from '../../../client/common/net/httpClient'; -import { FileSystem } from '../../../client/common/platform/fileSystem'; -import { PlatformService } from '../../../client/common/platform/platformService'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IHttpClient } from '../../../client/common/types'; -import { Http } from '../../../client/common/utils/localize'; -import { EXTENSION_ROOT_DIR } from '../../../client/constants'; +import { ApplicationShell } from '../../../platform/common/application/applicationShell'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { FileDownloader } from '../../../platform/common/net/fileDownloader'; +import { HttpClient } from '../../../platform/common/net/httpClient'; +import { FileSystem } from '../../../platform/common/platform/fileSystem'; +import { PlatformService } from '../../../platform/common/platform/platformService'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IHttpClient } from '../../../platform/common/types'; +import { Http } from '../../../platform/common/utils/localize'; +import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; import { noop } from '../../core'; import { MockOutputChannel } from '../../mockClasses'; const requestProgress = require('request-progress'); diff --git a/src/test/common/net/httpClient.unit.test.ts b/src/test/common/net/httpClient.unit.test.ts index 18b365011b5..b14bd9661b9 100644 --- a/src/test/common/net/httpClient.unit.test.ts +++ b/src/test/common/net/httpClient.unit.test.ts @@ -11,9 +11,9 @@ import { expect } from 'chai'; import rewiremock from 'rewiremock'; import * as TypeMoq from 'typemoq'; import { WorkspaceConfiguration } from 'vscode'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { HttpClient } from '../../../client/common/net/httpClient'; -import { IServiceContainer } from '../../../client/ioc/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { HttpClient } from '../../../platform/common/net/httpClient'; +import { IServiceContainer } from '../../../platform/ioc/types'; // eslint-disable-next-line suite('Http Client', () => { diff --git a/src/test/common/platform/errors.unit.test.ts b/src/test/common/platform/errors.unit.test.ts index cc7cd5b2c90..5d27a3c4a4e 100644 --- a/src/test/common/platform/errors.unit.test.ts +++ b/src/test/common/platform/errors.unit.test.ts @@ -11,7 +11,7 @@ import { isFileNotFoundError, isNoPermissionsError, isNotDirError -} from '../../../client/common/platform/errors'; +} from '../../../platform/common/platform/errors'; import { SystemError } from './utils'; suite('FileSystem - errors', () => { diff --git a/src/test/common/platform/filesystem.unit.test.ts b/src/test/common/platform/filesystem.unit.test.ts index 57633cc8ba3..b7f50a6b7b5 100644 --- a/src/test/common/platform/filesystem.unit.test.ts +++ b/src/test/common/platform/filesystem.unit.test.ts @@ -6,7 +6,7 @@ import * as fs from 'fs'; import * as fsextra from 'fs-extra'; import * as TypeMoq from 'typemoq'; import * as vscode from 'vscode'; -import { FileSystemUtils, RawFileSystem } from '../../../client/common/platform/fileSystemUtils'; +import { FileSystemUtils, RawFileSystem } from '../../../platform/common/platform/fileSystemUtils'; import { FileStat, FileType, @@ -17,7 +17,7 @@ import { ITempFileSystem, ReadStream, WriteStream -} from '../../../client/common/platform/types'; +} from '../../../platform/common/platform/types'; /* eslint-disable */ diff --git a/src/test/common/platform/fs-paths.functional.test.ts b/src/test/common/platform/fs-paths.functional.test.ts index c2b2f0771ec..61056b05a7e 100644 --- a/src/test/common/platform/fs-paths.functional.test.ts +++ b/src/test/common/platform/fs-paths.functional.test.ts @@ -8,7 +8,7 @@ import { expect } from 'chai'; import * as os from 'os'; import * as path from 'path'; -import { Executables, FileSystemPaths, FileSystemPathUtils } from '../../../client/common/platform/fs-paths'; +import { Executables, FileSystemPaths, FileSystemPathUtils } from '../../../platform/common/platform/fs-paths'; import { WINDOWS as IS_WINDOWS } from './utils'; suite('FileSystem - Paths', () => { diff --git a/src/test/common/platform/fs-paths.unit.test.ts b/src/test/common/platform/fs-paths.unit.test.ts index 187db527263..bc43367f2d2 100644 --- a/src/test/common/platform/fs-paths.unit.test.ts +++ b/src/test/common/platform/fs-paths.unit.test.ts @@ -6,9 +6,9 @@ import { expect } from 'chai'; import * as path from 'path'; import * as TypeMoq from 'typemoq'; -import { FileSystemPathUtils } from '../../../client/common/platform/fs-paths'; +import { FileSystemPathUtils } from '../../../platform/common/platform/fs-paths'; import { getNamesAndValues } from '../../utils/enum'; -import { OSType } from '../../../client/common/utils/platform'; +import { OSType } from '../../../platform/common/utils/platform'; interface IUtilsDeps { // executables diff --git a/src/test/common/platform/fs-temp.functional.test.ts b/src/test/common/platform/fs-temp.functional.test.ts index ef4c57a151d..86a7ae4c51f 100644 --- a/src/test/common/platform/fs-temp.functional.test.ts +++ b/src/test/common/platform/fs-temp.functional.test.ts @@ -5,8 +5,8 @@ import { expect, use } from 'chai'; import * as fs from 'fs-extra'; -import { TemporaryFileSystem } from '../../../client/common/platform/fs-temp'; -import { TemporaryFile } from '../../../client/common/platform/types'; +import { TemporaryFileSystem } from '../../../platform/common/platform/fs-temp'; +import { TemporaryFile } from '../../../platform/common/platform/types'; import { assertDoesNotExist, assertExists, FSFixture, WINDOWS } from './utils'; /* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ diff --git a/src/test/common/platform/fs-temp.unit.test.ts b/src/test/common/platform/fs-temp.unit.test.ts index fd88e41bc58..0fbba26ddbc 100644 --- a/src/test/common/platform/fs-temp.unit.test.ts +++ b/src/test/common/platform/fs-temp.unit.test.ts @@ -5,7 +5,7 @@ import { expect } from 'chai'; import * as TypeMoq from 'typemoq'; -import { TemporaryFileSystem } from '../../../client/common/platform/fs-temp'; +import { TemporaryFileSystem } from '../../../platform/common/platform/fs-temp'; interface IDeps { // tmp module diff --git a/src/test/common/platform/pathUtils.functional.test.ts b/src/test/common/platform/pathUtils.functional.test.ts index 150ab336768..60ec78dc216 100644 --- a/src/test/common/platform/pathUtils.functional.test.ts +++ b/src/test/common/platform/pathUtils.functional.test.ts @@ -6,8 +6,8 @@ /* eslint-disable */ import { expect } from 'chai'; -import { FileSystemPathUtils } from '../../../client/common/platform/fs-paths'; -import { PathUtils } from '../../../client/common/platform/pathUtils'; +import { FileSystemPathUtils } from '../../../platform/common/platform/fs-paths'; +import { PathUtils } from '../../../platform/common/platform/pathUtils'; import { WINDOWS as IS_WINDOWS } from './utils'; suite('FileSystem - PathUtils', () => { diff --git a/src/test/common/platform/platformService.vscode.test.ts b/src/test/common/platform/platformService.vscode.test.ts index a4c5a523763..077a21f747f 100644 --- a/src/test/common/platform/platformService.vscode.test.ts +++ b/src/test/common/platform/platformService.vscode.test.ts @@ -7,8 +7,8 @@ import { expect, use } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as os from 'os'; import { parse } from 'semver'; -import { PlatformService } from '../../../client/common/platform/platformService'; -import { OSType } from '../../../client/common/utils/platform'; +import { PlatformService } from '../../../platform/common/platform/platformService'; +import { OSType } from '../../../platform/common/utils/platform'; use(chaiAsPromised); diff --git a/src/test/common/process/decoder.vscode.test.ts b/src/test/common/process/decoder.vscode.test.ts index fc1a5cbc7bd..a1c8382ed59 100644 --- a/src/test/common/process/decoder.vscode.test.ts +++ b/src/test/common/process/decoder.vscode.test.ts @@ -3,7 +3,7 @@ import { expect } from 'chai'; import { encode, encodingExists } from 'iconv-lite'; -import { BufferDecoder } from '../../../client/common/process/decoder'; +import { BufferDecoder } from '../../../platform/common/process/decoder'; import { initialize } from '../../initialize'; suite('Decoder', () => { diff --git a/src/test/common/process/logger.unit.test.ts b/src/test/common/process/logger.unit.test.ts index 79c04a68577..6267539a951 100644 --- a/src/test/common/process/logger.unit.test.ts +++ b/src/test/common/process/logger.unit.test.ts @@ -9,10 +9,10 @@ import * as TypeMoq from 'typemoq'; // eslint-disable-next-line @typescript-eslint/no-require-imports import untildify = require('untildify'); -import { PathUtils } from '../../../client/common/platform/pathUtils'; -import { ProcessLogger } from '../../../client/common/process/logger'; -import { IOutputChannel } from '../../../client/common/types'; -import { Logging } from '../../../client/common/utils/localize'; +import { PathUtils } from '../../../platform/common/platform/pathUtils'; +import { ProcessLogger } from '../../../platform/common/process/logger'; +import { IOutputChannel } from '../../../platform/common/types'; +import { Logging } from '../../../platform/common/utils/localize'; import { getOSType, OSType } from '../../common'; /* eslint-disable */ diff --git a/src/test/common/process/proc.unit.test.ts b/src/test/common/process/proc.unit.test.ts index 563eacbaff9..ff5de624b66 100644 --- a/src/test/common/process/proc.unit.test.ts +++ b/src/test/common/process/proc.unit.test.ts @@ -7,8 +7,8 @@ import { expect } from 'chai'; import { ChildProcess, spawn } from 'child_process'; -import { ProcessService } from '../../../client/common/process/proc'; -import { createDeferred, Deferred } from '../../../client/common/utils/async'; +import { ProcessService } from '../../../platform/common/process/proc'; +import { createDeferred, Deferred } from '../../../platform/common/utils/async'; import { PYTHON_PATH } from '../../common'; interface IProcData { diff --git a/src/test/common/process/processFactory.unit.test.ts b/src/test/common/process/processFactory.unit.test.ts index e5de25e33fb..1fb1a284ecf 100644 --- a/src/test/common/process/processFactory.unit.test.ts +++ b/src/test/common/process/processFactory.unit.test.ts @@ -4,16 +4,16 @@ import { expect } from 'chai'; import { instance, mock, verify, when } from 'ts-mockito'; import { Disposable, Uri } from 'vscode'; -import { IWorkspaceService } from '../../../client/common/application/types'; +import { IWorkspaceService } from '../../../platform/common/application/types'; -import { BufferDecoder } from '../../../client/common/process/decoder'; -import { ProcessLogger } from '../../../client/common/process/logger'; -import { ProcessService } from '../../../client/common/process/proc'; -import { ProcessServiceFactory } from '../../../client/common/process/processFactory'; -import { IBufferDecoder, IProcessLogger } from '../../../client/common/process/types'; -import { IDisposableRegistry } from '../../../client/common/types'; -import { EnvironmentVariablesProvider } from '../../../client/common/variables/environmentVariablesProvider'; -import { IEnvironmentVariablesProvider } from '../../../client/common/variables/types'; +import { BufferDecoder } from '../../../platform/common/process/decoder'; +import { ProcessLogger } from '../../../platform/common/process/logger'; +import { ProcessService } from '../../../platform/common/process/proc'; +import { ProcessServiceFactory } from '../../../platform/common/process/processFactory'; +import { IBufferDecoder, IProcessLogger } from '../../../platform/common/process/types'; +import { IDisposableRegistry } from '../../../platform/common/types'; +import { EnvironmentVariablesProvider } from '../../../platform/common/variables/environmentVariablesProvider'; +import { IEnvironmentVariablesProvider } from '../../../platform/common/variables/types'; suite('Process - ProcessServiceFactory', () => { let factory: ProcessServiceFactory; diff --git a/src/test/common/process/pythonDaemon.functional.test.ts b/src/test/common/process/pythonDaemon.functional.test.ts index a0752016758..7409ea279a6 100644 --- a/src/test/common/process/pythonDaemon.functional.test.ts +++ b/src/test/common/process/pythonDaemon.functional.test.ts @@ -18,13 +18,13 @@ import { StreamMessageReader, StreamMessageWriter } from 'vscode-jsonrpc/node'; -import { IPlatformService } from '../../../client/common/platform/types'; -import { PythonDaemonExecutionService } from '../../../client/common/process/pythonDaemon'; -import { IPythonExecutionService } from '../../../client/common/process/types'; -import { IDisposable } from '../../../client/common/types'; -import { EXTENSION_ROOT_DIR } from '../../../client/constants'; -import { PythonEnvironment, PythonVersionInfo } from '../../../client/pythonEnvironments/info'; -import { parsePythonVersion } from '../../../client/pythonEnvironments/info/pythonVersion'; +import { IPlatformService } from '../../../platform/common/platform/types'; +import { PythonDaemonExecutionService } from '../../../platform/common/process/pythonDaemon'; +import { IPythonExecutionService } from '../../../platform/common/process/types'; +import { IDisposable } from '../../../platform/common/types'; +import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; +import { PythonEnvironment, PythonVersionInfo } from '../../../platform/pythonEnvironments/info'; +import { parsePythonVersion } from '../../../platform/pythonEnvironments/info/pythonVersion'; import { isPythonVersion, PYTHON_PATH } from '../../common'; import { createTemporaryFile } from '../../utils/fs'; use(chaiPromised); diff --git a/src/test/common/process/pythonDaemonPool.functional.test.ts b/src/test/common/process/pythonDaemonPool.functional.test.ts index 1378250af59..e8492116678 100644 --- a/src/test/common/process/pythonDaemonPool.functional.test.ts +++ b/src/test/common/process/pythonDaemonPool.functional.test.ts @@ -15,23 +15,23 @@ import { Observable } from 'rxjs/Observable'; import * as sinon from 'sinon'; import { anything, deepEqual, instance, mock, verify, when } from 'ts-mockito'; import { createMessageConnection, StreamMessageReader, StreamMessageWriter } from 'vscode-jsonrpc/node'; -import { IPlatformService } from '../../../client/common/platform/types'; -import { ProcessLogger } from '../../../client/common/process/logger'; -import { PythonDaemonExecutionServicePool } from '../../../client/common/process/pythonDaemonPool'; +import { IPlatformService } from '../../../platform/common/platform/types'; +import { ProcessLogger } from '../../../platform/common/process/logger'; +import { PythonDaemonExecutionServicePool } from '../../../platform/common/process/pythonDaemonPool'; import { IProcessLogger, IPythonDaemonExecutionService, IPythonExecutionService, ObservableExecutionResult, Output -} from '../../../client/common/process/types'; -import { IDisposable } from '../../../client/common/types'; -import { sleep } from '../../../client/common/utils/async'; -import { noop } from '../../../client/common/utils/misc'; -import { EXTENSION_ROOT_DIR } from '../../../client/constants'; -import { JupyterDaemonModule } from '../../../client/datascience/constants'; -import { PythonEnvironment, PythonVersionInfo } from '../../../client/pythonEnvironments/info'; -import { parsePythonVersion } from '../../../client/pythonEnvironments/info/pythonVersion'; +} from '../../../platform/common/process/types'; +import { IDisposable } from '../../../platform/common/types'; +import { sleep } from '../../../platform/common/utils/async'; +import { noop } from '../../../platform/common/utils/misc'; +import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; +import { JupyterDaemonModule } from '../../../platform/datascience/constants'; +import { PythonEnvironment, PythonVersionInfo } from '../../../platform/pythonEnvironments/info'; +import { parsePythonVersion } from '../../../platform/pythonEnvironments/info/pythonVersion'; import { isPythonVersion, PYTHON_PATH, waitForCondition } from '../../common'; import { createTemporaryFile } from '../../utils/fs'; use(chaiPromised); diff --git a/src/test/common/process/pythonDaemonPool.unit.test.ts b/src/test/common/process/pythonDaemonPool.unit.test.ts index 03671fed8dc..2668c2b0e5b 100644 --- a/src/test/common/process/pythonDaemonPool.unit.test.ts +++ b/src/test/common/process/pythonDaemonPool.unit.test.ts @@ -12,14 +12,14 @@ import { Observable } from 'rxjs/Observable'; import * as sinon from 'sinon'; import { anything, instance, mock, reset, verify, when } from 'ts-mockito'; import { MessageConnection } from 'vscode-jsonrpc'; -import { IPlatformService } from '../../../client/common/platform/types'; -import { ProcessLogger } from '../../../client/common/process/logger'; -import { PythonDaemonExecutionService } from '../../../client/common/process/pythonDaemon'; -import { PythonDaemonExecutionServicePool } from '../../../client/common/process/pythonDaemonPool'; -import { IProcessLogger, IPythonExecutionService, Output } from '../../../client/common/process/types'; -import { ReadWrite } from '../../../client/common/types'; -import { sleep } from '../../../client/common/utils/async'; -import { InterpreterInformation, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IPlatformService } from '../../../platform/common/platform/types'; +import { ProcessLogger } from '../../../platform/common/process/logger'; +import { PythonDaemonExecutionService } from '../../../platform/common/process/pythonDaemon'; +import { PythonDaemonExecutionServicePool } from '../../../platform/common/process/pythonDaemonPool'; +import { IProcessLogger, IPythonExecutionService, Output } from '../../../platform/common/process/types'; +import { ReadWrite } from '../../../platform/common/types'; +import { sleep } from '../../../platform/common/utils/async'; +import { InterpreterInformation, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { noop } from '../../core'; import { asyncDump } from '../asyncDump'; use(chaiPromised); diff --git a/src/test/common/process/pythonEnvironment.unit.test.ts b/src/test/common/process/pythonEnvironment.unit.test.ts index 4bf8f03219d..69acdadac4f 100644 --- a/src/test/common/process/pythonEnvironment.unit.test.ts +++ b/src/test/common/process/pythonEnvironment.unit.test.ts @@ -7,14 +7,14 @@ import { expect, use } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import { SemVer } from 'semver'; import * as TypeMoq from 'typemoq'; -import { IFileSystem } from '../../../client/common/platform/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; import { createCondaEnv, createPythonEnv, createWindowsStoreEnv -} from '../../../client/common/process/pythonEnvironment'; -import { IProcessService, StdErrError } from '../../../client/common/process/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +} from '../../../platform/common/process/pythonEnvironment'; +import { IProcessService, StdErrError } from '../../../platform/common/process/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; use(chaiAsPromised); diff --git a/src/test/common/process/pythonProcess.unit.test.ts b/src/test/common/process/pythonProcess.unit.test.ts index bc2ad020f79..d9a4401a800 100644 --- a/src/test/common/process/pythonProcess.unit.test.ts +++ b/src/test/common/process/pythonProcess.unit.test.ts @@ -4,11 +4,11 @@ import { expect, use } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as TypeMoq from 'typemoq'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { createPythonEnv } from '../../../client/common/process/pythonEnvironment'; -import { createPythonProcessService } from '../../../client/common/process/pythonProcess'; -import { IProcessService, StdErrError } from '../../../client/common/process/types'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { createPythonEnv } from '../../../platform/common/process/pythonEnvironment'; +import { createPythonProcessService } from '../../../platform/common/process/pythonProcess'; +import { IProcessService, StdErrError } from '../../../platform/common/process/types'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { noop } from '../../core'; use(chaiAsPromised); diff --git a/src/test/common/process/serviceRegistry.unit.test.ts b/src/test/common/process/serviceRegistry.unit.test.ts index 78da3daf655..5bc06b0deab 100644 --- a/src/test/common/process/serviceRegistry.unit.test.ts +++ b/src/test/common/process/serviceRegistry.unit.test.ts @@ -4,13 +4,17 @@ 'use strict'; import { instance, mock, verify } from 'ts-mockito'; -import { BufferDecoder } from '../../../client/common/process/decoder'; -import { ProcessServiceFactory } from '../../../client/common/process/processFactory'; -import { PythonExecutionFactory } from '../../../client/common/process/pythonExecutionFactory'; -import { registerTypes } from '../../../client/common/process/serviceRegistry'; -import { IBufferDecoder, IProcessServiceFactory, IPythonExecutionFactory } from '../../../client/common/process/types'; -import { ServiceManager } from '../../../client/ioc/serviceManager'; -import { IServiceManager } from '../../../client/ioc/types'; +import { BufferDecoder } from '../../../platform/common/process/decoder'; +import { ProcessServiceFactory } from '../../../platform/common/process/processFactory'; +import { PythonExecutionFactory } from '../../../platform/common/process/pythonExecutionFactory'; +import { registerTypes } from '../../../platform/common/process/serviceRegistry'; +import { + IBufferDecoder, + IProcessServiceFactory, + IPythonExecutionFactory +} from '../../../platform/common/process/types'; +import { ServiceManager } from '../../../platform/ioc/serviceManager'; +import { IServiceManager } from '../../../platform/ioc/types'; suite('Common Process Service Registry', () => { let serviceManager: IServiceManager; diff --git a/src/test/common/socketCallbackHandler.vscode.test.ts b/src/test/common/socketCallbackHandler.vscode.test.ts index 91507a52a35..894a58b5cd0 100644 --- a/src/test/common/socketCallbackHandler.vscode.test.ts +++ b/src/test/common/socketCallbackHandler.vscode.test.ts @@ -3,10 +3,10 @@ import { expect } from 'chai'; import * as getFreePort from 'get-port'; import * as net from 'net'; -import { SocketCallbackHandler } from '../../client/common/net/socket/socketCallbackHandler'; -import { SocketServer } from '../../client/common/net/socket/socketServer'; -import { SocketStream } from '../../client/common/net/socket/SocketStream'; -import { createDeferred, Deferred } from '../../client/common/utils/async'; +import { SocketCallbackHandler } from '../../platform/common/net/socket/socketCallbackHandler'; +import { SocketServer } from '../../platform/common/net/socket/socketServer'; +import { SocketStream } from '../../platform/common/net/socket/SocketStream'; +import { createDeferred, Deferred } from '../../platform/common/utils/async'; const uint64be = require('uint64be'); diff --git a/src/test/common/socketStream.vscode.test.ts b/src/test/common/socketStream.vscode.test.ts index 0b22b221325..420d5e4e0cc 100644 --- a/src/test/common/socketStream.vscode.test.ts +++ b/src/test/common/socketStream.vscode.test.ts @@ -10,7 +10,7 @@ import * as assert from 'assert'; // You can import and use all API from the 'vscode' module // as well as import your extension to test it import * as net from 'net'; -import { SocketStream } from '../../client/common/net/socket/SocketStream'; +import { SocketStream } from '../../platform/common/net/socket/SocketStream'; /* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ const uint64be = require('uint64be'); diff --git a/src/test/common/utils/async.unit.test.ts b/src/test/common/utils/async.unit.test.ts index 9202035a625..b39741fea9b 100644 --- a/src/test/common/utils/async.unit.test.ts +++ b/src/test/common/utils/async.unit.test.ts @@ -4,7 +4,7 @@ 'use strict'; import * as assert from 'assert'; -import { chain, createDeferred, flattenIterator } from '../../../client/common/utils/async'; +import { chain, createDeferred, flattenIterator } from '../../../platform/common/utils/async'; suite('Deferred', () => { test('Resolve', (done) => { diff --git a/src/test/common/utils/cacheUtils.unit.test.ts b/src/test/common/utils/cacheUtils.unit.test.ts index 2492921c241..9a925e62114 100644 --- a/src/test/common/utils/cacheUtils.unit.test.ts +++ b/src/test/common/utils/cacheUtils.unit.test.ts @@ -5,7 +5,7 @@ import { assert, expect } from 'chai'; import * as sinon from 'sinon'; -import { clearCache, InMemoryCache } from '../../../client/common/utils/cacheUtils'; +import { clearCache, InMemoryCache } from '../../../platform/common/utils/cacheUtils'; type CacheUtilsTestScenario = { scenarioDesc: string; diff --git a/src/test/common/utils/decorators.unit.test.ts b/src/test/common/utils/decorators.unit.test.ts index ddf63078e08..9c958870ed7 100644 --- a/src/test/common/utils/decorators.unit.test.ts +++ b/src/test/common/utils/decorators.unit.test.ts @@ -5,8 +5,8 @@ import { expect, use } from 'chai'; import * as chaiPromise from 'chai-as-promised'; -import { clearCache } from '../../../client/common/utils/cacheUtils'; -import { cache, makeDebounceAsyncDecorator, makeDebounceDecorator } from '../../../client/common/utils/decorators'; +import { clearCache } from '../../../platform/common/utils/cacheUtils'; +import { cache, makeDebounceAsyncDecorator, makeDebounceDecorator } from '../../../platform/common/utils/decorators'; import { sleep } from '../../core'; use(chaiPromise); diff --git a/src/test/common/utils/localize.functional.test.ts b/src/test/common/utils/localize.functional.test.ts index 2c5f5c8d7e1..612c0ce8419 100644 --- a/src/test/common/utils/localize.functional.test.ts +++ b/src/test/common/utils/localize.functional.test.ts @@ -8,8 +8,8 @@ import * as assert from 'assert'; import * as fs from 'fs'; import * as path from 'path'; -import { EXTENSION_ROOT_DIR } from '../../../client/common/constants'; -import * as localize from '../../../client/common/utils/localize'; +import { EXTENSION_ROOT_DIR } from '../../../platform/common/constants'; +import * as localize from '../../../platform/common/utils/localize'; const defaultNLSFile = path.join(EXTENSION_ROOT_DIR, 'package.nls.json'); diff --git a/src/test/common/utils/regexp.unit.test.ts b/src/test/common/utils/regexp.unit.test.ts index 9334d929cf6..b16e91bfb36 100644 --- a/src/test/common/utils/regexp.unit.test.ts +++ b/src/test/common/utils/regexp.unit.test.ts @@ -7,7 +7,7 @@ import { expect } from 'chai'; -import { buildDataViewerFilterRegex, verboseRegExp } from '../../../client/common/utils/regexp'; +import { buildDataViewerFilterRegex, verboseRegExp } from '../../../platform/common/utils/regexp'; suite('Utils for regular expressions - verboseRegExp()', () => { test('whitespace removed in multiline pattern (example of typical usage)', () => { diff --git a/src/test/common/utils/text.unit.test.ts b/src/test/common/utils/text.unit.test.ts index 1da066376dc..4a4c1d7a15c 100644 --- a/src/test/common/utils/text.unit.test.ts +++ b/src/test/common/utils/text.unit.test.ts @@ -7,7 +7,7 @@ import { expect } from 'chai'; import { Position, Range } from 'vscode'; -import { parsePosition, parseRange } from '../../../client/common/utils/text'; +import { parsePosition, parseRange } from '../../../platform/common/utils/text'; suite('parseRange()', () => { test('valid strings', async () => { diff --git a/src/test/common/variables/envVarsService.functional.test.ts b/src/test/common/variables/envVarsService.functional.test.ts index ffbfc37d922..a2aa861a8be 100644 --- a/src/test/common/variables/envVarsService.functional.test.ts +++ b/src/test/common/variables/envVarsService.functional.test.ts @@ -7,9 +7,9 @@ import { expect, use } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; -import { FileSystem } from '../../../client/common/platform/fileSystem'; -import { EnvironmentVariablesService } from '../../../client/common/variables/environment'; -import { IEnvironmentVariablesService } from '../../../client/common/variables/types'; +import { FileSystem } from '../../../platform/common/platform/fileSystem'; +import { EnvironmentVariablesService } from '../../../platform/common/variables/environment'; +import { IEnvironmentVariablesService } from '../../../platform/common/variables/types'; use(chaiAsPromised); diff --git a/src/test/common/variables/envVarsService.unit.test.ts b/src/test/common/variables/envVarsService.unit.test.ts index 711a9562d91..a9b304af273 100644 --- a/src/test/common/variables/envVarsService.unit.test.ts +++ b/src/test/common/variables/envVarsService.unit.test.ts @@ -9,8 +9,8 @@ import { expect, use } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as path from 'path'; import * as TypeMoq from 'typemoq'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { EnvironmentVariablesService, parseEnvFile } from '../../../client/common/variables/environment'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { EnvironmentVariablesService, parseEnvFile } from '../../../platform/common/variables/environment'; use(chaiAsPromised); diff --git a/src/test/common/variables/envVarsService.vscode.test.ts b/src/test/common/variables/envVarsService.vscode.test.ts index b44f9106cc8..10e8390858e 100644 --- a/src/test/common/variables/envVarsService.vscode.test.ts +++ b/src/test/common/variables/envVarsService.vscode.test.ts @@ -8,9 +8,9 @@ import { expect, use } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as path from 'path'; -import { FileSystem } from '../../../client/common/platform/fileSystem'; -import { EnvironmentVariablesService } from '../../../client/common/variables/environment'; -import { IEnvironmentVariablesService } from '../../../client/common/variables/types'; +import { FileSystem } from '../../../platform/common/platform/fileSystem'; +import { EnvironmentVariablesService } from '../../../platform/common/variables/environment'; +import { IEnvironmentVariablesService } from '../../../platform/common/variables/types'; use(chaiAsPromised); diff --git a/src/test/common/variables/kernelEnvVarsService.unit.test.ts b/src/test/common/variables/kernelEnvVarsService.unit.test.ts index 7b7ccb1d231..54415bb72b7 100644 --- a/src/test/common/variables/kernelEnvVarsService.unit.test.ts +++ b/src/test/common/variables/kernelEnvVarsService.unit.test.ts @@ -8,13 +8,13 @@ import { assert, use } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as path from 'path'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { EnvironmentVariablesService } from '../../../client/common/variables/environment'; -import { IEnvironmentVariablesProvider } from '../../../client/common/variables/types'; -import { IJupyterKernelSpec } from '../../../client/datascience/types'; -import { IEnvironmentActivationService } from '../../../client/interpreter/activation/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { EnvironmentVariablesService } from '../../../platform/common/variables/environment'; +import { IEnvironmentVariablesProvider } from '../../../platform/common/variables/types'; +import { IJupyterKernelSpec } from '../../../platform/datascience/types'; +import { IEnvironmentActivationService } from '../../../platform/interpreter/activation/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { anything, instance, mock, when } from 'ts-mockito'; import { KernelEnvironmentVariablesService } from '../../../kernels/raw/launcher/kernelEnvVarsService'; diff --git a/src/test/common/variables/serviceRegistry.unit.test.ts b/src/test/common/variables/serviceRegistry.unit.test.ts index 55a3bbc2f2a..22576c8c96f 100644 --- a/src/test/common/variables/serviceRegistry.unit.test.ts +++ b/src/test/common/variables/serviceRegistry.unit.test.ts @@ -4,12 +4,12 @@ 'use strict'; import { instance, mock, verify } from 'ts-mockito'; -import { EnvironmentVariablesService } from '../../../client/common/variables/environment'; -import { EnvironmentVariablesProvider } from '../../../client/common/variables/environmentVariablesProvider'; -import { registerTypes } from '../../../client/common/variables/serviceRegistry'; -import { IEnvironmentVariablesProvider, IEnvironmentVariablesService } from '../../../client/common/variables/types'; -import { ServiceManager } from '../../../client/ioc/serviceManager'; -import { IServiceManager } from '../../../client/ioc/types'; +import { EnvironmentVariablesService } from '../../../platform/common/variables/environment'; +import { EnvironmentVariablesProvider } from '../../../platform/common/variables/environmentVariablesProvider'; +import { registerTypes } from '../../../platform/common/variables/serviceRegistry'; +import { IEnvironmentVariablesProvider, IEnvironmentVariablesService } from '../../../platform/common/variables/types'; +import { ServiceManager } from '../../../platform/ioc/serviceManager'; +import { IServiceManager } from '../../../platform/ioc/types'; suite('Common variables Service Registry', () => { let serviceManager: IServiceManager; diff --git a/src/test/coverage.ts b/src/test/coverage.ts index da7cfda62cf..18bd9626620 100644 --- a/src/test/coverage.ts +++ b/src/test/coverage.ts @@ -19,7 +19,7 @@ export function setupCoverage() { const nyc = new NYC({ cwd: path.join(EXTENSION_ROOT_DIR_FOR_TESTS), extension: ['.ts'], - include: ['**/src/client/**/*.ts', '**/out/client/**/*.js'], + include: ['**/src/platform/**/*.ts', '**/out/platform/**/*.js'], exclude: ['**/test/**', '.vscode-test/**', '**/ipywidgets/**', '**/node_modules/**'], reporter: reports, 'report-dir': path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'coverage'), diff --git a/src/test/datascience/activation.unit.test.ts b/src/test/datascience/activation.unit.test.ts index 158d817924a..507f50dc659 100644 --- a/src/test/datascience/activation.unit.test.ts +++ b/src/test/datascience/activation.unit.test.ts @@ -5,23 +5,23 @@ export const __ = ''; // import { anything, deepEqual, instance, mock, verify, when } from 'ts-mockito'; // import { EventEmitter } from 'vscode'; -// import { IExtensionSingleActivationService } from '../../client/activation/types'; -// import { PythonExtensionChecker } from '../../client/api/pythonApi'; -// import { PythonExecutionFactory } from '../../client/common/process/pythonExecutionFactory'; -// import { IPythonExecutionFactory } from '../../client/common/process/types'; -// import { sleep } from '../../client/common/utils/async'; -// import { Activation } from '../../client/datascience/activation'; -// import { JupyterDaemonModule } from '../../client/datascience/constants'; -// import { ActiveEditorContextService } from '../../client/datascience/commands/activeEditorContext'; -// import { JupyterInterpreterService } from '../../client/datascience/jupyter/interpreter/jupyterInterpreterService'; -// import { KernelDaemonPreWarmer } from '../../client/datascience/kernel-launcher/kernelDaemonPreWarmer'; +// import { IExtensionSingleActivationService } from '../../platform/activation/types'; +// import { PythonExtensionChecker } from '../../platform/api/pythonApi'; +// import { PythonExecutionFactory } from '../../platform/common/process/pythonExecutionFactory'; +// import { IPythonExecutionFactory } from '../../platform/common/process/types'; +// import { sleep } from '../../platform/common/utils/async'; +// import { Activation } from '../../platform/datascience/activation'; +// import { JupyterDaemonModule } from '../../platform/datascience/constants'; +// import { ActiveEditorContextService } from '../../platform/datascience/commands/activeEditorContext'; +// import { JupyterInterpreterService } from '../../platform/datascience/jupyter/interpreter/jupyterInterpreterService'; +// import { KernelDaemonPreWarmer } from '../../platform/datascience/kernel-launcher/kernelDaemonPreWarmer'; // import { // INotebookCreationTracker, // INotebookEditor, // INotebookEditorProvider, // IRawNotebookSupportedService -// } from '../../client/datascience/types'; -// import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +// } from '../../platform/datascience/types'; +// import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; // import { FakeClock } from '../common'; // import { createPythonInterpreter } from '../utils/interpreters'; diff --git a/src/test/datascience/cellFactory.unit.test.ts b/src/test/datascience/cellFactory.unit.test.ts index 66f1443a41d..48c91db35ea 100644 --- a/src/test/datascience/cellFactory.unit.test.ts +++ b/src/test/datascience/cellFactory.unit.test.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. 'use strict'; import { assert } from 'chai'; -import { generateCells } from '../../client/datascience/cellFactory'; +import { generateCells } from '../../platform/datascience/cellFactory'; import { removeLinesFromFrontAndBack, stripComments } from '../../datascience-ui/common'; import * as vscode from 'vscode'; diff --git a/src/test/datascience/cellMatcher.unit.test.ts b/src/test/datascience/cellMatcher.unit.test.ts index 64b822e1c7a..826ee392c4e 100644 --- a/src/test/datascience/cellMatcher.unit.test.ts +++ b/src/test/datascience/cellMatcher.unit.test.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. 'use strict'; import { assert } from 'chai'; -import { IJupyterSettings } from '../../client/common/types'; -import { CellMatcher } from '../../client/datascience/cellMatcher'; +import { IJupyterSettings } from '../../platform/common/types'; +import { CellMatcher } from '../../platform/datascience/cellMatcher'; import { defaultDataScienceSettings } from './helpers'; suite('DataScience CellMatcher', () => { diff --git a/src/test/datascience/commands/serverSelector.unit.test.ts b/src/test/datascience/commands/serverSelector.unit.test.ts index e4521bbeeed..2df5372851a 100644 --- a/src/test/datascience/commands/serverSelector.unit.test.ts +++ b/src/test/datascience/commands/serverSelector.unit.test.ts @@ -2,10 +2,10 @@ // Licensed under the MIT License. import { anything, capture, instance, mock, verify } from 'ts-mockito'; import { Uri } from 'vscode'; -import { CommandManager } from '../../../client/common/application/commandManager'; -import { ICommandManager } from '../../../client/common/application/types'; -import { Commands } from '../../../client/datascience/constants'; -import { JupyterServerSelectorCommand } from '../../../extension/commands/serverSelector'; +import { CommandManager } from '../../../platform/common/application/commandManager'; +import { ICommandManager } from '../../../platform/common/application/types'; +import { Commands } from '../../../platform/datascience/constants'; +import { JupyterServerSelectorCommand } from '../../../platform/commands/serverSelector'; import { JupyterServerSelector } from '../../../kernels/jupyter/serverSelector'; /* eslint-disable */ diff --git a/src/test/datascience/data-viewing/dataViewer.unit.test.ts b/src/test/datascience/data-viewing/dataViewer.unit.test.ts index c88bd9bdddf..9eaa977fb36 100644 --- a/src/test/datascience/data-viewing/dataViewer.unit.test.ts +++ b/src/test/datascience/data-viewing/dataViewer.unit.test.ts @@ -5,19 +5,23 @@ import { anything, instance, mock, verify, when } from 'ts-mockito'; import { ConfigurationChangeEvent, EventEmitter } from 'vscode'; -import { ApplicationShell } from '../../../client/common/application/applicationShell'; -import { IApplicationShell, IWebviewPanelProvider, IWorkspaceService } from '../../../client/common/application/types'; -import { WebviewPanelProvider } from '../../../client/common/application/webviewPanels/webviewPanelProvider'; -import { WorkspaceService } from '../../../client/common/application/workspace'; -import { JupyterSettings } from '../../../client/common/configSettings'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { IConfigurationService } from '../../../client/common/types'; -import { CodeCssGenerator } from '../../../client/datascience/codeCssGenerator'; -import { DataViewer } from '../../../client/datascience/data-viewing/dataViewer'; -import { JupyterVariableDataProvider } from '../../../client/datascience/data-viewing/jupyterVariableDataProvider'; -import { IDataViewer, IDataViewerDataProvider } from '../../../client/datascience/data-viewing/types'; -import { ThemeFinder } from '../../../client/datascience/themeFinder'; -import { ICodeCssGenerator, IDataScienceErrorHandler, IThemeFinder } from '../../../client/datascience/types'; +import { ApplicationShell } from '../../../platform/common/application/applicationShell'; +import { + IApplicationShell, + IWebviewPanelProvider, + IWorkspaceService +} from '../../../platform/common/application/types'; +import { WebviewPanelProvider } from '../../../platform/common/application/webviewPanels/webviewPanelProvider'; +import { WorkspaceService } from '../../../platform/common/application/workspace'; +import { JupyterSettings } from '../../../platform/common/configSettings'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { IConfigurationService } from '../../../platform/common/types'; +import { CodeCssGenerator } from '../../../platform/datascience/codeCssGenerator'; +import { DataViewer } from '../../../platform/datascience/data-viewing/dataViewer'; +import { JupyterVariableDataProvider } from '../../../platform/datascience/data-viewing/jupyterVariableDataProvider'; +import { IDataViewer, IDataViewerDataProvider } from '../../../platform/datascience/data-viewing/types'; +import { ThemeFinder } from '../../../platform/datascience/themeFinder'; +import { ICodeCssGenerator, IDataScienceErrorHandler, IThemeFinder } from '../../../platform/datascience/types'; import { MockMemento } from '../../mocks/mementos'; suite('DataScience - DataViewer', () => { diff --git a/src/test/datascience/data-viewing/dataViewerDependencyService.unit.test.ts b/src/test/datascience/data-viewing/dataViewerDependencyService.unit.test.ts index f69ead9c936..3b8f472b258 100644 --- a/src/test/datascience/data-viewing/dataViewerDependencyService.unit.test.ts +++ b/src/test/datascience/data-viewing/dataViewerDependencyService.unit.test.ts @@ -7,14 +7,14 @@ import { assert } from 'chai'; import * as path from 'path'; import { SemVer } from 'semver'; import { anything, deepEqual, instance, mock, verify, when } from 'ts-mockito'; -import { ApplicationShell } from '../../../client/common/application/applicationShell'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { PythonExecutionFactory } from '../../../client/common/process/pythonExecutionFactory'; -import { IPythonExecutionFactory, IPythonExecutionService } from '../../../client/common/process/types'; -import { Common, DataScience } from '../../../client/common/utils/localize'; -import { DataViewerDependencyService } from '../../../client/datascience/data-viewing/dataViewerDependencyService'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { ApplicationShell } from '../../../platform/common/application/applicationShell'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { PythonExecutionFactory } from '../../../platform/common/process/pythonExecutionFactory'; +import { IPythonExecutionFactory, IPythonExecutionService } from '../../../platform/common/process/types'; +import { Common, DataScience } from '../../../platform/common/utils/localize'; +import { DataViewerDependencyService } from '../../../platform/datascience/data-viewing/dataViewerDependencyService'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { ProductInstaller } from '../../../kernels/installer/productInstaller'; import { IInstaller, Product } from '../../../kernels/installer/types'; diff --git a/src/test/datascience/datascience.unit.test.ts b/src/test/datascience/datascience.unit.test.ts index f1d4eff9565..0f1b493dd1a 100644 --- a/src/test/datascience/datascience.unit.test.ts +++ b/src/test/datascience/datascience.unit.test.ts @@ -6,18 +6,18 @@ import type * as nbformat from '@jupyterlab/nbformat'; import { assert } from 'chai'; import * as sinon from 'sinon'; import { anything, instance, mock, verify, when } from 'ts-mockito'; -import { CommandManager } from '../../client/common/application/commandManager'; -import { DocumentManager } from '../../client/common/application/documentManager'; -import { IDocumentManager, IWorkspaceService } from '../../client/common/application/types'; -import { WorkspaceService } from '../../client/common/application/workspace'; -import { JupyterSettings } from '../../client/common/configSettings'; -import { ConfigurationService } from '../../client/common/configuration/service'; -import { IConfigurationService, IWatchableJupyterSettings } from '../../client/common/types'; +import { CommandManager } from '../../platform/common/application/commandManager'; +import { DocumentManager } from '../../platform/common/application/documentManager'; +import { IDocumentManager, IWorkspaceService } from '../../platform/common/application/types'; +import { WorkspaceService } from '../../platform/common/application/workspace'; +import { JupyterSettings } from '../../platform/common/configSettings'; +import { ConfigurationService } from '../../platform/common/configuration/service'; +import { IConfigurationService, IWatchableJupyterSettings } from '../../platform/common/types'; import { CommandRegistry } from '../../interactive-window/commands/commandRegistry'; -import { pruneCell } from '../../client/datascience/common'; -import { GlobalActivation } from '../../client/datascience/datascience'; +import { pruneCell } from '../../platform/datascience/common'; +import { GlobalActivation } from '../../platform/datascience/datascience'; import { DataScienceCodeLensProvider } from '../../interactive-window/editor-integration/codelensprovider'; -import { IDataScienceCodeLensProvider, IRawNotebookSupportedService } from '../../client/datascience/types'; +import { IDataScienceCodeLensProvider, IRawNotebookSupportedService } from '../../platform/datascience/types'; import { RawNotebookSupportedService } from '../../kernels/raw/session/rawNotebookSupportedService'; /* eslint-disable */ diff --git a/src/test/datascience/datascienceSurveyBanner.vscode.test.ts b/src/test/datascience/datascienceSurveyBanner.vscode.test.ts index 386a166fd4c..9a225946623 100644 --- a/src/test/datascience/datascienceSurveyBanner.vscode.test.ts +++ b/src/test/datascience/datascienceSurveyBanner.vscode.test.ts @@ -8,20 +8,20 @@ export const __ = ''; // import * as fakeTimers from '@sinonjs/fake-timers'; // import * as sinon from 'sinon'; // import { anything, instance, mock, when, verify, resetCalls } from 'ts-mockito'; -// import { IApplicationEnvironment, IApplicationShell, IVSCodeNotebook } from '../../client/common/application/types'; -// import { IBrowserService, IPersistentState, IPersistentStateFactory } from '../../client/common/types'; +// import { IApplicationEnvironment, IApplicationShell, IVSCodeNotebook } from '../../platform/common/application/types'; +// import { IBrowserService, IPersistentState, IPersistentStateFactory } from '../../platform/common/types'; // import { // BannerType, // DataScienceSurveyBanner, // DSSurveyStateKeys, // InsidersNotebookSurveyStateKeys, // ShowBannerWithExpiryTime -// } from '../../client/datascience/dataScienceSurveyBanner'; -// import { INotebookEditorProvider, INotebookExtensibility } from '../../client/datascience/types'; -// import { noop } from '../../client/common/utils/misc'; +// } from '../../platform/datascience/dataScienceSurveyBanner'; +// import { INotebookEditorProvider, INotebookExtensibility } from '../../platform/datascience/types'; +// import { noop } from '../../platform/common/utils/misc'; // import { UIKind } from 'vscode'; -// import * as localize from '../../client/common/utils/localize'; -// import { MillisecondsInADay } from '../../client/constants'; +// import * as localize from '../../platform/common/utils/localize'; +// import { MillisecondsInADay } from '../../platform/constants'; // import { TestPersistentStateFactory } from './testPersistentStateFactory'; // import { MockMemento } from '../mocks/mementos'; diff --git a/src/test/datascience/dataviewer.functional.test.tsx b/src/test/datascience/dataviewer.functional.test.tsx index 7f8eb717da5..d4830bb24ae 100644 --- a/src/test/datascience/dataviewer.functional.test.tsx +++ b/src/test/datascience/dataviewer.functional.test.tsx @@ -8,7 +8,7 @@ suite('Dummy1a', () => { }); }); // /* eslint-disable , comma-dangle, @typescript-eslint/no-explicit-any, no-multi-str */ -// import '../../client/common/extensions'; +// import '../../platform/common/extensions'; // import type * as nbformat from '@jupyterlab/nbformat'; // import * as assert from 'assert'; @@ -18,21 +18,21 @@ suite('Dummy1a', () => { // import * as React from 'react'; // import * as uuid from 'uuid/v4'; // import { Disposable } from 'vscode'; -// const telemetry = require('../../client/telemetry/index'); -// import { Identifiers, Telemetry } from '../../client/datascience/constants'; +// const telemetry = require('../../telemetry/index'); +// import { Identifiers, Telemetry } from '../../platform/datascience/constants'; // import { // DataViewerMessages, // IDataViewer, // IDataViewerDataProvider, // IDataViewerFactory -// } from '../../client/datascience/data-viewing/types'; -// import { getDefaultInteractiveIdentity } from '../../client/datascience/interactive-window/identity'; +// } from '../../platform/datascience/data-viewing/types'; +// import { getDefaultInteractiveIdentity } from '../../platform/datascience/interactive-window/identity'; // import { // IJupyterVariable, // IJupyterVariableDataProviderFactory, // INotebook, // INotebookProvider -// } from '../../client/datascience/types'; +// } from '../../platform/datascience/types'; // import { MainPanel } from '../../datascience-ui/data-explorer/mainPanel'; // import { ReactSlickGrid } from '../../datascience-ui/data-explorer/reactSlickGrid'; // import { noop, sleep } from '../core'; @@ -41,7 +41,7 @@ suite('Dummy1a', () => { // import { IMountedWebView } from './mountedWebView'; // import { SliceControl } from '../../datascience-ui/data-explorer/sliceControl'; // import { Dropdown } from '@fluentui/react'; -// import { CheckboxState, SliceOperationSource } from '../../client/telemetry/constants'; +// import { CheckboxState, SliceOperationSource } from '../../telemetry/constants'; // import { range } from 'lodash'; // interface ISliceControlTestInterface { diff --git a/src/test/datascience/debugLocationTracker.unit.test.ts b/src/test/datascience/debugLocationTracker.unit.test.ts index 055205a5bb3..f5facdc03af 100644 --- a/src/test/datascience/debugLocationTracker.unit.test.ts +++ b/src/test/datascience/debugLocationTracker.unit.test.ts @@ -5,8 +5,8 @@ import { expect } from 'chai'; import { DebugProtocol } from 'vscode-debugprotocol'; -import { DebugLocationTracker } from '../../client/datascience/debugLocationTracker'; -import { IDebugLocation } from '../../client/datascience/types'; +import { DebugLocationTracker } from '../../platform/datascience/debugLocationTracker'; +import { IDebugLocation } from '../../platform/datascience/types'; suite('Debug Location Tracker', () => { let debugTracker: DebugLocationTracker; diff --git a/src/test/datascience/debugger.vscode.test.ts b/src/test/datascience/debugger.vscode.test.ts index 265fabb8297..3c59b0aacf9 100644 --- a/src/test/datascience/debugger.vscode.test.ts +++ b/src/test/datascience/debugger.vscode.test.ts @@ -2,10 +2,10 @@ // Licensed under the MIT License. 'use strict'; import * as sinon from 'sinon'; -import { ICommandManager, IVSCodeNotebook } from '../../client/common/application/types'; -import { IDisposable } from '../../client/common/types'; -import { Commands } from '../../client/datascience/constants'; -import { IVariableViewProvider } from '../../client/datascience/variablesView/types'; +import { ICommandManager, IVSCodeNotebook } from '../../platform/common/application/types'; +import { IDisposable } from '../../platform/common/types'; +import { Commands } from '../../platform/datascience/constants'; +import { IVariableViewProvider } from '../../platform/datascience/variablesView/types'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../common'; import { initialize, IS_REMOTE_NATIVE_TEST } from '../initialize'; import { @@ -22,8 +22,8 @@ import { getDebugSessionAndAdapter } from './notebook/helper'; import { ITestVariableViewProvider } from './variableView/variableViewTestInterfaces'; -import { traceInfo } from '../../client/common/logger'; -import { IDebuggingManager } from '../../client/debugger/types'; +import { traceInfo } from '../../platform/common/logger'; +import { IDebuggingManager } from '../../platform/debugger/types'; import { assert } from 'chai'; import { debug } from 'vscode'; import { ITestWebviewHost } from './testInterfaces'; diff --git a/src/test/datascience/editor-integration/cellhashprovider.unit.test.ts b/src/test/datascience/editor-integration/cellhashprovider.unit.test.ts index 5afaefc94eb..f23f70418b3 100644 --- a/src/test/datascience/editor-integration/cellhashprovider.unit.test.ts +++ b/src/test/datascience/editor-integration/cellhashprovider.unit.test.ts @@ -5,12 +5,12 @@ import { assert } from 'chai'; import * as TypeMoq from 'typemoq'; import { NotebookCell, NotebookCellKind, Position, Range, Uri } from 'vscode'; -import { IDebugService } from '../../../client/common/application/types'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IConfigurationService, IWatchableJupyterSettings } from '../../../client/common/types'; +import { IDebugService } from '../../../platform/common/application/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IConfigurationService, IWatchableJupyterSettings } from '../../../platform/common/types'; import { CellHashProvider } from '../../../interactive-window/editor-integration/cellhashprovider'; -import { IKernel } from '../../../client/../kernels/types'; -import { ICellHashListener, IFileHashes } from '../../../client/datascience/types'; +import { IKernel } from '../../../platform/../kernels/types'; +import { ICellHashListener, IFileHashes } from '../../../platform/datascience/types'; import { MockDocument } from '../mockDocument'; import { MockDocumentManager } from '../mockDocumentManager'; import { JupyterNotebookView } from '../../../notebooks/constants'; diff --git a/src/test/datascience/editor-integration/codelensprovider.unit.test.ts b/src/test/datascience/editor-integration/codelensprovider.unit.test.ts index 678dca52523..486d1a885d4 100644 --- a/src/test/datascience/editor-integration/codelensprovider.unit.test.ts +++ b/src/test/datascience/editor-integration/codelensprovider.unit.test.ts @@ -11,12 +11,12 @@ import { IDocumentManager, IVSCodeNotebook, IWorkspaceService -} from '../../../client/common/application/types'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IConfigurationService, IWatchableJupyterSettings } from '../../../client/common/types'; +} from '../../../platform/common/application/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IConfigurationService, IWatchableJupyterSettings } from '../../../platform/common/types'; import { DataScienceCodeLensProvider } from '../../../interactive-window/editor-integration/codelensprovider'; -import { ICodeWatcher, IDataScienceCodeLensProvider, IDebugLocationTracker } from '../../../client/datascience/types'; -import { IServiceContainer } from '../../../client/ioc/types'; +import { ICodeWatcher, IDataScienceCodeLensProvider, IDebugLocationTracker } from '../../../platform/datascience/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; // eslint-disable-next-line suite('DataScienceCodeLensProvider Unit Tests', () => { diff --git a/src/test/datascience/editor-integration/codewatcher.unit.test.ts b/src/test/datascience/editor-integration/codewatcher.unit.test.ts index 8a4f0d8c54d..d97f670a8ca 100644 --- a/src/test/datascience/editor-integration/codewatcher.unit.test.ts +++ b/src/test/datascience/editor-integration/codewatcher.unit.test.ts @@ -24,10 +24,10 @@ import { IDocumentManager, IVSCodeNotebook, IWorkspaceService -} from '../../../client/common/application/types'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IConfigurationService } from '../../../client/common/types'; -import { Commands, EditorContexts } from '../../../client/datascience/constants'; +} from '../../../platform/common/application/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IConfigurationService } from '../../../platform/common/types'; +import { Commands, EditorContexts } from '../../../platform/datascience/constants'; import { CodeLensFactory } from '../../../interactive-window/editor-integration/codeLensFactory'; import { DataScienceCodeLensProvider } from '../../../interactive-window/editor-integration/codelensprovider'; import { CodeWatcher } from '../../../interactive-window/editor-integration/codewatcher'; @@ -37,17 +37,17 @@ import { IDebugLocationTracker, IInteractiveWindow, IInteractiveWindowProvider -} from '../../../client/datascience/types'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { ICodeExecutionHelper } from '../../../client/terminals/types'; +} from '../../../platform/datascience/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { ICodeExecutionHelper } from '../../../platform/terminals/types'; import { MockDocumentManager } from '../mockDocumentManager'; import { MockJupyterSettings } from '../mockJupyterSettings'; import { MockEditor } from '../mockTextEditor'; import { createDocument } from './helpers'; -import { disposeAllDisposables } from '../../../client/common/helpers'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; import { CellHashProviderFactory } from '../../../interactive-window/editor-integration/cellHashProviderFactory'; -import { IKernel, IKernelProvider } from '../../../client/../kernels/types'; -import { InteractiveCellResultError } from '../../../extension/errors/interactiveCellResultError'; +import { IKernel, IKernelProvider } from '../../../platform/../kernels/types'; +import { InteractiveCellResultError } from '../../../platform/errors/interactiveCellResultError'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/test/datascience/editor-integration/gotocell.functional.test.ts b/src/test/datascience/editor-integration/gotocell.functional.test.ts index 17315418236..046a01d15ff 100644 --- a/src/test/datascience/editor-integration/gotocell.functional.test.ts +++ b/src/test/datascience/editor-integration/gotocell.functional.test.ts @@ -15,14 +15,14 @@ suite('Dummy12', () => { // import { CancellationToken } from 'vscode-jsonrpc'; // import { range } from 'lodash'; -// import { IDocumentManager } from '../../../client/common/application/types'; -// import { EXTENSION_ROOT_DIR } from '../../../client/common/constants'; -// import { traceError } from '../../../client/common/logger'; -// import { IJupyterSettings } from '../../../client/common/types'; -// import * as CellFactory from '../../../client/datascience/cellFactory'; -// import { Commands } from '../../../client/datascience/constants'; -// import { InteractiveWindowMessages } from '../../../extension/messageTypes'; -// import { getDefaultInteractiveIdentity } from '../../../client/datascience/interactive-window/identity'; +// import { IDocumentManager } from '../../../platform/common/application/types'; +// import { EXTENSION_ROOT_DIR } from '../../../platform/common/constants'; +// import { traceError } from '../../../platform/common/logger'; +// import { IJupyterSettings } from '../../../platform/common/types'; +// import * as CellFactory from '../../../platform/datascience/cellFactory'; +// import { Commands } from '../../../platform/datascience/constants'; +// import { InteractiveWindowMessages } from '../../../platform/messageTypes'; +// import { getDefaultInteractiveIdentity } from '../../../platform/datascience/interactive-window/identity'; // import { // ICell, // ICodeLensFactory, @@ -30,7 +30,7 @@ suite('Dummy12', () => { // IInteractiveWindowListener, // INotebook, // INotebookProvider -// } from '../../../client/datascience/types'; +// } from '../../../platform/datascience/types'; // import { DataScienceIocContainer } from '../dataScienceIocContainer'; // import { MockDocumentManager } from '../mockDocumentManager'; diff --git a/src/test/datascience/editor-integration/hoverProvider.vscode.test.ts b/src/test/datascience/editor-integration/hoverProvider.vscode.test.ts index e58e177d882..a6553aab1df 100644 --- a/src/test/datascience/editor-integration/hoverProvider.vscode.test.ts +++ b/src/test/datascience/editor-integration/hoverProvider.vscode.test.ts @@ -10,17 +10,17 @@ import { IJupyterSettings, IVariableTooltipFields, ReadWrite -} from '../../../client/common/types'; -import { IInteractiveWindowProvider, IJupyterVariables } from '../../../client/datascience/types'; +} from '../../../platform/common/types'; +import { IInteractiveWindowProvider, IJupyterVariables } from '../../../platform/datascience/types'; import { IExtensionTestApi, openFile, sleep } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants'; import { initialize } from '../../initialize'; import { HoverProvider } from '../../../interactive-window/editor-integration/hoverProvider'; -import { Identifiers } from '../../../client/datascience/constants'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { IKernelProvider } from '../../../client/../kernels/types'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { IFileSystem } from '../../../client/common/platform/types'; +import { Identifiers } from '../../../platform/datascience/constants'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { IKernelProvider } from '../../../platform/../kernels/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; suite('Hover provider', async () => { const file = path.join( diff --git a/src/test/datascience/errorHandler.functional.test.tsx b/src/test/datascience/errorHandler.functional.test.tsx index 53ec48bb3a6..1ed6da6b0f9 100644 --- a/src/test/datascience/errorHandler.functional.test.tsx +++ b/src/test/datascience/errorHandler.functional.test.tsx @@ -10,10 +10,10 @@ suite('Dummy3', () => { // import { assert } from 'chai'; // import * as sinon from 'sinon'; // import * as TypeMoq from 'typemoq'; -// import { IDocumentManager } from '../../client/common/application/types'; -// import { JupyterInterpreterSubCommandExecutionService } from '../../client/datascience/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService'; -// import { JupyterInstallError } from '../../client/datascience/jupyter/jupyterInstallError'; -// import { ICodeWatcher, IInteractiveWindowProvider, IJupyterExecution } from '../../client/datascience/types'; +// import { IDocumentManager } from '../../platform/common/application/types'; +// import { JupyterInterpreterSubCommandExecutionService } from '../../platform/datascience/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService'; +// import { JupyterInstallError } from '../../platform/datascience/jupyter/jupyterInstallError'; +// import { ICodeWatcher, IInteractiveWindowProvider, IJupyterExecution } from '../../platform/datascience/types'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; // import { MockDocumentManager } from './mockDocumentManager'; diff --git a/src/test/datascience/errorHandler.unit.test.ts b/src/test/datascience/errorHandler.unit.test.ts index 3aa49aaa902..d9717e5d47a 100644 --- a/src/test/datascience/errorHandler.unit.test.ts +++ b/src/test/datascience/errorHandler.unit.test.ts @@ -6,25 +6,25 @@ import * as dedent from 'dedent'; import { assert } from 'chai'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import { Uri, WorkspaceFolder } from 'vscode'; -import { IApplicationShell, IWorkspaceService } from '../../client/common/application/types'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; -import { Common, DataScience } from '../../client/common/utils/localize'; -import { IBrowserService, IConfigurationService } from '../../client/common/types'; -import { KernelConnectionMetadata } from '../../client/../kernels/types'; +import { IApplicationShell, IWorkspaceService } from '../../platform/common/application/types'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; +import { Common, DataScience } from '../../platform/common/utils/localize'; +import { IBrowserService, IConfigurationService } from '../../platform/common/types'; +import { KernelConnectionMetadata } from '../../platform/../kernels/types'; import { IJupyterInterpreterDependencyManager, IKernelDependencyService, KernelInterpreterDependencyResponse -} from '../../client/datascience/types'; +} from '../../platform/datascience/types'; import { getOSType, OSType } from '../common'; -import { PythonEnvironment, EnvironmentType } from '../../client/pythonEnvironments/info'; +import { PythonEnvironment, EnvironmentType } from '../../platform/pythonEnvironments/info'; import { JupyterInterpreterDependencyResponse } from '../../kernels/jupyter/interpreter/jupyterInterpreterDependencyService'; import { JupyterInterpreterService } from '../../kernels/jupyter/interpreter/jupyterInterpreterService'; -import { DataScienceErrorHandler } from '../../extension/errors/errorHandler'; -import { JupyterConnectError } from '../../extension/errors/jupyterConnectError'; -import { JupyterInstallError } from '../../extension/errors/jupyterInstallError'; -import { JupyterSelfCertsError } from '../../extension/errors/jupyterSelfCertsError'; -import { KernelDiedError } from '../../extension/errors/kernelDiedError'; +import { DataScienceErrorHandler } from '../../platform/errors/errorHandler'; +import { JupyterConnectError } from '../../platform/errors/jupyterConnectError'; +import { JupyterInstallError } from '../../platform/errors/jupyterInstallError'; +import { JupyterSelfCertsError } from '../../platform/errors/jupyterSelfCertsError'; +import { KernelDiedError } from '../../platform/errors/kernelDiedError'; suite('DataScience Error Handler Unit Tests', () => { let applicationShell: IApplicationShell; diff --git a/src/test/datascience/execution.unit.test.ts b/src/test/datascience/execution.unit.test.ts index a04672e1ce1..929f21a8ed5 100644 --- a/src/test/datascience/execution.unit.test.ts +++ b/src/test/datascience/execution.unit.test.ts @@ -12,15 +12,15 @@ import { Matcher } from 'ts-mockito/lib/matcher/type/Matcher'; import * as TypeMoq from 'typemoq'; import * as uuid from 'uuid/v4'; import { CancellationTokenSource, ConfigurationChangeEvent, Disposable, EventEmitter } from 'vscode'; -import { ApplicationShell } from '../../client/common/application/applicationShell'; -import { IApplicationShell, IWorkspaceService } from '../../client/common/application/types'; -import { WorkspaceService } from '../../client/common/application/workspace'; -import { ConfigurationService } from '../../client/common/configuration/service'; -import { PersistentState, PersistentStateFactory } from '../../client/common/persistentState'; -import { FileSystem } from '../../client/common/platform/fileSystem'; -import { IFileSystem } from '../../client/common/platform/types'; -import { ProcessServiceFactory } from '../../client/common/process/processFactory'; -import { PythonExecutionFactory } from '../../client/common/process/pythonExecutionFactory'; +import { ApplicationShell } from '../../platform/common/application/applicationShell'; +import { IApplicationShell, IWorkspaceService } from '../../platform/common/application/types'; +import { WorkspaceService } from '../../platform/common/application/workspace'; +import { ConfigurationService } from '../../platform/common/configuration/service'; +import { PersistentState, PersistentStateFactory } from '../../platform/common/persistentState'; +import { FileSystem } from '../../platform/common/platform/fileSystem'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { ProcessServiceFactory } from '../../platform/common/process/processFactory'; +import { PythonExecutionFactory } from '../../platform/common/process/pythonExecutionFactory'; import { ExecutionResult, IProcessService, @@ -30,20 +30,25 @@ import { IPythonExecutionService, ObservableExecutionResult, Output -} from '../../client/common/process/types'; -import { IAsyncDisposableRegistry, IConfigurationService, IOutputChannel, IPathUtils } from '../../client/common/types'; -import { EXTENSION_ROOT_DIR } from '../../client/constants'; -import { DisplayOptions } from '../../client/datascience/displayOptions'; +} from '../../platform/common/process/types'; +import { + IAsyncDisposableRegistry, + IConfigurationService, + IOutputChannel, + IPathUtils +} from '../../platform/common/types'; +import { EXTENSION_ROOT_DIR } from '../../platform/constants'; +import { DisplayOptions } from '../../platform/datascience/displayOptions'; import { IJupyterKernelSpec, IJupyterSubCommandExecutionService, INotebookServer -} from '../../client/datascience/types'; -import { IEnvironmentActivationService } from '../../client/interpreter/activation/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { ServiceContainer } from '../../client/ioc/container'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { areInterpreterPathsSame } from '../../client/pythonEnvironments/info/interpreter'; +} from '../../platform/datascience/types'; +import { IEnvironmentActivationService } from '../../platform/interpreter/activation/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { ServiceContainer } from '../../platform/ioc/container'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { areInterpreterPathsSame } from '../../platform/pythonEnvironments/info/interpreter'; import { getKernelId } from '../../kernels/helpers'; import { Product } from '../../kernels/installer/types'; import { JupyterInterpreterDependencyService } from '../../kernels/jupyter/interpreter/jupyterInterpreterDependencyService'; diff --git a/src/test/datascience/executionServiceMock.ts b/src/test/datascience/executionServiceMock.ts index 35e9a45567d..c882c388e95 100644 --- a/src/test/datascience/executionServiceMock.ts +++ b/src/test/datascience/executionServiceMock.ts @@ -3,18 +3,18 @@ 'use strict'; import { SemVer } from 'semver'; -import { ErrorUtils } from '../../client/../extension/errors/errorUtils'; -import { ModuleNotInstalledError } from '../../client/../extension/errors/moduleNotInstalledError'; -import { BufferDecoder } from '../../client/common/process/decoder'; -import { ProcessService } from '../../client/common/process/proc'; +import { ErrorUtils } from '../../platform/errors/errorUtils'; +import { ModuleNotInstalledError } from '../../platform/errors/moduleNotInstalledError'; +import { BufferDecoder } from '../../platform/common/process/decoder'; +import { ProcessService } from '../../platform/common/process/proc'; import { ExecutionResult, IPythonExecutionService, ObservableExecutionResult, SpawnOptions -} from '../../client/common/process/types'; -import { buildPythonExecInfo } from '../../client/pythonEnvironments/exec'; -import { InterpreterInformation } from '../../client/pythonEnvironments/info'; +} from '../../platform/common/process/types'; +import { buildPythonExecInfo } from '../../platform/pythonEnvironments/exec'; +import { InterpreterInformation } from '../../platform/pythonEnvironments/info'; export class MockPythonExecutionService implements IPythonExecutionService { private procService: ProcessService; diff --git a/src/test/datascience/export/exportFileOpener.unit.test.ts b/src/test/datascience/export/exportFileOpener.unit.test.ts index af94b96d8bc..f5717fe2200 100644 --- a/src/test/datascience/export/exportFileOpener.unit.test.ts +++ b/src/test/datascience/export/exportFileOpener.unit.test.ts @@ -5,12 +5,12 @@ import { anything, instance, mock, verify, when } from 'ts-mockito'; import { TextEditor, Uri } from 'vscode'; -import { IApplicationShell, IDocumentManager } from '../../../client/common/application/types'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IBrowserService, IDisposable } from '../../../client/common/types'; -import { ExportFileOpener } from '../../../client/datascience/export/exportFileOpener'; -import { ExportFormat } from '../../../client/datascience/export/types'; -import { ProgressReporter } from '../../../client/datascience/progress/progressReporter'; +import { IApplicationShell, IDocumentManager } from '../../../platform/common/application/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IBrowserService, IDisposable } from '../../../platform/common/types'; +import { ExportFileOpener } from '../../../platform/datascience/export/exportFileOpener'; +import { ExportFormat } from '../../../platform/datascience/export/types'; +import { ProgressReporter } from '../../../platform/datascience/progress/progressReporter'; import { getLocString } from '../../../datascience-ui/react-common/locReactSide'; suite('DataScience - Export File Opener', () => { diff --git a/src/test/datascience/export/exportToHTML.vscode.test.ts b/src/test/datascience/export/exportToHTML.vscode.test.ts index 67826adb57b..2a2b5931d5c 100644 --- a/src/test/datascience/export/exportToHTML.vscode.test.ts +++ b/src/test/datascience/export/exportToHTML.vscode.test.ts @@ -5,9 +5,9 @@ import { assert } from 'chai'; import * as path from 'path'; import { CancellationTokenSource, Uri } from 'vscode'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { ExportInterpreterFinder } from '../../../client/datascience/export/exportInterpreterFinder'; -import { ExportFormat, INbConvertExport } from '../../../client/datascience/export/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { ExportInterpreterFinder } from '../../../platform/datascience/export/exportInterpreterFinder'; +import { ExportFormat, INbConvertExport } from '../../../platform/datascience/export/types'; import { IExtensionTestApi } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants'; import { closeActiveWindows, initialize } from '../../initialize'; diff --git a/src/test/datascience/export/exportToPython.vscode.test.ts b/src/test/datascience/export/exportToPython.vscode.test.ts index 2daa5dd633d..728faafecfe 100644 --- a/src/test/datascience/export/exportToPython.vscode.test.ts +++ b/src/test/datascience/export/exportToPython.vscode.test.ts @@ -5,10 +5,10 @@ import { assert } from 'chai'; import * as path from 'path'; import { CancellationTokenSource, Uri } from 'vscode'; -import { IDocumentManager } from '../../../client/common/application/types'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { ExportInterpreterFinder } from '../../../client/datascience/export/exportInterpreterFinder'; -import { ExportFormat, INbConvertExport } from '../../../client/datascience/export/types'; +import { IDocumentManager } from '../../../platform/common/application/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { ExportInterpreterFinder } from '../../../platform/datascience/export/exportInterpreterFinder'; +import { ExportFormat, INbConvertExport } from '../../../platform/datascience/export/types'; import { IExtensionTestApi } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants'; import { closeActiveWindows, initialize } from '../../initialize'; diff --git a/src/test/datascience/export/exportUtil.vscode.test.ts b/src/test/datascience/export/exportUtil.vscode.test.ts index a5ce0a9a0b9..dc589809332 100644 --- a/src/test/datascience/export/exportUtil.vscode.test.ts +++ b/src/test/datascience/export/exportUtil.vscode.test.ts @@ -7,8 +7,8 @@ import { assert } from 'chai'; import * as fs from 'fs-extra'; import * as path from 'path'; import { Uri } from 'vscode'; -import { IDisposable } from '../../../client/common/types'; -import { ExportUtil } from '../../../client/datascience/export/exportUtil'; +import { IDisposable } from '../../../platform/common/types'; +import { ExportUtil } from '../../../platform/datascience/export/exportUtil'; import { IExtensionTestApi } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants'; import { closeActiveWindows, initialize } from '../../initialize'; diff --git a/src/test/datascience/export/fileConverter.vscode.test.ts b/src/test/datascience/export/fileConverter.vscode.test.ts index 2985115273f..723d51fd371 100644 --- a/src/test/datascience/export/fileConverter.vscode.test.ts +++ b/src/test/datascience/export/fileConverter.vscode.test.ts @@ -7,20 +7,20 @@ import { anything, instance, mock, verify, when } from 'ts-mockito'; import * as sinon from 'sinon'; import { Uri } from 'vscode'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { IFileSystem } from '../../../client/common/platform/types'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { IFileSystem } from '../../../platform/common/platform/types'; import { IConfigurationService, IDisposable, IExtensions, IWatchableJupyterSettings -} from '../../../client/common/types'; -import { ExportFileOpener } from '../../../client/datascience/export/exportFileOpener'; -import { ExportInterpreterFinder } from '../../../client/datascience/export/exportInterpreterFinder'; -import { FileConverter } from '../../../client/datascience/export/fileConverter'; -import { ExportUtil } from '../../../client/datascience/export/exportUtil'; -import { ExportFormat, INbConvertExport, IExportDialog, IExport } from '../../../client/datascience/export/types'; -import { ProgressReporter } from '../../../client/datascience/progress/progressReporter'; +} from '../../../platform/common/types'; +import { ExportFileOpener } from '../../../platform/datascience/export/exportFileOpener'; +import { ExportInterpreterFinder } from '../../../platform/datascience/export/exportInterpreterFinder'; +import { FileConverter } from '../../../platform/datascience/export/fileConverter'; +import { ExportUtil } from '../../../platform/datascience/export/exportUtil'; +import { ExportFormat, INbConvertExport, IExportDialog, IExport } from '../../../platform/datascience/export/types'; +import { ProgressReporter } from '../../../platform/datascience/progress/progressReporter'; suite('DataScience - File Converter', () => { let fileConverter: FileConverter; diff --git a/src/test/datascience/extensionRecommendation.unit.test.ts b/src/test/datascience/extensionRecommendation.unit.test.ts index 6e06e9c8819..aefd2bfa5ea 100644 --- a/src/test/datascience/extensionRecommendation.unit.test.ts +++ b/src/test/datascience/extensionRecommendation.unit.test.ts @@ -4,13 +4,13 @@ import type * as nbformat from '@jupyterlab/nbformat'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import { EventEmitter, Memento, NotebookDocument } from 'vscode'; -import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../client/common/application/types'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { IDisposable, IExtensions } from '../../client/common/types'; -import { sleep } from '../../client/common/utils/async'; -import { Common } from '../../client/common/utils/localize'; -import { ExtensionRecommendationService } from '../../client/datascience/extensionRecommendation'; -import { IJupyterKernelSpec } from '../../client/datascience/types'; +import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../platform/common/application/types'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { IDisposable, IExtensions } from '../../platform/common/types'; +import { sleep } from '../../platform/common/utils/async'; +import { Common } from '../../platform/common/utils/localize'; +import { ExtensionRecommendationService } from '../../platform/datascience/extensionRecommendation'; +import { IJupyterKernelSpec } from '../../platform/datascience/types'; import { JupyterNotebookView } from '../../notebooks/constants'; import { VSCodeNotebookController } from '../../notebooks/controllers/vscodeNotebookController'; import { INotebookControllerManager } from '../../notebooks/types'; diff --git a/src/test/datascience/group1.nonConda.functional.test.tsx b/src/test/datascience/group1.nonConda.functional.test.tsx index 4e64bef5e0f..915fd25cc68 100644 --- a/src/test/datascience/group1.nonConda.functional.test.tsx +++ b/src/test/datascience/group1.nonConda.functional.test.tsx @@ -10,7 +10,7 @@ suite('Dummy4', () => { // import * as assert from 'assert'; // import { Disposable } from 'vscode'; -// import { InteractiveWindowMessages } from '../../client/datascience/interactive-common/interactiveWindowTypes'; +// import { InteractiveWindowMessages } from '../../platform/datascience/interactive-common/interactiveWindowTypes'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; // import { takeSnapshot, writeDiffSnapshot } from './helpers'; // import { addCode, getOrCreateInteractiveWindow, runTest } from './interactiveWindowTestHelpers'; diff --git a/src/test/datascience/helpers.ts b/src/test/datascience/helpers.ts index 845d762595c..acd2ce23254 100644 --- a/src/test/datascience/helpers.ts +++ b/src/test/datascience/helpers.ts @@ -4,18 +4,18 @@ 'use strict'; import { noop } from 'lodash'; import * as vscode from 'vscode'; -import { IPythonApiProvider } from '../../client/api/types'; -import { traceInfo } from '../../client/common/logger'; -import { arePathsSame } from '../../client/common/platform/fileUtils'; -import { IJupyterSettings } from '../../client/common/types'; -import { Commands } from '../../client/datascience/constants'; +import { IPythonApiProvider } from '../../platform/api/types'; +import { traceInfo } from '../../platform/common/logger'; +import { arePathsSame } from '../../platform/common/platform/fileUtils'; +import { IJupyterSettings } from '../../platform/common/types'; +import { Commands } from '../../platform/datascience/constants'; import { InteractiveWindow } from '../../interactive-window/interactiveWindow'; import { InteractiveWindowProvider } from '../../interactive-window/interactiveWindowProvider'; import { IDataScienceCodeLensProvider, IInteractiveWindow, IInteractiveWindowProvider -} from '../../client/datascience/types'; +} from '../../platform/datascience/types'; import { waitForCondition } from '../common'; import { createTemporaryFile, diff --git a/src/test/datascience/intellisense.functional.test.tsx b/src/test/datascience/intellisense.functional.test.tsx index 77ea5d58a28..3702fc94fc2 100644 --- a/src/test/datascience/intellisense.functional.test.tsx +++ b/src/test/datascience/intellisense.functional.test.tsx @@ -12,11 +12,11 @@ suite('Dummy5', () => { // import { Disposable } from 'vscode'; // import type * as nbformat from '@jupyterlab/nbformat'; -// import { ILanguageServerProvider } from '../../client/api/types'; -// import { createDeferred } from '../../client/common/utils/async'; -// import { InteractiveWindowMessages } from '../../client/datascience/interactive-common/interactiveWindowTypes'; -// import { INotebookEditorProvider } from '../../client/datascience/types'; -// import { IInterpreterService } from '../../client/interpreter/contracts'; +// import { ILanguageServerProvider } from '../../platform/api/types'; +// import { createDeferred } from '../../platform/common/utils/async'; +// import { InteractiveWindowMessages } from '../../platform/datascience/interactive-common/interactiveWindowTypes'; +// import { INotebookEditorProvider } from '../../platform/datascience/types'; +// import { IInterpreterService } from '../../platform/interpreter/contracts'; // import { noop } from '../core'; // import { InterpreterService } from '../interpreters/interpreterService'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; @@ -26,7 +26,7 @@ suite('Dummy5', () => { // import * as NativeHelpers from './nativeEditorTestHelpers'; // import { addMockData, enterEditorKey, getInteractiveEditor, getNativeEditor, typeCode } from './testHelpers'; // import { ITestNativeEditorProvider } from './testNativeEditorProvider'; -// import { IDisposable } from '../../client/common/types'; +// import { IDisposable } from '../../platform/common/types'; // /* eslint-disable , comma-dangle, @typescript-eslint/no-explicit-any, no-multi-str */ // suite(`DataScience Intellisense tests with LanguageServer mocked`, () => { diff --git a/src/test/datascience/interactive-common/notebookProvider.unit.test.ts b/src/test/datascience/interactive-common/notebookProvider.unit.test.ts index cf2348f07ae..1eac1b9d189 100644 --- a/src/test/datascience/interactive-common/notebookProvider.unit.test.ts +++ b/src/test/datascience/interactive-common/notebookProvider.unit.test.ts @@ -4,13 +4,13 @@ import { expect } from 'chai'; import { anything, instance, mock, when } from 'ts-mockito'; import * as typemoq from 'typemoq'; import * as vscode from 'vscode'; -import { PythonExtensionChecker } from '../../../client/api/pythonApi'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { IJupyterSettings } from '../../../client/common/types'; -import { DisplayOptions } from '../../../client/datascience/displayOptions'; -import { KernelConnectionMetadata } from '../../../client/../kernels/types'; -import { IJupyterNotebookProvider, INotebook, IRawNotebookProvider } from '../../../client/datascience/types'; +import { PythonExtensionChecker } from '../../../platform/api/pythonApi'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { IJupyterSettings } from '../../../platform/common/types'; +import { DisplayOptions } from '../../../platform/datascience/displayOptions'; +import { KernelConnectionMetadata } from '../../../platform/../kernels/types'; +import { IJupyterNotebookProvider, INotebook, IRawNotebookProvider } from '../../../platform/datascience/types'; import { NotebookProvider } from '../../../kernels/jupyter/launcher/notebookProvider'; function Uri(filename: string): vscode.Uri { diff --git a/src/test/datascience/interactive-common/notebookServerProvider.unit.test.ts b/src/test/datascience/interactive-common/notebookServerProvider.unit.test.ts index 1ae8283cbae..cd0fa8ca26d 100644 --- a/src/test/datascience/interactive-common/notebookServerProvider.unit.test.ts +++ b/src/test/datascience/interactive-common/notebookServerProvider.unit.test.ts @@ -5,12 +5,12 @@ import { SemVer } from 'semver'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import * as typemoq from 'typemoq'; import { CancellationTokenSource, Disposable, EventEmitter } from 'vscode'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { IConfigurationService, IWatchableJupyterSettings } from '../../../client/common/types'; -import { DisplayOptions } from '../../../client/datascience/displayOptions'; -import { IJupyterExecution, INotebookServer } from '../../../client/datascience/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { IConfigurationService, IWatchableJupyterSettings } from '../../../platform/common/types'; +import { DisplayOptions } from '../../../platform/datascience/displayOptions'; +import { IJupyterExecution, INotebookServer } from '../../../platform/datascience/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { NotebookServerProvider } from '../../../kernels/jupyter/launcher/notebookServerProvider'; import { JupyterServerUriStorage } from '../../../kernels/jupyter/launcher/serverUriStorage'; import { JupyterServerSelector } from '../../../kernels/jupyter/serverSelector'; diff --git a/src/test/datascience/interactiveDebugging.vscode.test.ts b/src/test/datascience/interactiveDebugging.vscode.test.ts index 5a0328605e6..6bdab0f6657 100644 --- a/src/test/datascience/interactiveDebugging.vscode.test.ts +++ b/src/test/datascience/interactiveDebugging.vscode.test.ts @@ -6,12 +6,12 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import * as vscode from 'vscode'; -import { traceInfo } from '../../client/common/logger'; -import { IDisposable } from '../../client/common/types'; -import { Commands } from '../../client/datascience/constants'; +import { traceInfo } from '../../platform/common/logger'; +import { IDisposable } from '../../platform/common/types'; +import { Commands } from '../../platform/datascience/constants'; import { InteractiveWindowProvider } from '../../interactive-window/interactiveWindowProvider'; -import { IDataScienceCodeLensProvider, IInteractiveWindowProvider } from '../../client/datascience/types'; -import { IVariableViewProvider } from '../../client/datascience/variablesView/types'; +import { IDataScienceCodeLensProvider, IInteractiveWindowProvider } from '../../platform/datascience/types'; +import { IVariableViewProvider } from '../../platform/datascience/variablesView/types'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../common'; import { initialize, IS_REMOTE_NATIVE_TEST } from '../initialize'; import { diff --git a/src/test/datascience/interactiveWindow.functional.test.tsx b/src/test/datascience/interactiveWindow.functional.test.tsx index 3d02f7a1203..098576a5fb0 100644 --- a/src/test/datascience/interactiveWindow.functional.test.tsx +++ b/src/test/datascience/interactiveWindow.functional.test.tsx @@ -22,20 +22,20 @@ suite('Dummy6', () => { // import type * as nbformat from '@jupyterlab/nbformat'; // import { ReactWrapper } from 'enzyme'; // import { anything, when } from 'ts-mockito'; -// import { IApplicationShell, IDocumentManager } from '../../client/common/application/types'; -// import { IFileSystem } from '../../client/common/platform/types'; -// import { GLOBAL_MEMENTO, IJupyterSettings, IMemento } from '../../client/common/types'; -// import { createDeferred, sleep, waitForPromise } from '../../client/common/utils/async'; -// import { noop } from '../../client/common/utils/misc'; -// import { EXTENSION_ROOT_DIR } from '../../client/constants'; -// import { generateCellsFromDocument } from '../../client/datascience/cellFactory'; -// import { AllowedCellOutputKeys } from '../../client/datascience/common'; -// import { EditorContexts } from '../../client/datascience/constants'; -// import { InteractiveWindowMessages } from '../../client/datascience/interactive-common/interactiveWindowTypes'; -// import { InteractiveWindow } from '../../client/datascience/interactive-window/interactiveWindow'; -// import { AskedForPerFileSettingKey } from '../../client/datascience/interactive-window/interactiveWindowProvider'; -// import { IInteractiveWindowProvider, IWebviewExtensibility } from '../../client/datascience/types'; -// import { IInterpreterService } from '../../client/interpreter/contracts'; +// import { IApplicationShell, IDocumentManager } from '../../platform/common/application/types'; +// import { IFileSystem } from '../../platform/common/platform/types'; +// import { GLOBAL_MEMENTO, IJupyterSettings, IMemento } from '../../platform/common/types'; +// import { createDeferred, sleep, waitForPromise } from '../../platform/common/utils/async'; +// import { noop } from '../../platform/common/utils/misc'; +// import { EXTENSION_ROOT_DIR } from '../../platform/constants'; +// import { generateCellsFromDocument } from '../../platform/datascience/cellFactory'; +// import { AllowedCellOutputKeys } from '../../platform/datascience/common'; +// import { EditorContexts } from '../../platform/datascience/constants'; +// import { InteractiveWindowMessages } from '../../platform/datascience/interactive-common/interactiveWindowTypes'; +// import { InteractiveWindow } from '../../platform/datascience/interactive-window/interactiveWindow'; +// import { AskedForPerFileSettingKey } from '../../platform/datascience/interactive-window/interactiveWindowProvider'; +// import { IInteractiveWindowProvider, IWebviewExtensibility } from '../../platform/datascience/types'; +// import { IInterpreterService } from '../../platform/interpreter/contracts'; // import { concatMultilineString } from '../../datascience-ui/common'; // import { InteractivePanel } from '../../datascience-ui/history-react/interactivePanel'; // import { IKeyboardEvent } from '../../datascience-ui/react-common/event'; @@ -76,8 +76,8 @@ suite('Dummy6', () => { // verifyLastCellInputState // } from './testHelpers'; // import { ITestInteractiveWindowProvider } from './testInteractiveWindowProvider'; -// import { InteractiveWindowMessageListener } from '../../client/datascience/interactive-common/interactiveWindowMessageListener'; -// import { IExportDialog } from '../../client/datascience/export/types'; +// import { InteractiveWindowMessageListener } from '../../platform/datascience/interactive-common/interactiveWindowMessageListener'; +// import { IExportDialog } from '../../platform/datascience/export/types'; // // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires // const _escape = require('lodash/escape') as typeof import('lodash/escape'); // NOSONAR diff --git a/src/test/datascience/interactiveWindow.vscode.test.ts b/src/test/datascience/interactiveWindow.vscode.test.ts index 5b766dbca58..166d72b2eb2 100644 --- a/src/test/datascience/interactiveWindow.vscode.test.ts +++ b/src/test/datascience/interactiveWindow.vscode.test.ts @@ -6,13 +6,13 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import * as vscode from 'vscode'; -import { IPythonApiProvider } from '../../client/api/types'; -import { traceInfo, traceInfoIfCI } from '../../client/common/logger'; -import { getDisplayPath } from '../../client/common/platform/fs-paths'; -import { IDisposable } from '../../client/common/types'; +import { IPythonApiProvider } from '../../platform/api/types'; +import { traceInfo, traceInfoIfCI } from '../../platform/common/logger'; +import { getDisplayPath } from '../../platform/common/platform/fs-paths'; +import { IDisposable } from '../../platform/common/types'; import { InteractiveWindowProvider } from '../../interactive-window/interactiveWindowProvider'; -import { IKernelProvider } from '../../client/../kernels/types'; -import { IDataScienceCodeLensProvider, IInteractiveWindowProvider } from '../../client/datascience/types'; +import { IKernelProvider } from '../../platform/../kernels/types'; +import { IDataScienceCodeLensProvider, IInteractiveWindowProvider } from '../../platform/datascience/types'; import { captureScreenShot, createEventHandler, IExtensionTestApi, sleep, waitForCondition } from '../common'; import { initialize, IPYTHON_VERSION_CODE, IS_REMOTE_NATIVE_TEST } from '../initialize'; import { diff --git a/src/test/datascience/interactiveWindowCommandListener.unit.test.ts b/src/test/datascience/interactiveWindowCommandListener.unit.test.ts index 0389552bce1..4467c253b21 100644 --- a/src/test/datascience/interactiveWindowCommandListener.unit.test.ts +++ b/src/test/datascience/interactiveWindowCommandListener.unit.test.ts @@ -9,30 +9,30 @@ export const __ = ''; // import * as TypeMoq from 'typemoq'; // import * as uuid from 'uuid/v4'; // import { EventEmitter, Uri } from 'vscode'; -// import { ApplicationShell } from '../../client/common/application/applicationShell'; -// import { IApplicationShell } from '../../client/common/application/types'; -// import { ConfigurationService } from '../../client/common/configuration/service'; -// import { FileSystem } from '../../client/common/platform/fileSystem'; -// import { IFileSystem } from '../../client/common/platform/types'; -// import { IConfigurationService, IDisposable } from '../../client/common/types'; -// import * as localize from '../../client/common/utils/localize'; -// import { generateCells } from '../../client/datascience/cellFactory'; -// import { Commands } from '../../client/datascience/constants'; -// import { DataScienceErrorHandler } from '../../client/datascience/errorHandler/errorHandler'; -// import { ExportDialog } from '../../client/datascience/export/exportDialog'; -// import { ExportFormat, IExportDialog, IExportManager } from '../../client/datascience/export/types'; -// import { NotebookProvider } from '../../client/datascience/interactive-common/notebookProvider'; -// import { JupyterExporter } from '../../client/datascience/jupyter/jupyterExporter'; -// import { HostJupyterExecution } from '../../client/datascience/jupyter/liveshare/hostJupyterExecution'; +// import { ApplicationShell } from '../../platform/common/application/applicationShell'; +// import { IApplicationShell } from '../../platform/common/application/types'; +// import { ConfigurationService } from '../../platform/common/configuration/service'; +// import { FileSystem } from '../../platform/common/platform/fileSystem'; +// import { IFileSystem } from '../../platform/common/platform/types'; +// import { IConfigurationService, IDisposable } from '../../platform/common/types'; +// import * as localize from '../../platform/common/utils/localize'; +// import { generateCells } from '../../platform/datascience/cellFactory'; +// import { Commands } from '../../platform/datascience/constants'; +// import { DataScienceErrorHandler } from '../../platform/datascience/errorHandler/errorHandler'; +// import { ExportDialog } from '../../platform/datascience/export/exportDialog'; +// import { ExportFormat, IExportDialog, IExportManager } from '../../platform/datascience/export/types'; +// import { NotebookProvider } from '../../platform/datascience/interactive-common/notebookProvider'; +// import { JupyterExporter } from '../../platform/datascience/jupyter/jupyterExporter'; +// import { HostJupyterExecution } from '../../platform/datascience/jupyter/liveshare/hostJupyterExecution'; // import { // IInteractiveWindow, // IJupyterExecution, // INotebook, // INotebookEditorProvider, // INotebookServer -// } from '../../client/datascience/types'; -// import { IInterpreterService } from '../../client/interpreter/contracts'; -// import { ServiceContainer } from '../../client/ioc/container'; +// } from '../../platform/datascience/types'; +// import { IInterpreterService } from '../../platform/interpreter/contracts'; +// import { ServiceContainer } from '../../platform/ioc/container'; // import { MockCommandManager } from './mockCommandManager'; // import { MockDocumentManager } from './mockDocumentManager'; // import { MockJupyterSettings } from './mockJupyterSettings'; diff --git a/src/test/datascience/interactiveWindowRemote.vscode.test.ts b/src/test/datascience/interactiveWindowRemote.vscode.test.ts index 21dd1e011cc..86b6f16b0f7 100644 --- a/src/test/datascience/interactiveWindowRemote.vscode.test.ts +++ b/src/test/datascience/interactiveWindowRemote.vscode.test.ts @@ -5,8 +5,8 @@ import { assert } from 'chai'; import { workspace, Disposable } from 'vscode'; -import { traceInfo } from '../../client/common/logger'; -import { IInteractiveWindowProvider } from '../../client/datascience/types'; +import { traceInfo } from '../../platform/common/logger'; +import { IInteractiveWindowProvider } from '../../platform/datascience/types'; import { initialize, IS_REMOTE_NATIVE_TEST } from '../initialize'; import { submitFromPythonFile } from './helpers'; import { diff --git a/src/test/datascience/interactiveWindowTestHelpers.tsx b/src/test/datascience/interactiveWindowTestHelpers.tsx index a8bb5591a62..342b2dc35b2 100644 --- a/src/test/datascience/interactiveWindowTestHelpers.tsx +++ b/src/test/datascience/interactiveWindowTestHelpers.tsx @@ -7,16 +7,16 @@ export const __ = ''; // import * as React from 'react'; // import { CodeLens, Uri } from 'vscode'; -// import { ICommandManager, IDocumentManager } from '../../client/common/application/types'; -// import { Resource } from '../../client/common/types'; -// import { InteractiveWindow } from '../../client/datascience/interactive-window/interactiveWindow'; +// import { ICommandManager, IDocumentManager } from '../../platform/common/application/types'; +// import { Resource } from '../../platform/common/types'; +// import { InteractiveWindow } from '../../platform/datascience/interactive-window/interactiveWindow'; // import { // ICodeWatcher, // IDataScienceCodeLensProvider, // IInteractiveWindow, // IInteractiveWindowProvider, // IJupyterExecution -// } from '../../client/datascience/types'; +// } from '../../platform/datascience/types'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; // import { MockDocumentManager } from './mockDocumentManager'; // import { IMountedWebView } from './mountedWebView'; diff --git a/src/test/datascience/interpreters/environmentActivationService.vscode.test.ts b/src/test/datascience/interpreters/environmentActivationService.vscode.test.ts index 26de48201e3..81a008ce5d3 100644 --- a/src/test/datascience/interpreters/environmentActivationService.vscode.test.ts +++ b/src/test/datascience/interpreters/environmentActivationService.vscode.test.ts @@ -6,28 +6,28 @@ /* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { traceInfo } from '../../../client/common/logger'; +import { traceInfo } from '../../../platform/common/logger'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../../common'; import { initialize } from '../../initialize'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; import { EnvironmentActivationService, EnvironmentVariablesCacheInformation -} from '../../../client/common/process/environmentActivationService'; +} from '../../../platform/common/process/environmentActivationService'; import * as path from 'path'; -import { IS_WINDOWS } from '../../../client/common/platform/constants'; -import { IProcessServiceFactory } from '../../../client/common/process/types'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { GLOBAL_MEMENTO, IDisposable, IMemento } from '../../../client/common/types'; -import { createDeferred } from '../../../client/common/utils/async'; -import { IPythonApiProvider, PythonApi } from '../../../client/api/types'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { IFileSystem, IPlatformService } from '../../../client/common/platform/types'; -import { CondaService } from '../../../client/common/process/condaService'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { CurrentProcess } from '../../../client/common/process/currentProcess'; -import { IEnvironmentVariablesProvider } from '../../../client/common/variables/types'; +import { IS_WINDOWS } from '../../../platform/common/platform/constants'; +import { IProcessServiceFactory } from '../../../platform/common/process/types'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { GLOBAL_MEMENTO, IDisposable, IMemento } from '../../../platform/common/types'; +import { createDeferred } from '../../../platform/common/utils/async'; +import { IPythonApiProvider, PythonApi } from '../../../platform/api/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { IFileSystem, IPlatformService } from '../../../platform/common/platform/types'; +import { CondaService } from '../../../platform/common/process/condaService'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { CurrentProcess } from '../../../platform/common/process/currentProcess'; +import { IEnvironmentVariablesProvider } from '../../../platform/common/variables/types'; import { IS_CONDA_TEST, IS_REMOTE_NATIVE_TEST } from '../../constants'; import { Disposable, Memento } from 'vscode'; import { instance, mock, verify } from 'ts-mockito'; diff --git a/src/test/datascience/ipywidgets/cdnWidgetScriptSourceProvider.unit.test.ts b/src/test/datascience/ipywidgets/cdnWidgetScriptSourceProvider.unit.test.ts index 735d4a973aa..1b93f237dd8 100644 --- a/src/test/datascience/ipywidgets/cdnWidgetScriptSourceProvider.unit.test.ts +++ b/src/test/datascience/ipywidgets/cdnWidgetScriptSourceProvider.unit.test.ts @@ -8,14 +8,14 @@ import * as path from 'path'; import { Readable } from 'stream'; import { anything, instance, mock, when } from 'ts-mockito'; import { Uri } from 'vscode'; -import { JupyterSettings } from '../../../client/common/configSettings'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { FileSystem } from '../../../client/common/platform/fileSystem'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IConfigurationService, WidgetCDNs } from '../../../client/common/types'; -import { noop } from '../../../client/common/utils/misc'; -import { EXTENSION_ROOT_DIR } from '../../../client/constants'; -import { ILocalResourceUriConverter } from '../../../client/datascience/types'; +import { JupyterSettings } from '../../../platform/common/configSettings'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { FileSystem } from '../../../platform/common/platform/fileSystem'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IConfigurationService, WidgetCDNs } from '../../../platform/common/types'; +import { noop } from '../../../platform/common/utils/misc'; +import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; +import { ILocalResourceUriConverter } from '../../../platform/datascience/types'; import { CDNWidgetScriptSourceProvider } from '../../../kernels/ipywidgets-message-coordination/cdnWidgetScriptSourceProvider'; import { IPyWidgetScriptSource } from '../../../kernels/ipywidgets-message-coordination/ipyWidgetScriptSource'; import { IWidgetScriptSourceProvider } from '../../../kernels/ipywidgets-message-coordination/types'; diff --git a/src/test/datascience/ipywidgets/ipyWidgetScriptSourceProvider.unit.test.ts b/src/test/datascience/ipywidgets/ipyWidgetScriptSourceProvider.unit.test.ts index 9ca0a37f7ec..a86a996df41 100644 --- a/src/test/datascience/ipywidgets/ipyWidgetScriptSourceProvider.unit.test.ts +++ b/src/test/datascience/ipywidgets/ipyWidgetScriptSourceProvider.unit.test.ts @@ -4,19 +4,19 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { anything, deepEqual, instance, mock, verify, when } from 'ts-mockito'; import { ConfigurationChangeEvent, ConfigurationTarget, EventEmitter } from 'vscode'; -import { ApplicationShell } from '../../../client/common/application/applicationShell'; -import { IApplicationShell, IWorkspaceService } from '../../../client/common/application/types'; -import { WorkspaceService } from '../../../client/common/application/workspace'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { HttpClient } from '../../../client/common/net/httpClient'; -import { PersistentState, PersistentStateFactory } from '../../../client/common/persistentState'; -import { FileSystem } from '../../../client/common/platform/fileSystem'; -import { IPythonExecutionFactory } from '../../../client/common/process/types'; -import { IConfigurationService, IJupyterSettings } from '../../../client/common/types'; -import { Common, DataScience } from '../../../client/common/utils/localize'; -import { IKernel, RemoteKernelSpecConnectionMetadata } from '../../../client/../kernels/types'; -import { ILocalResourceUriConverter } from '../../../client/datascience/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; +import { ApplicationShell } from '../../../platform/common/application/applicationShell'; +import { IApplicationShell, IWorkspaceService } from '../../../platform/common/application/types'; +import { WorkspaceService } from '../../../platform/common/application/workspace'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { HttpClient } from '../../../platform/common/net/httpClient'; +import { PersistentState, PersistentStateFactory } from '../../../platform/common/persistentState'; +import { FileSystem } from '../../../platform/common/platform/fileSystem'; +import { IPythonExecutionFactory } from '../../../platform/common/process/types'; +import { IConfigurationService, IJupyterSettings } from '../../../platform/common/types'; +import { Common, DataScience } from '../../../platform/common/utils/localize'; +import { IKernel, RemoteKernelSpecConnectionMetadata } from '../../../platform/../kernels/types'; +import { ILocalResourceUriConverter } from '../../../platform/datascience/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; import { CDNWidgetScriptSourceProvider } from '../../../kernels/ipywidgets-message-coordination/cdnWidgetScriptSourceProvider'; import { IPyWidgetScriptSourceProvider } from '../../../kernels/ipywidgets-message-coordination/ipyWidgetScriptSourceProvider'; import { LocalWidgetScriptSourceProvider } from '../../../kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider'; diff --git a/src/test/datascience/ipywidgets/localWidgetScriptSourceProvider.unit.test.ts b/src/test/datascience/ipywidgets/localWidgetScriptSourceProvider.unit.test.ts index a80aac9ab2a..01812a16499 100644 --- a/src/test/datascience/ipywidgets/localWidgetScriptSourceProvider.unit.test.ts +++ b/src/test/datascience/ipywidgets/localWidgetScriptSourceProvider.unit.test.ts @@ -4,13 +4,13 @@ import { assert } from 'chai'; import * as path from 'path'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import { Uri } from 'vscode'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { FileSystem } from '../../../client/common/platform/fileSystem'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { IPythonExecutionFactory } from '../../../client/common/process/types'; -import { IKernel } from '../../../client/../kernels/types'; -import { ILocalResourceUriConverter } from '../../../client/datascience/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { FileSystem } from '../../../platform/common/platform/fileSystem'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { IPythonExecutionFactory } from '../../../platform/common/process/types'; +import { IKernel } from '../../../platform/../kernels/types'; +import { ILocalResourceUriConverter } from '../../../platform/datascience/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; import { LocalWidgetScriptSourceProvider } from '../../../kernels/ipywidgets-message-coordination/localWidgetScriptSourceProvider'; import { IWidgetScriptSourceProvider } from '../../../kernels/ipywidgets-message-coordination/types'; diff --git a/src/test/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.unit.test.ts b/src/test/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.unit.test.ts index 3dc82c19996..e96cd6ef1d7 100644 --- a/src/test/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.unit.test.ts +++ b/src/test/datascience/jupyter/interpreter/jupyterInterpreterDependencyService.unit.test.ts @@ -5,11 +5,11 @@ import { assert } from 'chai'; import { anything, deepEqual, instance, mock, verify, when } from 'ts-mockito'; -import { ApplicationShell } from '../../../../client/common/application/applicationShell'; -import { IApplicationShell } from '../../../../client/common/application/types'; -import { DataScience } from '../../../../client/common/utils/localize'; -import { IJupyterCommand, IJupyterCommandFactory } from '../../../../client/datascience/types'; -import { PythonEnvironment } from '../../../../client/pythonEnvironments/info'; +import { ApplicationShell } from '../../../../platform/common/application/applicationShell'; +import { IApplicationShell } from '../../../../platform/common/application/types'; +import { DataScience } from '../../../../platform/common/utils/localize'; +import { IJupyterCommand, IJupyterCommandFactory } from '../../../../platform/datascience/types'; +import { PythonEnvironment } from '../../../../platform/pythonEnvironments/info'; import { ProductInstaller } from '../../../../kernels/installer/productInstaller'; import { IInstaller, Product, InstallerResponse } from '../../../../kernels/installer/types'; import { diff --git a/src/test/datascience/jupyter/interpreter/jupyterInterpreterSelectionCommand.unit.test.ts b/src/test/datascience/jupyter/interpreter/jupyterInterpreterSelectionCommand.unit.test.ts index 0fe2267e650..7b72567bafb 100644 --- a/src/test/datascience/jupyter/interpreter/jupyterInterpreterSelectionCommand.unit.test.ts +++ b/src/test/datascience/jupyter/interpreter/jupyterInterpreterSelectionCommand.unit.test.ts @@ -6,10 +6,10 @@ import { assert } from 'chai'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import { Disposable } from 'vscode'; -import { IExtensionSingleActivationService } from '../../../../client/activation/types'; -import { CommandManager } from '../../../../client/common/application/commandManager'; -import { ICommandManager } from '../../../../client/common/application/types'; -import { IDisposableRegistry } from '../../../../client/common/types'; +import { IExtensionSingleActivationService } from '../../../../platform/activation/types'; +import { CommandManager } from '../../../../platform/common/application/commandManager'; +import { ICommandManager } from '../../../../platform/common/application/types'; +import { IDisposableRegistry } from '../../../../platform/common/types'; import { JupyterInterpreterSelectionCommand } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterSelectionCommand'; import { JupyterInterpreterService } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterService'; diff --git a/src/test/datascience/jupyter/interpreter/jupyterInterpreterSelector.unit.test.ts b/src/test/datascience/jupyter/interpreter/jupyterInterpreterSelector.unit.test.ts index 049555cf40c..1f3610c2910 100644 --- a/src/test/datascience/jupyter/interpreter/jupyterInterpreterSelector.unit.test.ts +++ b/src/test/datascience/jupyter/interpreter/jupyterInterpreterSelector.unit.test.ts @@ -5,12 +5,12 @@ import { assert } from 'chai'; import { anything, capture, instance, mock, verify, when } from 'ts-mockito'; -import { ApplicationShell } from '../../../../client/common/application/applicationShell'; -import { IApplicationShell, IWorkspaceService } from '../../../../client/common/application/types'; -import { WorkspaceService } from '../../../../client/common/application/workspace'; -import { PathUtils } from '../../../../client/common/platform/pathUtils'; -import { IPathUtils } from '../../../../client/common/types'; -import { IInterpreterSelector } from '../../../../client/interpreter/configuration/types'; +import { ApplicationShell } from '../../../../platform/common/application/applicationShell'; +import { IApplicationShell, IWorkspaceService } from '../../../../platform/common/application/types'; +import { WorkspaceService } from '../../../../platform/common/application/workspace'; +import { PathUtils } from '../../../../platform/common/platform/pathUtils'; +import { IPathUtils } from '../../../../platform/common/types'; +import { IInterpreterSelector } from '../../../../platform/interpreter/configuration/types'; import { JupyterInterpreterSelector } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterSelector'; import { JupyterInterpreterStateStore } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterStateStore'; diff --git a/src/test/datascience/jupyter/interpreter/jupyterInterpreterService.unit.test.ts b/src/test/datascience/jupyter/interpreter/jupyterInterpreterService.unit.test.ts index db00e5723cb..a87dba32b51 100644 --- a/src/test/datascience/jupyter/interpreter/jupyterInterpreterService.unit.test.ts +++ b/src/test/datascience/jupyter/interpreter/jupyterInterpreterService.unit.test.ts @@ -6,8 +6,8 @@ import { assert } from 'chai'; import { anyString, anything, instance, mock, verify, when } from 'ts-mockito'; import { Memento } from 'vscode'; -import { IInterpreterService } from '../../../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../../../client/pythonEnvironments/info'; +import { IInterpreterService } from '../../../../platform/interpreter/contracts'; +import { PythonEnvironment } from '../../../../platform/pythonEnvironments/info'; import { JupyterInterpreterDependencyService, JupyterInterpreterDependencyResponse diff --git a/src/test/datascience/jupyter/interpreter/jupyterInterpreterStateStore.unit.test.ts b/src/test/datascience/jupyter/interpreter/jupyterInterpreterStateStore.unit.test.ts index cb2fa58a25e..fa9f618f88e 100644 --- a/src/test/datascience/jupyter/interpreter/jupyterInterpreterStateStore.unit.test.ts +++ b/src/test/datascience/jupyter/interpreter/jupyterInterpreterStateStore.unit.test.ts @@ -6,7 +6,7 @@ import { assert } from 'chai'; import { anything, instance, mock, when } from 'ts-mockito'; import { EventEmitter, Memento } from 'vscode'; -import { PythonEnvironment } from '../../../../client/pythonEnvironments/info'; +import { PythonEnvironment } from '../../../../platform/pythonEnvironments/info'; import { JupyterInterpreterService } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterService'; import { JupyterInterpreterStateStore } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterStateStore'; import { MockMemento } from '../../../mocks/mementos'; diff --git a/src/test/datascience/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.unit.test.ts b/src/test/datascience/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.unit.test.ts index 99376c0b14f..f713db1b044 100644 --- a/src/test/datascience/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.unit.test.ts +++ b/src/test/datascience/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService.unit.test.ts @@ -10,24 +10,24 @@ import * as fsExtra from 'fs-extra'; import * as sinon from 'sinon'; import { Subject } from 'rxjs/Subject'; import { anything, capture, deepEqual, instance, mock, when } from 'ts-mockito'; -import { PathUtils } from '../../../../client/common/platform/pathUtils'; -import { PythonExecutionFactory } from '../../../../client/common/process/pythonExecutionFactory'; +import { PathUtils } from '../../../../platform/common/platform/pathUtils'; +import { PythonExecutionFactory } from '../../../../platform/common/process/pythonExecutionFactory'; import { IPythonDaemonExecutionService, ObservableExecutionResult, Output -} from '../../../../client/common/process/types'; -import { DataScience } from '../../../../client/common/utils/localize'; -import { noop } from '../../../../client/common/utils/misc'; -import { EXTENSION_ROOT_DIR } from '../../../../client/constants'; -import { JupyterDaemonModule } from '../../../../client/datascience/constants'; -import { IInterpreterService } from '../../../../client/interpreter/contracts'; +} from '../../../../platform/common/process/types'; +import { DataScience } from '../../../../platform/common/utils/localize'; +import { noop } from '../../../../platform/common/utils/misc'; +import { EXTENSION_ROOT_DIR } from '../../../../platform/constants'; +import { JupyterDaemonModule } from '../../../../platform/datascience/constants'; +import { IInterpreterService } from '../../../../platform/interpreter/contracts'; import { MockOutputChannel } from '../../../mockClasses'; import { createPythonInterpreter } from '../../../utils/interpreters'; import { ProductNames } from '../../../../kernels/installer/productNames'; import { Product } from '../../../../kernels/installer/types'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../../constants'; -import { IEnvironmentActivationService } from '../../../../client/interpreter/activation/types'; +import { IEnvironmentActivationService } from '../../../../platform/interpreter/activation/types'; import { JupyterInterpreterDependencyService } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterDependencyService'; import { JupyterInterpreterService } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterService'; import { JupyterInterpreterSubCommandExecutionService } from '../../../../kernels/jupyter/interpreter/jupyterInterpreterSubCommandExecutionService'; diff --git a/src/test/datascience/jupyter/jupyterCellOutputMimeTypeTracker.unit.test.ts b/src/test/datascience/jupyter/jupyterCellOutputMimeTypeTracker.unit.test.ts index 284593ea842..33bd86c0b37 100644 --- a/src/test/datascience/jupyter/jupyterCellOutputMimeTypeTracker.unit.test.ts +++ b/src/test/datascience/jupyter/jupyterCellOutputMimeTypeTracker.unit.test.ts @@ -9,14 +9,14 @@ export const __ = ''; // import { instance, mock, when } from 'ts-mockito'; // import { EventEmitter, NotebookDocument, Uri } from 'vscode'; // import { getNamesAndValues } from '../../utils/enum'; -// import { Telemetry } from '../../../client/datascience/constants'; -// import { CellOutputMimeTypeTracker } from '../../../client/datascience/jupyter/jupyterCellOutputMimeTypeTracker'; +// import { Telemetry } from '../../../platform/datascience/constants'; +// import { CellOutputMimeTypeTracker } from '../../../platform/datascience/jupyter/jupyterCellOutputMimeTypeTracker'; // import { NativeEditorNotebookModel } from '../../../notebooksStorage/notebookModel'; -// import { CellState, ICell, INotebookEditor } from '../../../client/datascience/types'; -// import { getTelemetrySafeHashedString } from '../../../client/telemetry/helpers'; -// import { IVSCodeNotebook } from '../../../client/common/application/types'; -// import { IDisposable } from '../../../client/common/types'; -// import { disposeAllDisposables } from '../../../client/common/helpers'; +// import { CellState, ICell, INotebookEditor } from '../../../platform/datascience/types'; +// import { getTelemetrySafeHashedString } from '../../../telemetry/helpers'; +// import { IVSCodeNotebook } from '../../../platform/common/application/types'; +// import { IDisposable } from '../../../platform/common/types'; +// import { disposeAllDisposables } from '../../../platform/common/helpers'; // suite('DataScience - Cell Output Mimetype Tracker', () => { // const oldValueOfVSC_JUPYTER_UNIT_TEST = process.env.VSC_JUPYTER_UNIT_TEST; diff --git a/src/test/datascience/jupyter/jupyterConnection.unit.test.ts b/src/test/datascience/jupyter/jupyterConnection.unit.test.ts index 6ba8d1b0801..3e5ee436d6a 100644 --- a/src/test/datascience/jupyter/jupyterConnection.unit.test.ts +++ b/src/test/datascience/jupyter/jupyterConnection.unit.test.ts @@ -6,17 +6,17 @@ import { Subject } from 'rxjs/Subject'; import * as sinon from 'sinon'; import { anything, instance, mock, when } from 'ts-mockito'; import { CancellationToken } from 'vscode'; -import { JupyterSettings } from '../../../client/common/configSettings'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { FileSystem } from '../../../client/common/platform/fileSystem'; -import { IFileSystem } from '../../../client/common/platform/types'; -import { ObservableExecutionResult, Output } from '../../../client/common/process/types'; -import { IConfigurationService, IJupyterSettings } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { noop } from '../../../client/common/utils/misc'; -import { EXTENSION_ROOT_DIR } from '../../../client/constants'; -import { ServiceContainer } from '../../../client/ioc/container'; -import { IServiceContainer } from '../../../client/ioc/types'; +import { JupyterSettings } from '../../../platform/common/configSettings'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { FileSystem } from '../../../platform/common/platform/fileSystem'; +import { IFileSystem } from '../../../platform/common/platform/types'; +import { ObservableExecutionResult, Output } from '../../../platform/common/process/types'; +import { IConfigurationService, IJupyterSettings } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { noop } from '../../../platform/common/utils/misc'; +import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; +import { ServiceContainer } from '../../../platform/ioc/container'; +import { IServiceContainer } from '../../../platform/ioc/types'; import { JupyterServerInfo, JupyterConnectionWaiter } from '../../../kernels/jupyter/launcher/jupyterConnection'; /* eslint-disable , @typescript-eslint/no-explicit-any */ diff --git a/src/test/datascience/jupyter/jupyterSession.unit.test.ts b/src/test/datascience/jupyter/jupyterSession.unit.test.ts index 63db0d95c3d..e21bfcdd9f0 100644 --- a/src/test/datascience/jupyter/jupyterSession.unit.test.ts +++ b/src/test/datascience/jupyter/jupyterSession.unit.test.ts @@ -17,14 +17,14 @@ import { assert } from 'chai'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import { CancellationTokenSource, Uri } from 'vscode'; -import { traceInfo } from '../../../client/common/logger'; -import { ReadWrite, Resource } from '../../../client/common/types'; -import { createDeferred, Deferred } from '../../../client/common/utils/async'; -import { DataScience } from '../../../client/common/utils/localize'; -import { noop } from '../../../client/common/utils/misc'; -import { DisplayOptions } from '../../../client/datascience/displayOptions'; -import { KernelConnectionMetadata, LiveKernelModel } from '../../../client/../kernels/types'; -import { IJupyterConnection, ISessionWithSocket } from '../../../client/datascience/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { ReadWrite, Resource } from '../../../platform/common/types'; +import { createDeferred, Deferred } from '../../../platform/common/utils/async'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { noop } from '../../../platform/common/utils/misc'; +import { DisplayOptions } from '../../../platform/datascience/displayOptions'; +import { KernelConnectionMetadata, LiveKernelModel } from '../../../platform/../kernels/types'; +import { IJupyterConnection, ISessionWithSocket } from '../../../platform/datascience/types'; import { MockOutputChannel } from '../../mockClasses'; import { JupyterKernelService } from '../../../kernels/jupyter/jupyterKernelService'; import { JupyterSession } from '../../../kernels/jupyter/session/jupyterSession'; diff --git a/src/test/datascience/jupyter/kernels/installationPrompts.vscode.test.ts b/src/test/datascience/jupyter/kernels/installationPrompts.vscode.test.ts index 731690bbebd..f3b5f34a59a 100644 --- a/src/test/datascience/jupyter/kernels/installationPrompts.vscode.test.ts +++ b/src/test/datascience/jupyter/kernels/installationPrompts.vscode.test.ts @@ -6,12 +6,12 @@ import * as fs from 'fs-extra'; import * as path from 'path'; import * as sinon from 'sinon'; import { commands, Memento, workspace, window, Uri, NotebookCell } from 'vscode'; -import { IPythonApiProvider } from '../../../../client/api/types'; -import { ICommandManager, IVSCodeNotebook } from '../../../../client/common/application/types'; -import { Kernel } from '../../../../client/../kernels/kernel'; -import { getDisplayPath } from '../../../../client/common/platform/fs-paths'; -import { BufferDecoder } from '../../../../client/common/process/decoder'; -import { ProcessService } from '../../../../client/common/process/proc'; +import { IPythonApiProvider } from '../../../../platform/api/types'; +import { ICommandManager, IVSCodeNotebook } from '../../../../platform/common/application/types'; +import { Kernel } from '../../../../platform/../kernels/kernel'; +import { getDisplayPath } from '../../../../platform/common/platform/fs-paths'; +import { BufferDecoder } from '../../../../platform/common/process/decoder'; +import { ProcessService } from '../../../../platform/common/process/proc'; import { GLOBAL_MEMENTO, IConfigurationService, @@ -19,22 +19,22 @@ import { IMemento, IWatchableJupyterSettings, ReadWrite -} from '../../../../client/common/types'; -import { createDeferred } from '../../../../client/common/utils/async'; -import { Common, DataScience } from '../../../../client/common/utils/localize'; +} from '../../../../platform/common/types'; +import { createDeferred } from '../../../../platform/common/utils/async'; +import { Common, DataScience } from '../../../../platform/common/utils/localize'; import { InteractiveWindowProvider } from '../../../../interactive-window/interactiveWindowProvider'; import { hasErrorOutput, translateCellErrorOutput } from '../../../../notebooks/helpers'; -import { IInteractiveWindowProvider } from '../../../../client/datascience/types'; -import { IInterpreterService } from '../../../../client/interpreter/contracts'; -import { areInterpreterPathsSame, getInterpreterHash } from '../../../../client/pythonEnvironments/info/interpreter'; +import { IInteractiveWindowProvider } from '../../../../platform/datascience/types'; +import { IInterpreterService } from '../../../../platform/interpreter/contracts'; +import { areInterpreterPathsSame, getInterpreterHash } from '../../../../platform/pythonEnvironments/info/interpreter'; import { captureScreenShot, getOSType, IExtensionTestApi, OSType, waitForCondition } from '../../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST, JVSC_EXTENSION_ID_FOR_TESTS } from '../../../constants'; import { closeActiveWindows, initialize } from '../../../initialize'; import { openNotebook, submitFromPythonFile } from '../../helpers'; import { JupyterNotebookView } from '../../../../notebooks/constants'; import { INotebookControllerManager } from '../../../../notebooks/types'; -import { BaseKernelError, WrappedError } from '../../../../client/../extension/errors/types'; -import { Commands } from '../../../../client/datascience/constants'; +import { BaseKernelError, WrappedError } from '../../../../platform/errors/types'; +import { Commands } from '../../../../platform/datascience/constants'; import { clearInstalledIntoInterpreterMemento } from '../../../../kernels/installer/productInstaller'; import { ProductNames } from '../../../../kernels/installer/productNames'; import { Product, IInstaller, InstallerResponse } from '../../../../kernels/installer/types'; diff --git a/src/test/datascience/jupyter/kernels/jupyterKernelService.unit.test.ts b/src/test/datascience/jupyter/kernels/jupyterKernelService.unit.test.ts index 0e626da82a8..db2205f16d8 100644 --- a/src/test/datascience/jupyter/kernels/jupyterKernelService.unit.test.ts +++ b/src/test/datascience/jupyter/kernels/jupyterKernelService.unit.test.ts @@ -5,20 +5,20 @@ import { assert } from 'chai'; import { anything, instance, mock, when, verify, capture } from 'ts-mockito'; -import { FileSystem } from '../../../../client/common/platform/fileSystem'; -import { IFileSystem } from '../../../../client/common/platform/types'; -import { KernelDependencyService } from '../../../../client/../kernels/kernelDependencyService'; -import { LocalKernelConnectionMetadata } from '../../../../client/../kernels/types'; -import { IEnvironmentActivationService } from '../../../../client/interpreter/activation/types'; -import { IKernelDependencyService } from '../../../../client/datascience/types'; -import { EnvironmentType } from '../../../../client/pythonEnvironments/info'; -import { EXTENSION_ROOT_DIR } from '../../../../client/constants'; +import { FileSystem } from '../../../../platform/common/platform/fileSystem'; +import { IFileSystem } from '../../../../platform/common/platform/types'; +import { KernelDependencyService } from '../../../../platform/../kernels/kernelDependencyService'; +import { LocalKernelConnectionMetadata } from '../../../../platform/../kernels/types'; +import { IEnvironmentActivationService } from '../../../../platform/interpreter/activation/types'; +import { IKernelDependencyService } from '../../../../platform/datascience/types'; +import { EnvironmentType } from '../../../../platform/pythonEnvironments/info'; +import { EXTENSION_ROOT_DIR } from '../../../../platform/constants'; import * as path from 'path'; import { getOSType, OSType } from '../../../common'; -import { DisplayOptions } from '../../../../client/datascience/displayOptions'; +import { DisplayOptions } from '../../../../platform/datascience/displayOptions'; import { CancellationTokenSource } from 'vscode'; -import { EnvironmentVariablesService } from '../../../../client/common/variables/environment'; -import { arePathsSame } from '../../../../client/common/platform/fileUtils'; +import { EnvironmentVariablesService } from '../../../../platform/common/variables/environment'; +import { arePathsSame } from '../../../../platform/common/platform/fileUtils'; import { JupyterKernelService } from '../../../../kernels/jupyter/jupyterKernelService'; import { JupyterPaths } from '../../../../kernels/raw/finder/jupyterPaths'; diff --git a/src/test/datascience/jupyter/kernels/kernelDependencyService.unit.test.ts b/src/test/datascience/jupyter/kernels/kernelDependencyService.unit.test.ts index a27466eb6a7..8afdbb33232 100644 --- a/src/test/datascience/jupyter/kernels/kernelDependencyService.unit.test.ts +++ b/src/test/datascience/jupyter/kernels/kernelDependencyService.unit.test.ts @@ -6,21 +6,21 @@ import { assert } from 'chai'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import { CancellationTokenSource, Memento, NotebookDocument, NotebookEditor, Uri } from 'vscode'; -import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../../../client/common/application/types'; -import { Common, DataScience } from '../../../../client/common/utils/localize'; -import { getResourceType } from '../../../../client/datascience/common'; -import { DisplayOptions } from '../../../../client/datascience/displayOptions'; -import { createInterpreterKernelSpec } from '../../../../client/../kernels/helpers'; -import { KernelDependencyService } from '../../../../client/../kernels/kernelDependencyService'; -import { IKernelProvider, PythonKernelConnectionMetadata } from '../../../../client/../kernels/types'; +import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../../../platform/common/application/types'; +import { Common, DataScience } from '../../../../platform/common/utils/localize'; +import { getResourceType } from '../../../../platform/datascience/common'; +import { DisplayOptions } from '../../../../platform/datascience/displayOptions'; +import { createInterpreterKernelSpec } from '../../../../platform/../kernels/helpers'; +import { KernelDependencyService } from '../../../../platform/../kernels/kernelDependencyService'; +import { IKernelProvider, PythonKernelConnectionMetadata } from '../../../../platform/../kernels/types'; import { IInteractiveWindow, IInteractiveWindowProvider, IRawNotebookSupportedService, KernelInterpreterDependencyResponse -} from '../../../../client/datascience/types'; -import { IServiceContainer } from '../../../../client/ioc/types'; -import { EnvironmentType } from '../../../../client/pythonEnvironments/info'; +} from '../../../../platform/datascience/types'; +import { IServiceContainer } from '../../../../platform/ioc/types'; +import { EnvironmentType } from '../../../../platform/pythonEnvironments/info'; import { IInstaller, Product, InstallerResponse } from '../../../../kernels/installer/types'; import { createPythonInterpreter } from '../../../utils/interpreters'; diff --git a/src/test/datascience/jupyter/serverSelector.unit.test.ts b/src/test/datascience/jupyter/serverSelector.unit.test.ts index 3812061f01d..d96f49cce9a 100644 --- a/src/test/datascience/jupyter/serverSelector.unit.test.ts +++ b/src/test/datascience/jupyter/serverSelector.unit.test.ts @@ -6,20 +6,20 @@ import { anyString, anything, instance, mock, when } from 'ts-mockito'; import * as sinon from 'sinon'; import * as os from 'os'; import { QuickPickItem } from 'vscode'; -import { ApplicationShell } from '../../../client/common/application/applicationShell'; -import { ClipboardService } from '../../../client/common/application/clipboard'; -import { IClipboard } from '../../../client/common/application/types'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { IJupyterSettings } from '../../../client/common/types'; -import { DataScience } from '../../../client/common/utils/localize'; -import { MultiStepInput, MultiStepInputFactory } from '../../../client/common/utils/multiStepInput'; -import { Settings } from '../../../client/datascience/constants'; +import { ApplicationShell } from '../../../platform/common/application/applicationShell'; +import { ClipboardService } from '../../../platform/common/application/clipboard'; +import { IClipboard } from '../../../platform/common/application/types'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { IJupyterSettings } from '../../../platform/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { MultiStepInput, MultiStepInputFactory } from '../../../platform/common/utils/multiStepInput'; +import { Settings } from '../../../platform/datascience/constants'; import { MockInputBox } from '../mockInputBox'; import { MockQuickPick } from '../mockQuickPick'; import { MockMemento } from '../../mocks/mementos'; -import { WorkspaceService } from '../../../client/common/application/workspace'; -import { CryptoUtils } from '../../../client/common/crypto'; -import { ApplicationEnvironment } from '../../../client/common/application/applicationEnvironment'; +import { WorkspaceService } from '../../../platform/common/application/workspace'; +import { CryptoUtils } from '../../../platform/common/crypto'; +import { ApplicationEnvironment } from '../../../platform/common/application/applicationEnvironment'; import { MockEncryptedStorage } from '../mockEncryptedStorage'; import { JupyterServerUriStorage } from '../../../kernels/jupyter/launcher/serverUriStorage'; import { JupyterServerSelector } from '../../../kernels/jupyter/serverSelector'; diff --git a/src/test/datascience/jupyterPasswordConnect.unit.test.ts b/src/test/datascience/jupyterPasswordConnect.unit.test.ts index 4539650e373..2134bc2d1c9 100644 --- a/src/test/datascience/jupyterPasswordConnect.unit.test.ts +++ b/src/test/datascience/jupyterPasswordConnect.unit.test.ts @@ -7,10 +7,10 @@ import * as nodeFetch from 'node-fetch'; import * as typemoq from 'typemoq'; import { anything, instance, mock, when } from 'ts-mockito'; -import { ApplicationShell } from '../../client/common/application/applicationShell'; -import { AsyncDisposableRegistry } from '../../client/common/asyncDisposableRegistry'; -import { ConfigurationService } from '../../client/common/configuration/service'; -import { MultiStepInputFactory } from '../../client/common/utils/multiStepInput'; +import { ApplicationShell } from '../../platform/common/application/applicationShell'; +import { AsyncDisposableRegistry } from '../../platform/common/asyncDisposableRegistry'; +import { ConfigurationService } from '../../platform/common/configuration/service'; +import { MultiStepInputFactory } from '../../platform/common/utils/multiStepInput'; import { MockInputBox } from './mockInputBox'; import { MockQuickPick } from './mockQuickPick'; import { JupyterPasswordConnect } from '../../kernels/jupyter/launcher/jupyterPasswordConnect'; diff --git a/src/test/datascience/jupyterServer.ts b/src/test/datascience/jupyterServer.ts index b832b350657..f43f695f485 100644 --- a/src/test/datascience/jupyterServer.ts +++ b/src/test/datascience/jupyterServer.ts @@ -5,11 +5,11 @@ import * as getFreePort from 'get-port'; import * as path from 'path'; import * as tcpPortUsed from 'tcp-port-used'; import { Uri } from 'vscode'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { traceError, traceInfo, traceInfoIfCI } from '../../client/common/logger'; -import { IPythonExecutionFactory } from '../../client/common/process/types'; -import { IAsyncDisposable, IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { traceError, traceInfo, traceInfoIfCI } from '../../platform/common/logger'; +import { IPythonExecutionFactory } from '../../platform/common/process/types'; +import { IAsyncDisposable, IDisposable, IDisposableRegistry } from '../../platform/common/types'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; import { PYTHON_PATH, sleep } from '../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../constants'; import { initialize } from '../initialize'; diff --git a/src/test/datascience/jupyterUriProviderRegistration.functional.test.ts b/src/test/datascience/jupyterUriProviderRegistration.functional.test.ts index cdf1f4719dd..76864b6c69e 100644 --- a/src/test/datascience/jupyterUriProviderRegistration.functional.test.ts +++ b/src/test/datascience/jupyterUriProviderRegistration.functional.test.ts @@ -10,15 +10,15 @@ suite('Dummy7', () => { // import * as assert from 'assert'; // import { Event, EventEmitter, Extension, ExtensionKind, QuickPickItem, Uri } from 'vscode'; -// import { IExtensions } from '../../client/common/types'; -// import { sleep } from '../../client/common/utils/async'; -// import { Identifiers } from '../../client/datascience/constants'; +// import { IExtensions } from '../../platform/common/types'; +// import { sleep } from '../../platform/common/utils/async'; +// import { Identifiers } from '../../platform/datascience/constants'; // import { // IJupyterExecution, // IJupyterServerUri, // IJupyterUriProvider, // IJupyterUriProviderRegistration -// } from '../../client/datascience/types'; +// } from '../../platform/datascience/types'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; // const TestUriProviderId = 'TestUriProvider_Id'; diff --git a/src/test/datascience/jupyterUriProviderRegistration.unit.test.ts b/src/test/datascience/jupyterUriProviderRegistration.unit.test.ts index 8758a2697df..85156ba4fa7 100644 --- a/src/test/datascience/jupyterUriProviderRegistration.unit.test.ts +++ b/src/test/datascience/jupyterUriProviderRegistration.unit.test.ts @@ -7,9 +7,9 @@ import * as sinon from 'sinon'; import { anything, instance, mock, when } from 'ts-mockito'; import * as TypeMoq from 'typemoq'; import * as vscode from 'vscode'; -import { Extensions } from '../../client/common/application/extensions'; -import { FileSystem } from '../../client/common/platform/fileSystem'; -import { IJupyterServerUri, IJupyterUriProvider, JupyterServerUriHandle } from '../../client/datascience/types'; +import { Extensions } from '../../platform/common/application/extensions'; +import { FileSystem } from '../../platform/common/platform/fileSystem'; +import { IJupyterServerUri, IJupyterUriProvider, JupyterServerUriHandle } from '../../platform/datascience/types'; import { JupyterUriProviderRegistration } from '../../kernels/jupyter/jupyterUriProviderRegistration'; class MockProvider implements IJupyterUriProvider { diff --git a/src/test/datascience/kernel-launcher/kernelFinder.vscode.test.ts b/src/test/datascience/kernel-launcher/kernelFinder.vscode.test.ts index bd96ef4b2a2..8fa05ff40ff 100644 --- a/src/test/datascience/kernel-launcher/kernelFinder.vscode.test.ts +++ b/src/test/datascience/kernel-launcher/kernelFinder.vscode.test.ts @@ -6,14 +6,14 @@ import * as path from 'path'; import { assert } from 'chai'; import { Uri, workspace } from 'vscode'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { getKernelConnectionLanguage } from '../../../client/../kernels/helpers'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { getKernelConnectionLanguage } from '../../../platform/../kernels/helpers'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; import { IExtensionTestApi } from '../../common'; import { initialize } from '../../initialize'; -import { traceInfo } from '../../../client/common/logger'; -import { areInterpreterPathsSame } from '../../../client/pythonEnvironments/info/interpreter'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; +import { traceInfo } from '../../../platform/common/logger'; +import { areInterpreterPathsSame } from '../../../platform/pythonEnvironments/info/interpreter'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; import { ILocalKernelFinder } from '../../../kernels/raw/types'; /* eslint-disable @typescript-eslint/no-explicit-any, no-invalid-this */ diff --git a/src/test/datascience/kernel-launcher/localKernelFinder.unit.test.ts b/src/test/datascience/kernel-launcher/localKernelFinder.unit.test.ts index 48b990500db..ba75a7a2af1 100644 --- a/src/test/datascience/kernel-launcher/localKernelFinder.unit.test.ts +++ b/src/test/datascience/kernel-launcher/localKernelFinder.unit.test.ts @@ -8,34 +8,34 @@ import * as path from 'path'; import * as fsExtra from 'fs-extra'; import * as sinon from 'sinon'; import { anything, instance, mock, when, verify } from 'ts-mockito'; -import { PathUtils } from '../../../client/common/platform/pathUtils'; -import { IFileSystem, IPlatformService } from '../../../client/common/platform/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { WorkspaceService } from '../../../client/common/application/workspace'; -import { EnvironmentVariablesProvider } from '../../../client/common/variables/environmentVariablesProvider'; -import { InterpreterService, PythonExtensionChecker } from '../../../client/api/pythonApi'; +import { PathUtils } from '../../../platform/common/platform/pathUtils'; +import { IFileSystem, IPlatformService } from '../../../platform/common/platform/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { WorkspaceService } from '../../../platform/common/application/workspace'; +import { EnvironmentVariablesProvider } from '../../../platform/common/variables/environmentVariablesProvider'; +import { InterpreterService, PythonExtensionChecker } from '../../../platform/api/pythonApi'; import { createInterpreterKernelSpec, getInterpreterKernelSpecName, getKernelId, getKernelRegistrationInfo -} from '../../../client/../kernels/helpers'; -import { PlatformService } from '../../../client/common/platform/platformService'; -import { EXTENSION_ROOT_DIR } from '../../../client/constants'; -import { FileSystem } from '../../../client/common/platform/fileSystem'; +} from '../../../platform/../kernels/helpers'; +import { PlatformService } from '../../../platform/common/platform/platformService'; +import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; +import { FileSystem } from '../../../platform/common/platform/fileSystem'; import type { KernelSpec } from '@jupyterlab/services'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; import { getOSType } from '../../common'; import { EventEmitter, Memento, Uri } from 'vscode'; -import { IDisposable, IExtensionContext } from '../../../client/common/types'; -import { getInterpreterHash } from '../../../client/pythonEnvironments/info/interpreter'; -import { OSType } from '../../../client/common/utils/platform'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { KernelConnectionMetadata, LocalKernelConnectionMetadata } from '../../../client/../kernels/types'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; -import { arePathsSame } from '../../../client/common/platform/fileUtils'; +import { IDisposable, IExtensionContext } from '../../../platform/common/types'; +import { getInterpreterHash } from '../../../platform/pythonEnvironments/info/interpreter'; +import { OSType } from '../../../platform/common/utils/platform'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { KernelConnectionMetadata, LocalKernelConnectionMetadata } from '../../../platform/../kernels/types'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; +import { arePathsSame } from '../../../platform/common/platform/fileUtils'; import { JupyterPaths } from '../../../kernels/raw/finder/jupyterPaths'; import { LocalKernelFinder } from '../../../kernels/raw/finder/localKernelFinder'; import { loadKernelSpec } from '../../../kernels/raw/finder/localKernelSpecFinderBase'; diff --git a/src/test/datascience/kernel-launcher/remoteKernelFinder.unit.test.ts b/src/test/datascience/kernel-launcher/remoteKernelFinder.unit.test.ts index d9f4a89433c..f3857c34bbf 100644 --- a/src/test/datascience/kernel-launcher/remoteKernelFinder.unit.test.ts +++ b/src/test/datascience/kernel-launcher/remoteKernelFinder.unit.test.ts @@ -6,20 +6,20 @@ import type { Kernel, Session } from '@jupyterlab/services'; import { assert } from 'chai'; import { anything, instance, mock, when } from 'ts-mockito'; -import { getDisplayNameOrNameOfKernelConnection } from '../../../client/../kernels/helpers'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; +import { getDisplayNameOrNameOfKernelConnection } from '../../../platform/../kernels/helpers'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; import { Disposable, EventEmitter, Uri } from 'vscode'; import { MockMemento } from '../../mocks/mementos'; -import { CryptoUtils } from '../../../client/common/crypto'; +import { CryptoUtils } from '../../../platform/common/crypto'; import { IJupyterConnection, IJupyterKernel, IJupyterKernelSpec, IJupyterSessionManager -} from '../../../client/datascience/types'; +} from '../../../platform/datascience/types'; import { noop } from '../../core'; import { LiveKernelConnectionMetadata } from '../../../kernels/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; import { JupyterSessionManager } from '../../../kernels/jupyter/session/jupyterSessionManager'; import { JupyterSessionManagerFactory } from '../../../kernels/jupyter/session/jupyterSessionManagerFactory'; import { RemoteKernelFinder } from '../../../kernels/raw/finder/remoteKernelFinder'; diff --git a/src/test/datascience/kernelLauncher.vscode.test.ts b/src/test/datascience/kernelLauncher.vscode.test.ts index 18384dbaedb..474ac46433a 100644 --- a/src/test/datascience/kernelLauncher.vscode.test.ts +++ b/src/test/datascience/kernelLauncher.vscode.test.ts @@ -6,19 +6,19 @@ import { assert, use } from 'chai'; import { KernelMessage } from '@jupyterlab/services'; import * as uuid from 'uuid/v4'; -import { createDeferred } from '../../client/common/utils/async'; -import { IJupyterKernelSpec } from '../../client/datascience/types'; +import { createDeferred } from '../../platform/common/utils/async'; +import { IJupyterKernelSpec } from '../../platform/datascience/types'; import { createEventHandler, PYTHON_PATH, sleep, waitForCondition } from '../common'; import { requestExecute } from './raw-kernel/rawKernelTestHelpers'; // Chai as promised is not part of this file import * as chaiAsPromised from 'chai-as-promised'; -import { traceInfo } from '../../client/common/logger'; +import { traceInfo } from '../../platform/common/logger'; import { IS_REMOTE_NATIVE_TEST } from '../constants'; import { initialize } from '../initialize'; -import { PortAttributesProviders } from '../../client/common/net/portAttributeProvider'; -import { IDisposable } from '../../client/common/types'; -import { disposeAllDisposables } from '../../client/common/helpers'; +import { PortAttributesProviders } from '../../platform/common/net/portAttributeProvider'; +import { IDisposable } from '../../platform/common/types'; +import { disposeAllDisposables } from '../../platform/common/helpers'; import { CancellationTokenSource, PortAutoForwardAction } from 'vscode'; import { createRawKernel } from '../../kernels/raw/session/rawKernel'; import { IKernelConnection, IKernelLauncher } from '../../kernels/raw/types'; diff --git a/src/test/datascience/kernelProcess.unit.test.ts b/src/test/datascience/kernelProcess.unit.test.ts index ec712be9e14..b4e306ff8a3 100644 --- a/src/test/datascience/kernelProcess.unit.test.ts +++ b/src/test/datascience/kernelProcess.unit.test.ts @@ -14,16 +14,16 @@ import { IPythonExecutionFactory, IPythonExecutionService, Output -} from '../../client/common/process/types'; +} from '../../platform/common/process/types'; import { IKernelConnection } from '../../kernels/raw/types'; import { LocalKernelSpecConnectionMetadata, PythonKernelConnectionMetadata } from '../../kernels/types'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IPythonExtensionChecker } from '../../client/api/types'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IPythonExtensionChecker } from '../../platform/api/types'; import { KernelEnvironmentVariablesService } from '../../kernels/raw/launcher/kernelEnvVarsService'; -import { IDisposable, IJupyterSettings, IOutputChannel } from '../../client/common/types'; -import { IJupyterKernelSpec } from '../../client/datascience/types'; +import { IDisposable, IJupyterSettings, IOutputChannel } from '../../platform/common/types'; +import { IJupyterKernelSpec } from '../../platform/datascience/types'; import { CancellationTokenSource } from 'vscode'; -import { disposeAllDisposables } from '../../client/common/helpers'; +import { disposeAllDisposables } from '../../platform/common/helpers'; import { noop } from '../core'; import { Observable, Subject } from 'rxjs'; import { ChildProcess } from 'child_process'; diff --git a/src/test/datascience/kernelProcess.vscode.test.ts b/src/test/datascience/kernelProcess.vscode.test.ts index 912626dedbc..70d68518424 100644 --- a/src/test/datascience/kernelProcess.vscode.test.ts +++ b/src/test/datascience/kernelProcess.vscode.test.ts @@ -6,22 +6,22 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { IS_REMOTE_NATIVE_TEST } from '../constants'; -import { IDisposable, IJupyterSettings } from '../../client/common/types'; +import { IDisposable, IJupyterSettings } from '../../platform/common/types'; import rewiremock from 'rewiremock'; import { IProcessService, IProcessServiceFactory, IPythonExecutionFactory, ObservableExecutionResult -} from '../../client/common/process/types'; +} from '../../platform/common/process/types'; import { anything, capture, instance, mock, when } from 'ts-mockito'; -import { LocalKernelSpecConnectionMetadata } from '../../client/../kernels/types'; -import { IFileSystem } from '../../client/common/platform/types'; -import { IPythonExtensionChecker } from '../../client/api/types'; +import { LocalKernelSpecConnectionMetadata } from '../../platform/../kernels/types'; +import { IFileSystem } from '../../platform/common/platform/types'; +import { IPythonExtensionChecker } from '../../platform/api/types'; import { noop } from '../core'; import { EventEmitter } from 'events'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { traceInfo } from '../../client/common/logger'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { traceInfo } from '../../platform/common/logger'; import { CancellationTokenSource } from 'vscode'; import { IKernelConnection } from '../../kernels/raw/types'; import { KernelEnvironmentVariablesService } from '../../kernels/raw/launcher/kernelEnvVarsService'; diff --git a/src/test/datascience/mockCommandManager.ts b/src/test/datascience/mockCommandManager.ts index e37a316f124..eb9b5a1adf0 100644 --- a/src/test/datascience/mockCommandManager.ts +++ b/src/test/datascience/mockCommandManager.ts @@ -4,8 +4,8 @@ import { noop } from 'lodash'; import { Disposable, TextEditor, TextEditorEdit } from 'vscode'; -import { ICommandNameArgumentTypeMapping } from '../../client/common/application/commands'; -import { ICommandManager } from '../../client/common/application/types'; +import { ICommandNameArgumentTypeMapping } from '../../platform/common/application/commands'; +import { ICommandManager } from '../../platform/common/application/types'; /* eslint-disable @typescript-eslint/no-explicit-any, , no-multi-str, */ export class MockCommandManager implements ICommandManager { diff --git a/src/test/datascience/mockDebugService.ts b/src/test/datascience/mockDebugService.ts deleted file mode 100644 index 0b996baf2fc..00000000000 --- a/src/test/datascience/mockDebugService.ts +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -import { inject, injectable, named } from 'inversify'; -import { - Breakpoint, - BreakpointsChangeEvent, - DebugAdapterTrackerFactory, - DebugConfiguration, - DebugConfigurationProvider, - DebugConsole, - DebugSession, - DebugSessionCustomEvent, - Disposable, - Event, - WorkspaceFolder -} from 'vscode'; -import { DebugProtocol } from 'vscode-debugprotocol'; -import { Identifiers } from '../../client/datascience/constants'; -import { IJupyterDebugService } from '../../client/datascience/types'; - -@injectable() -export class MockDebuggerService implements IJupyterDebugService { - constructor( - @inject(IJupyterDebugService) - @named(Identifiers.RUN_BY_LINE_DEBUGSERVICE) - private jupyterDebugService: IJupyterDebugService - ) {} - public get activeDebugSession(): DebugSession | undefined { - return this.activeService.activeDebugSession; - } - - public get activeDebugConsole(): DebugConsole { - return this.activeService.activeDebugConsole; - } - public get breakpoints(): readonly Breakpoint[] { - return this.activeService.breakpoints; - } - public get onDidChangeActiveDebugSession(): Event { - return this.activeService.onDidChangeActiveDebugSession; - } - public get onDidStartDebugSession(): Event { - return this.activeService.onDidStartDebugSession; - } - public get onDidReceiveDebugSessionCustomEvent(): Event { - return this.activeService.onDidReceiveDebugSessionCustomEvent; - } - public get onDidTerminateDebugSession(): Event { - return this.activeService.onDidTerminateDebugSession; - } - public get onDidChangeBreakpoints(): Event { - return this.onDidChangeBreakpoints; - } - public get onBreakpointHit(): Event { - return this.activeService.onBreakpointHit; - } - public startRunByLine(config: DebugConfiguration): Thenable { - return this.jupyterDebugService.startRunByLine(config); - } - public registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider): Disposable { - return this.jupyterDebugService.registerDebugConfigurationProvider(debugType, provider); - } - public registerDebugAdapterTrackerFactory(debugType: string, factory: DebugAdapterTrackerFactory): Disposable { - return this.jupyterDebugService.registerDebugAdapterTrackerFactory(debugType, factory); - } - public startDebugging( - folder: WorkspaceFolder | undefined, - nameOrConfiguration: string | DebugConfiguration, - parentSession?: DebugSession | undefined - ): Thenable { - return this.activeService.startDebugging(folder, nameOrConfiguration, parentSession); - } - public addBreakpoints(breakpoints: Breakpoint[]): void { - return this.activeService.addBreakpoints(breakpoints); - } - public removeBreakpoints(breakpoints: Breakpoint[]): void { - return this.activeService.removeBreakpoints(breakpoints); - } - public getStack(): Promise { - return this.activeService.getStack(); - } - public step(): Promise { - return this.activeService.step(); - } - public continue(): Promise { - return this.activeService.continue(); - } - public requestVariables(): Promise { - return this.activeService.requestVariables(); - } - public stop(): void { - return this.activeService.stop(); - } - private get activeService(): IJupyterDebugService { - return this.jupyterDebugService; - } -} diff --git a/src/test/datascience/mockDocumentManager.ts b/src/test/datascience/mockDocumentManager.ts index 1f869034b4d..0c854f2b662 100644 --- a/src/test/datascience/mockDocumentManager.ts +++ b/src/test/datascience/mockDocumentManager.ts @@ -21,8 +21,8 @@ import { WorkspaceEdit } from 'vscode'; -import { IDocumentManager } from '../../client/common/application/types'; -import { EXTENSION_ROOT_DIR } from '../../client/constants'; +import { IDocumentManager } from '../../platform/common/application/types'; +import { EXTENSION_ROOT_DIR } from '../../platform/constants'; import { MockDocument } from './mockDocument'; import { MockEditor } from './mockTextEditor'; diff --git a/src/test/datascience/mockEncryptedStorage.ts b/src/test/datascience/mockEncryptedStorage.ts index 78a65bd21b1..609d5e653ab 100644 --- a/src/test/datascience/mockEncryptedStorage.ts +++ b/src/test/datascience/mockEncryptedStorage.ts @@ -1,12 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { injectable } from 'inversify'; -import { IEncryptedStorage } from '../../client/common/application/types'; +import { IEncryptedStorage } from '../../platform/common/application/types'; /** * Mock for encrypted storage. Doesn't do anything except hold values in memory (keytar doesn't work without a UI coming up on Mac/Linux) */ -@injectable() export class MockEncryptedStorage implements IEncryptedStorage { private map = new Map(); public async store(service: string, key: string, value: string | undefined): Promise { diff --git a/src/test/datascience/mockFileSystem.ts b/src/test/datascience/mockFileSystem.ts index 2b42fb96406..85ba2342d91 100644 --- a/src/test/datascience/mockFileSystem.ts +++ b/src/test/datascience/mockFileSystem.ts @@ -2,10 +2,108 @@ // Licensed under the MIT License. 'use strict'; -import { Uri } from 'vscode'; -import { FileSystem } from '../../client/common/platform/fileSystem'; -import { FakeVSCodeFileSystemAPI } from '../serviceRegistry'; +import * as fsextra from 'fs-extra'; +import * as path from 'path'; +import { FileStat, FileType, Uri } from 'vscode'; +import { FileSystem } from '../../platform/common/platform/fileSystem'; +import { convertStat } from '../../platform/common/platform/fileSystemUtils'; +import { createDeferred } from '../../platform/common/utils/async'; +// This is necessary for unit tests and functional tests, since they +// do not run under VS Code so they do not have access to the actual +// "vscode" namespace. +export class FakeVSCodeFileSystemAPI { + public isWritableFileSystem(_scheme: string): boolean | undefined { + return; + } + public async readFile(uri: Uri): Promise { + return fsextra.readFile(uri.fsPath); + } + public async writeFile(uri: Uri, content: Uint8Array): Promise { + await fsextra.mkdirs(path.dirname(uri.fsPath)); + return fsextra.writeFile(uri.fsPath, Buffer.from(content)); + } + public async delete(uri: Uri, _options?: { recursive: boolean; useTrash: boolean }): Promise { + return ( + fsextra + // Make sure the file exists before deleting. + .stat(uri.fsPath) + .then(() => fsextra.remove(uri.fsPath)) + ); + } + public async stat(uri: Uri): Promise { + const filename = uri.fsPath; + + let filetype = FileType.Unknown; + let stat = await fsextra.lstat(filename); + if (stat.isSymbolicLink()) { + filetype = FileType.SymbolicLink; + stat = await fsextra.stat(filename); + } + if (stat.isFile()) { + filetype |= FileType.File; + } else if (stat.isDirectory()) { + filetype |= FileType.Directory; + } + return convertStat(stat, filetype); + } + public async readDirectory(uri: Uri): Promise<[string, FileType][]> { + const names: string[] = await fsextra.readdir(uri.fsPath); + const promises = names.map((name) => { + const filename = path.join(uri.fsPath, name); + return ( + fsextra + // Get the lstat info and deal with symlinks if necessary. + .lstat(filename) + .then(async (stat) => { + let filetype = FileType.Unknown; + if (stat.isFile()) { + filetype = FileType.File; + } else if (stat.isDirectory()) { + filetype = FileType.Directory; + } else if (stat.isSymbolicLink()) { + filetype = FileType.SymbolicLink; + stat = await fsextra.stat(filename); + if (stat.isFile()) { + filetype |= FileType.File; + } else if (stat.isDirectory()) { + filetype |= FileType.Directory; + } + } + return [name, filetype] as [string, FileType]; + }) + .catch(() => [name, FileType.Unknown] as [string, FileType]) + ); + }); + return Promise.all(promises); + } + public async createDirectory(uri: Uri): Promise { + return fsextra.mkdirp(uri.fsPath); + } + public async copy(src: Uri, dest: Uri): Promise { + const deferred = createDeferred(); + const rs = fsextra + // Set an error handler on the stream. + .createReadStream(src.fsPath) + .on('error', (err) => { + deferred.reject(err); + }); + const ws = fsextra + .createWriteStream(dest.fsPath) + // Set an error & close handler on the stream. + .on('error', (err) => { + deferred.reject(err); + }) + .on('close', () => { + deferred.resolve(); + }); + rs.pipe(ws); + return deferred.promise; + } + public async rename(src: Uri, dest: Uri): Promise { + return fsextra.rename(src.fsPath, dest.fsPath); + } +} export class MockFileSystem extends FileSystem { private contentOverloads = new Map(); diff --git a/src/test/datascience/mockJupyterNotebook.ts b/src/test/datascience/mockJupyterNotebook.ts index c1ff85483d5..cd090896730 100644 --- a/src/test/datascience/mockJupyterNotebook.ts +++ b/src/test/datascience/mockJupyterNotebook.ts @@ -5,7 +5,7 @@ import { Kernel, KernelMessage } from '@jupyterlab/services'; import { JSONObject } from '@lumino/coreutils'; import { Observable } from 'rxjs/Observable'; import { CancellationToken, Event, EventEmitter } from 'vscode'; -import { KernelConnectionMetadata } from '../../client/../kernels/types'; +import { KernelConnectionMetadata } from '../../platform/../kernels/types'; import { ICell, ICellHashProvider, @@ -15,8 +15,8 @@ import { INotebookProviderConnection, InterruptResult, KernelSocketInformation -} from '../../client/datascience/types'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +} from '../../platform/datascience/types'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; import { noop } from '../core'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/test/datascience/mockJupyterRequest.ts b/src/test/datascience/mockJupyterRequest.ts index f0a5dd610f9..3d956e3ef9f 100644 --- a/src/test/datascience/mockJupyterRequest.ts +++ b/src/test/datascience/mockJupyterRequest.ts @@ -5,9 +5,9 @@ import type * as nbformat from '@jupyterlab/nbformat'; import { Kernel, KernelMessage } from '@jupyterlab/services'; import { CancellationToken } from 'vscode-jsonrpc'; -import { createDeferred, Deferred } from '../../client/common/utils/async'; -import { noop } from '../../client/common/utils/misc'; -import { ICell } from '../../client/datascience/types'; +import { createDeferred, Deferred } from '../../platform/common/utils/async'; +import { noop } from '../../platform/common/utils/misc'; +import { ICell } from '../../platform/datascience/types'; import { concatMultilineString } from '../../datascience-ui/common'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/test/datascience/mockJupyterServer.ts b/src/test/datascience/mockJupyterServer.ts index 7de8f6a351f..ed73b40baf1 100644 --- a/src/test/datascience/mockJupyterServer.ts +++ b/src/test/datascience/mockJupyterServer.ts @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { NotebookDocument, Uri } from 'vscode'; -import { TemporaryFile } from '../../client/common/platform/types'; -import { IJupyterConnection, INotebook, INotebookServer } from '../../client/datascience/types'; +import { TemporaryFile } from '../../platform/common/platform/types'; +import { IJupyterConnection, INotebook, INotebookServer } from '../../platform/datascience/types'; import { MockJupyterNotebook } from './mockJupyterNotebook'; export class MockJupyterServer implements INotebookServer { diff --git a/src/test/datascience/mockJupyterSession.ts b/src/test/datascience/mockJupyterSession.ts index 91eeb0ff950..0bb438d074d 100644 --- a/src/test/datascience/mockJupyterSession.ts +++ b/src/test/datascience/mockJupyterSession.ts @@ -6,17 +6,17 @@ import { JSONObject } from '@lumino/coreutils'; import { CancellationTokenSource, Event, EventEmitter } from 'vscode'; import { Observable } from 'rxjs/Observable'; -import { noop } from '../../client/common/utils/misc'; -import { JupyterInvalidKernelError } from '../../extension/errors/jupyterInvalidKernelError'; -import { JupyterWaitForIdleError } from '../../extension/errors/jupyterWaitForIdleError'; -import { KernelConnectionMetadata } from '../../client/../kernels/types'; -import { IJupyterSession, KernelSocketInformation } from '../../client/datascience/types'; +import { noop } from '../../platform/common/utils/misc'; +import { JupyterInvalidKernelError } from '../../platform/errors/jupyterInvalidKernelError'; +import { JupyterWaitForIdleError } from '../../platform/errors/jupyterWaitForIdleError'; +import { KernelConnectionMetadata } from '../../platform/../kernels/types'; +import { IJupyterSession, KernelSocketInformation } from '../../platform/datascience/types'; import { sleep } from '../core'; import { MockJupyterRequest } from './mockJupyterRequest'; -import { Resource } from '../../client/common/types'; +import { Resource } from '../../platform/common/types'; import type * as nbformat from '@jupyterlab/nbformat'; import { concatMultilineString } from '../../datascience-ui/common'; -import { KernelInterruptTimeoutError } from '../../extension/errors/kernelInterruptTimeoutError'; +import { KernelInterruptTimeoutError } from '../../platform/errors/kernelInterruptTimeoutError'; const LineFeedRegEx = /(\r\n|\n)/g; diff --git a/src/test/datascience/mockJupyterSettings.ts b/src/test/datascience/mockJupyterSettings.ts index f3b04e40589..7e9a438f284 100644 --- a/src/test/datascience/mockJupyterSettings.ts +++ b/src/test/datascience/mockJupyterSettings.ts @@ -1,5 +1,5 @@ -import { JupyterSettings } from '../../client/common/configSettings'; -import { IJupyterSettings } from '../../client/common/types'; +import { JupyterSettings } from '../../platform/common/configSettings'; +import { IJupyterSettings } from '../../platform/common/types'; export class MockJupyterSettings extends JupyterSettings { public fireChangeEvent() { diff --git a/src/test/datascience/mockLanguageServer.ts b/src/test/datascience/mockLanguageServer.ts index 094efb4f042..7011db5c828 100644 --- a/src/test/datascience/mockLanguageServer.ts +++ b/src/test/datascience/mockLanguageServer.ts @@ -23,10 +23,10 @@ import { } from 'vscode'; import * as vscodeLanguageClient from 'vscode-languageclient/node'; import * as lsp from 'vscode-languageserver-protocol'; -import { ILanguageServer } from '../../client/api/types'; +import { ILanguageServer } from '../../platform/api/types'; -import { createDeferred, Deferred, sleep } from '../../client/common/utils/async'; -import { noop } from '../../client/common/utils/misc'; +import { createDeferred, Deferred, sleep } from '../../platform/common/utils/async'; +import { noop } from '../../platform/common/utils/misc'; /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/unified-signatures */ export class MockLanguageServer implements ILanguageServer { diff --git a/src/test/datascience/mockProcessService.ts b/src/test/datascience/mockProcessService.ts index 7b795902a14..056b84ce064 100644 --- a/src/test/datascience/mockProcessService.ts +++ b/src/test/datascience/mockProcessService.ts @@ -3,7 +3,7 @@ 'use strict'; import { Observable } from 'rxjs/Observable'; -import { Cancellation, CancellationError } from '../../client/common/cancellation'; +import { Cancellation, CancellationError } from '../../platform/common/cancellation'; import { ExecutionResult, IProcessService, @@ -11,7 +11,7 @@ import { Output, ShellOptions, SpawnOptions -} from '../../client/common/process/types'; +} from '../../platform/common/process/types'; import { noop, sleep } from '../core'; export class MockProcessService implements IProcessService { diff --git a/src/test/datascience/mockPythonService.ts b/src/test/datascience/mockPythonService.ts index d4bd33c2087..1104cc9aa9f 100644 --- a/src/test/datascience/mockPythonService.ts +++ b/src/test/datascience/mockPythonService.ts @@ -6,9 +6,9 @@ import { IPythonExecutionService, ObservableExecutionResult, SpawnOptions -} from '../../client/common/process/types'; -import { buildPythonExecInfo } from '../../client/pythonEnvironments/exec'; -import { InterpreterInformation, PythonEnvironment } from '../../client/pythonEnvironments/info'; +} from '../../platform/common/process/types'; +import { buildPythonExecInfo } from '../../platform/pythonEnvironments/exec'; +import { InterpreterInformation, PythonEnvironment } from '../../platform/pythonEnvironments/info'; import { MockProcessService } from './mockProcessService'; export class MockPythonService implements IPythonExecutionService { diff --git a/src/test/datascience/mockStatusProvider.ts b/src/test/datascience/mockStatusProvider.ts index 26712f4f32f..ab823af507d 100644 --- a/src/test/datascience/mockStatusProvider.ts +++ b/src/test/datascience/mockStatusProvider.ts @@ -1,5 +1,5 @@ import { Disposable } from 'vscode'; -import { IStatusProvider } from '../../client/datascience/types'; +import { IStatusProvider } from '../../platform/datascience/types'; import { noop } from '../core'; export class MockStatusProvider implements IStatusProvider { public set(_message: string, _timeout?: number, _cancel?: () => void): Disposable { diff --git a/src/test/datascience/mockTextEditor.ts b/src/test/datascience/mockTextEditor.ts index 88a8019c0bc..27b2cb31390 100644 --- a/src/test/datascience/mockTextEditor.ts +++ b/src/test/datascience/mockTextEditor.ts @@ -17,7 +17,7 @@ import { ViewColumn } from 'vscode'; -import { noop } from '../../client/common/utils/misc'; +import { noop } from '../../platform/common/utils/misc'; import { MockDocument } from './mockDocument'; import { MockDocumentManager } from './mockDocumentManager'; diff --git a/src/test/datascience/mountedWebView.ts b/src/test/datascience/mountedWebView.ts deleted file mode 100644 index 8aab5643735..00000000000 --- a/src/test/datascience/mountedWebView.ts +++ /dev/null @@ -1,269 +0,0 @@ -import { ReactWrapper } from 'enzyme'; -import { noop } from 'lodash'; -import { Event, EventEmitter, Uri } from 'vscode'; -import { - IWebviewPanel, - IWebviewPanelMessageListener, - IWebviewPanelOptions, - WebviewMessage -} from '../../client/common/application/types'; -import { traceError, traceInfo } from '../../client/common/logger'; -import { IDisposable } from '../../client/common/types'; -import { createDeferred } from '../../client/common/utils/async'; -import { InteractiveWindowMessages } from '../../extension/messageTypes'; -import { IVsCodeApi } from '../../datascience-ui/react-common/postOffice'; - -export type WaitForMessageOptions = { - /** - * Timeout for waiting for message. - * Defaults to 65_000ms. - * - * @type {number} - */ - timeoutMs?: number; - /** - * Number of times the message should be received. - * Defaults to 1. - * - * @type {number} - */ - numberOfTimes?: number; - - // Optional check for the payload of the message - // will only return (or count) message if this returns true - // eslint-disable-next-line @typescript-eslint/no-explicit-any - withPayload?(payload: any): boolean; -}; - -/* eslint-disable @typescript-eslint/no-explicit-any */ -export interface IMountedWebView extends IWebviewPanel, IDisposable { - readonly id: string; - readonly wrapper: ReactWrapper, React.Component>; - readonly onDisposed: Event; - postMessage(ev: WebviewMessage): void; - changeViewState(active: boolean, visible: boolean): void; - addMessageListener(callback: (m: string, p: any) => void): void; - removeMessageListener(callback: (m: string, p: any) => void): void; - attach(options: IWebviewPanelOptions): void; - waitForMessage(message: string, options?: WaitForMessageOptions): Promise; -} - -export class MountedWebView implements IMountedWebView, IDisposable { - public wrapper: ReactWrapper, React.Component>; - private missedMessages: any[] = []; - private webPanelListener: IWebviewPanelMessageListener | undefined; - private reactMessageCallback: ((ev: MessageEvent) => void) | undefined; - private extraListeners: ((m: string, p: any) => void)[] = []; - private disposed = false; - private active = true; - private visible = true; - private disposedEvent = new EventEmitter(); - private loadFailedEmitter = new EventEmitter(); - public get viewColumn() { - return 1; - } - - constructor(mount: () => ReactWrapper, React.Component>, public readonly id: string) { - // Setup the acquireVsCodeApi. The react control will cache this value when it's mounted. - const globalAcquireVsCodeApi = (): IVsCodeApi => { - return { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - postMessage: (msg: any) => { - this.postMessageToWebPanel(msg); - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-empty,@typescript-eslint/no-empty-function - setState: (_msg: any) => {}, - // eslint-disable-next-line @typescript-eslint/no-explicit-any, no-empty,@typescript-eslint/no-empty-function - getState: () => { - return {}; - } - }; - }; - // eslint-disable-next-line @typescript-eslint/dot-notation - (global as any)['acquireVsCodeApi'] = globalAcquireVsCodeApi; - - // Remap event handlers to point to the container. - const oldListener = window.addEventListener; - window.addEventListener = (event: string, cb: any) => { - if (event === 'message') { - this.reactMessageCallback = cb; - } - }; - - // Mount our main panel. This will make the global api be cached and have the event handler registered - this.wrapper = mount(); - - // We can remove the global api and event listener now. - delete (global as any).acquireVsCodeApi; - window.addEventListener = oldListener; - } - - public get onDisposed() { - return this.disposedEvent.event; - } - public get loadFailed(): Event { - return this.loadFailedEmitter.event; - } - public attach(options: IWebviewPanelOptions) { - this.webPanelListener = options.listener; - - // During testing the MainPanel sends the init message before our interactive window is created. - // Pretend like it's happening now (well after this function returns) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - setTimeout(() => { - this.webPanelListener!.onMessage(InteractiveWindowMessages.Started, {}); - }, 0); - - // Send messages that were already posted but were missed. - // During normal operation, the react control will not be created before - // the webPanelListener - if (this.missedMessages.length && this.webPanelListener) { - // This needs to be async because we are being called in the ctor of the webpanel. It can't - // handle some messages during the ctor. - setTimeout(() => { - this.missedMessages.forEach((m) => - this.webPanelListener ? this.webPanelListener.onMessage(m.type, m.payload) : noop() - ); - this.missedMessages = []; - }, 0); - } - } - - public async waitForMessage(message: string, options?: WaitForMessageOptions): Promise { - const timeoutMs = options && options.timeoutMs ? options.timeoutMs : undefined; - const numberOfTimes = options && options.numberOfTimes ? options.numberOfTimes : 1; - // Wait for the mounted web panel to send a message back to the data explorer - const promise = createDeferred(); - traceInfo(`Waiting for message ${message} with timeout of ${timeoutMs}`); - let handler: (m: string, p: any) => void; - const timer = timeoutMs - ? setTimeout(() => { - if (!promise.resolved) { - promise.reject(new Error(`Waiting for ${message} timed out`)); - } - }, timeoutMs) - : undefined; - let timesMessageReceived = 0; - const dispatchedAction = `DISPATCHED_ACTION_${message}`; - handler = (m: string, payload: any) => { - if (m === message || m === dispatchedAction) { - // First verify the payload matches - if (options?.withPayload) { - if (!options.withPayload(payload)) { - return; - } - } - - timesMessageReceived += 1; - if (timesMessageReceived < numberOfTimes) { - return; - } - if (timer) { - clearTimeout(timer); - } - this.removeMessageListener(handler); - // Make sure to rerender current state. - if (this.wrapper) { - this.wrapper.update(); - } - if (m === message) { - promise.resolve(); - } else { - // It could a redux dispatched message. - // Wait for 10ms, wait for other stuff to finish. - // We can wait for 100ms or 1s. But thats too long. - // The assumption is that currently we do not have any setTimeouts - // in UI code that's in the magnitude of 100ms or more. - // We do have a couple of setTiemout's, but they wait for 1ms, not 100ms. - // 10ms more than sufficient for all the UI timeouts. - setTimeout(() => promise.resolve(), 10); - } - } - }; - - this.addMessageListener(handler); - return promise.promise; - } - - public asWebviewUri(localResource: Uri): Uri { - return localResource; - } - public setTitle(_val: string): void { - noop(); - } - public async show(_preserveFocus: boolean): Promise { - noop(); - } - public isVisible(): boolean { - return this.visible; - } - public postMessage(m: WebviewMessage): void { - // Actually send to the UI - if (this.reactMessageCallback) { - // eslint-disable-next-line @typescript-eslint/no-require-imports - const reactHelpers = require('./reactHelpers') as typeof import('./reactHelpers'); - const message = reactHelpers.createMessageEvent(m); - this.reactMessageCallback(message); - if (m.payload) { - delete m.payload; - } - } - } - public close(): void { - noop(); - } - public isActive(): boolean { - return this.active; - } - public updateCwd(_cwd: string): void { - noop(); - } - public dispose() { - if (!this.disposed) { - this.disposed = true; - if (this.wrapper.length) { - this.wrapper.unmount(); - } - this.disposedEvent.fire(); - } - } - - public changeViewState(active: boolean, visible: boolean) { - this.active = active; - this.visible = visible; - if (this.webPanelListener) { - this.webPanelListener.onChangeViewState(this); - } - } - public addMessageListener(callback: (m: string, p: any) => void) { - this.extraListeners.push(callback); - } - - public removeMessageListener(callback: (m: string, p: any) => void) { - const index = this.extraListeners.indexOf(callback); - if (index >= 0) { - this.extraListeners.splice(index, 1); - } - } - private postMessageToWebPanel(msg: any) { - if (this.disposed && !msg.type.startsWith(`DISPATCHED`)) { - traceError(`Posting to disposed mount.`); - } - if (this.webPanelListener) { - this.webPanelListener.onMessage(msg.type, msg.payload); - } else { - this.missedMessages.push({ type: msg.type, payload: msg.payload }); - } - if (this.extraListeners.length) { - this.extraListeners.forEach((e) => e(msg.type, msg.payload)); - } - - // Clear out msg payload - delete msg.payload; - - // unmount ourselves if this is the close message - if (msg.type === InteractiveWindowMessages.NotebookClose) { - this.dispose(); - } - } -} diff --git a/src/test/datascience/mountedWebViewFactory.ts b/src/test/datascience/mountedWebViewFactory.ts deleted file mode 100644 index 8fbe3cbe5cb..00000000000 --- a/src/test/datascience/mountedWebViewFactory.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { ReactWrapper } from 'enzyme'; -import { inject, injectable } from 'inversify'; -import { IDisposable, IDisposableRegistry } from '../../client/common/types'; -import { IMountedWebView, MountedWebView } from './mountedWebView'; - -export const IMountedWebViewFactory = Symbol('IMountedWebViewFactory'); - -export interface IMountedWebViewFactory { - get(id: string): IMountedWebView; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - create(id: string, mount: () => ReactWrapper, React.Component>): IMountedWebView; -} - -@injectable() -export class MountedWebViewFactory implements IMountedWebViewFactory, IDisposable { - private map = new Map(); - - constructor(@inject(IDisposableRegistry) readonly disposables: IDisposableRegistry) { - disposables.push(this); - } - - public dispose() { - this.map.forEach((v) => v.dispose()); - this.map.clear(); - } - public get(id: string): IMountedWebView { - const obj = this.map.get(id); - if (!obj) { - throw new Error(`No mounted web view found for id ${id}`); - } - return obj; - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - public create(id: string, mount: () => ReactWrapper, React.Component>): IMountedWebView { - if (this.map.has(id)) { - throw new Error(`Mounted web view already exists for id ${id}`); - } - const obj = new MountedWebView(mount, id); - obj.onDisposed(() => this.map.delete(id)); - this.map.set(id, obj); - return obj; - } -} diff --git a/src/test/datascience/nativeEditor.functional.test.tsx b/src/test/datascience/nativeEditor.functional.test.tsx index 01a67434e80..8f1e7eb65c4 100644 --- a/src/test/datascience/nativeEditor.functional.test.tsx +++ b/src/test/datascience/nativeEditor.functional.test.tsx @@ -28,18 +28,18 @@ suite('Dummy8', () => { // ICustomEditorService, // IDocumentManager, // IWorkspaceService -// } from '../../client/common/application/types'; -// import { IFileSystem } from '../../client/common/platform/types'; -// import { ICryptoUtils, IDisposable, IExtensionContext } from '../../client/common/types'; -// import { createDeferred, sleep, waitForPromise } from '../../client/common/utils/async'; -// import { noop } from '../../client/common/utils/misc'; -// import { Commands, Identifiers } from '../../client/datascience/constants'; -// import { InteractiveWindowMessages } from '../../client/datascience/interactive-common/interactiveWindowTypes'; -// import { NativeEditor as NativeEditorWebView } from '../../client/datascience/interactive-ipynb/nativeEditor'; -// import { IKernelSpecQuickPickItem, KernelSpecConnectionMetadata } from '../../client/datascience/jupyter/kernels/types'; -// import { KeyPrefix } from '../../client/datascience/notebookStorage/nativeEditorStorage'; -// import { NativeEditorNotebookModel } from '../../client/datascience/notebookStorage/notebookModel'; -// import { ICell, INotebookEditor, INotebookEditorProvider, INotebookExporter } from '../../client/datascience/types'; +// } from '../../platform/common/application/types'; +// import { IFileSystem } from '../../platform/common/platform/types'; +// import { ICryptoUtils, IDisposable, IExtensionContext } from '../../platform/common/types'; +// import { createDeferred, sleep, waitForPromise } from '../../platform/common/utils/async'; +// import { noop } from '../../platform/common/utils/misc'; +// import { Commands, Identifiers } from '../../platform/datascience/constants'; +// import { InteractiveWindowMessages } from '../../platform/datascience/interactive-common/interactiveWindowTypes'; +// import { NativeEditor as NativeEditorWebView } from '../../platform/datascience/interactive-ipynb/nativeEditor'; +// import { IKernelSpecQuickPickItem, KernelSpecConnectionMetadata } from '../../platform/datascience/jupyter/kernels/types'; +// import { KeyPrefix } from '../../platform/datascience/notebookStorage/nativeEditorStorage'; +// import { NativeEditorNotebookModel } from '../../platform/datascience/notebookStorage/notebookModel'; +// import { ICell, INotebookEditor, INotebookEditorProvider, INotebookExporter } from '../../platform/datascience/types'; // import { concatMultilineString } from '../../datascience-ui/common'; // import { ExecutionCount } from '../../datascience-ui/interactive-common/executionCount'; // import { CommonActionType } from '../../datascience-ui/interactive-common/redux/reducers/types'; diff --git a/src/test/datascience/nativeEditor.toolbar.functional.test.tsx b/src/test/datascience/nativeEditor.toolbar.functional.test.tsx index 745d24611c1..19da03f5416 100644 --- a/src/test/datascience/nativeEditor.toolbar.functional.test.tsx +++ b/src/test/datascience/nativeEditor.toolbar.functional.test.tsx @@ -12,7 +12,7 @@ suite('Dummy8', () => { // import { ReactWrapper } from 'enzyme'; // import * as React from 'react'; // import * as sinon from 'sinon'; -// import { PYTHON_LANGUAGE } from '../../client/common/constants'; +// import { PYTHON_LANGUAGE } from '../../platform/common/constants'; // import { getNamesAndValues } from '../utils/enum'; // import { ServerStatus } from '../../datascience-ui/interactive-common/mainState'; // import { TrustMessage } from '../../datascience-ui/interactive-common/trustMessage'; diff --git a/src/test/datascience/nativeEditorViewTracker.unit.test.ts b/src/test/datascience/nativeEditorViewTracker.unit.test.ts index f268f63895f..34fc08d3f7b 100644 --- a/src/test/datascience/nativeEditorViewTracker.unit.test.ts +++ b/src/test/datascience/nativeEditorViewTracker.unit.test.ts @@ -5,12 +5,12 @@ // import { expect } from 'chai'; // import { anything, instance, mock, when } from 'ts-mockito'; // import { EventEmitter, Memento, Uri } from 'vscode'; -// import { NotebookModelChange } from '../../extension/messageTypes'; -// import { NativeEditor } from '../../client/datascience/interactive-ipynb/nativeEditor'; -// import { NativeEditorViewTracker } from '../../client/datascience/interactive-ipynb/nativeEditorViewTracker'; +// import { NotebookModelChange } from '../../platform/messageTypes'; +// import { NativeEditor } from '../../platform/datascience/interactive-ipynb/nativeEditor'; +// import { NativeEditorViewTracker } from '../../platform/datascience/interactive-ipynb/nativeEditorViewTracker'; // import { NativeEditorProvider } from '../../notebooksStorage/nativeEditorProvider'; // import { NativeEditorNotebookModel } from '../../notebooksStorage/notebookModel'; -// import { INotebookEditor, INotebookEditorProvider, INotebookModel } from '../../client/datascience/types'; +// import { INotebookEditor, INotebookEditorProvider, INotebookModel } from '../../platform/datascience/types'; // import { MockMemento } from '../mocks/mementos'; // suite('DataScience - View tracker', () => { diff --git a/src/test/datascience/notebook.functional.test.ts b/src/test/datascience/notebook.functional.test.ts index cb354654161..efda272149c 100644 --- a/src/test/datascience/notebook.functional.test.ts +++ b/src/test/datascience/notebook.functional.test.ts @@ -20,23 +20,23 @@ suite('Dummy9', () => { // import * as uuid from 'uuid/v4'; // import { Disposable, Uri } from 'vscode'; // import { CancellationToken } from 'vscode-jsonrpc'; -// import { ApplicationShell } from '../../client/common/application/applicationShell'; -// import { IApplicationShell, IWorkspaceService } from '../../client/common/application/types'; -// import { Cancellation } from '../../client/common/cancellation'; -// import { EXTENSION_ROOT_DIR } from '../../client/common/constants'; -// import { traceError, traceInfo } from '../../client/common/logger'; -// import { IFileSystem } from '../../client/common/platform/types'; -// import { IPythonExecutionFactory } from '../../client/common/process/types'; -// import { Product } from '../../client/common/types'; -// import { createDeferred, waitForPromise } from '../../client/common/utils/async'; -// import { noop } from '../../client/common/utils/misc'; -// import { ExportInterpreterFinder } from '../../client/datascience/export/exportInterpreterFinder'; -// import { ExportFormat } from '../../client/datascience/export/types'; -// import { getDefaultInteractiveIdentity } from '../../client/datascience/interactive-window/identity'; -// import { getMessageForLibrariesNotInstalled } from '../../client/datascience/jupyter/interpreter/jupyterInterpreterDependencyService'; -// import { JupyterKernelPromiseFailedError } from '../../client/../kernels/jupyterKernelPromiseFailedError'; -// import { HostJupyterExecution } from '../../client/datascience/jupyter/liveshare/hostJupyterExecution'; -// import { HostJupyterNotebook } from '../../client/datascience/jupyter/liveshare/hostJupyterNotebook'; +// import { ApplicationShell } from '../../platform/common/application/applicationShell'; +// import { IApplicationShell, IWorkspaceService } from '../../platform/common/application/types'; +// import { Cancellation } from '../../platform/common/cancellation'; +// import { EXTENSION_ROOT_DIR } from '../../platform/common/constants'; +// import { traceError, traceInfo } from '../../platform/common/logger'; +// import { IFileSystem } from '../../platform/common/platform/types'; +// import { IPythonExecutionFactory } from '../../platform/common/process/types'; +// import { Product } from '../../platform/common/types'; +// import { createDeferred, waitForPromise } from '../../platform/common/utils/async'; +// import { noop } from '../../platform/common/utils/misc'; +// import { ExportInterpreterFinder } from '../../platform/datascience/export/exportInterpreterFinder'; +// import { ExportFormat } from '../../platform/datascience/export/types'; +// import { getDefaultInteractiveIdentity } from '../../platform/datascience/interactive-window/identity'; +// import { getMessageForLibrariesNotInstalled } from '../../platform/datascience/jupyter/interpreter/jupyterInterpreterDependencyService'; +// import { JupyterKernelPromiseFailedError } from '../../platform/../kernels/jupyterKernelPromiseFailedError'; +// import { HostJupyterExecution } from '../../platform/datascience/jupyter/liveshare/hostJupyterExecution'; +// import { HostJupyterNotebook } from '../../platform/datascience/jupyter/liveshare/hostJupyterNotebook'; // import { // CellState, // ICell, @@ -49,9 +49,9 @@ suite('Dummy9', () => { // INotebookImporter, // INotebookProvider, // InterruptResult -// } from '../../client/datascience/types'; -// import { IInterpreterService } from '../../client/interpreter/contracts'; -// import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +// } from '../../platform/datascience/types'; +// import { IInterpreterService } from '../../platform/interpreter/contracts'; +// import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; // import { concatMultilineString } from '../../datascience-ui/common'; // import { generateTestState, ICellViewModel } from '../../datascience-ui/interactive-common/mainState'; // import { sleep } from '../core'; @@ -1210,7 +1210,7 @@ suite('Dummy9', () => { // const factory = ioc.serviceManager.get(IPythonExecutionFactory); // const service = await factory.create({ pythonPath }); // const mockService = service as MockPythonService; -// // Used by commands (can be removed when `src/client/datascience/jupyter/interpreter/jupyterCommand.ts` is deleted). +// // Used by commands (can be removed when `src/platform/datascience/jupyter/interpreter/jupyterCommand.ts` is deleted). // mockService.addExecResult(['-m', 'jupyter', 'notebook', '--version'], () => { // return Promise.resolve({ // stdout: '9.9.9.9', @@ -1218,7 +1218,7 @@ suite('Dummy9', () => { // }); // }); -// // Used by commands (can be removed when `src/client/datascience/jupyter/interpreter/jupyterCommand.ts` is deleted). +// // Used by commands (can be removed when `src/platform/datascience/jupyter/interpreter/jupyterCommand.ts` is deleted). // mockService.addExecResult(['-m', 'notebook', '--version'], () => { // return Promise.resolve({ // stdout: '', diff --git a/src/test/datascience/notebook/diagnosticProvider.vscode.test.ts b/src/test/datascience/notebook/diagnosticProvider.vscode.test.ts index e570be22a8d..86b61d853a6 100644 --- a/src/test/datascience/notebook/diagnosticProvider.vscode.test.ts +++ b/src/test/datascience/notebook/diagnosticProvider.vscode.test.ts @@ -5,10 +5,10 @@ /* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ import { assert } from 'chai'; -import { DataScience } from '../../../client/common/utils/localize'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../../common'; import { initialize } from '../../initialize'; import { @@ -18,7 +18,7 @@ import { workAroundVSCodeNotebookStartPages } from './helper'; import { NotebookDocument, Range } from 'vscode'; -import { IExtensionSyncActivationService } from '../../../client/activation/types'; +import { IExtensionSyncActivationService } from '../../../platform/activation/types'; import { NotebookCellBangInstallDiagnosticsProvider } from '../../../intellisense/diagnosticsProvider'; /* eslint-disable @typescript-eslint/no-explicit-any, no-invalid-this */ diff --git a/src/test/datascience/notebook/executionService.mock.vscode.test.ts b/src/test/datascience/notebook/executionService.mock.vscode.test.ts index b6c549ac033..790afff8b1d 100644 --- a/src/test/datascience/notebook/executionService.mock.vscode.test.ts +++ b/src/test/datascience/notebook/executionService.mock.vscode.test.ts @@ -6,10 +6,10 @@ // /* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ // import { assert } from 'chai'; // import * as sinon from 'sinon'; -// import { Common } from '../../../client/common/utils/localize'; -// import { IVSCodeNotebook } from '../../../client/common/application/types'; -// import { traceInfo } from '../../../client/common/logger'; -// import { IDisposable, Product } from '../../../client/common/types'; +// import { Common } from '../../../platform/common/utils/localize'; +// import { IVSCodeNotebook } from '../../../platform/common/application/types'; +// import { traceInfo } from '../../../platform/common/logger'; +// import { IDisposable, Product } from '../../../platform/common/types'; // import { IExtensionTestApi } from '../../common'; // import { initialize } from '../../initialize'; // import { @@ -23,15 +23,15 @@ // workAroundVSCodeNotebookStartPages, // waitForTextOutput // } from './helper'; -// import { ProductNames } from '../../../client/common/installer/productNames'; +// import { ProductNames } from '../../../platform/common/installer/productNames'; // import { INotebookControllerManager } from '../../../notebooks/types'; -// import { IKernelProvider } from '../../../client/../kernels/types'; +// import { IKernelProvider } from '../../../platform/../kernels/types'; // import { // IJupyterSession, // INotebook, // INotebookProvider, // KernelSocketInformation -// } from '../../../client/datascience/types'; +// } from '../../../platform/datascience/types'; // import { instance, mock, when } from 'ts-mockito'; // import { Subject } from 'rxjs-compat/Subject'; // import { EventEmitter, NotebookDocument } from 'vscode'; diff --git a/src/test/datascience/notebook/executionService.vscode.test.ts b/src/test/datascience/notebook/executionService.vscode.test.ts index 3fe38ebbb6d..2bfeba76cec 100644 --- a/src/test/datascience/notebook/executionService.vscode.test.ts +++ b/src/test/datascience/notebook/executionService.vscode.test.ts @@ -10,10 +10,10 @@ import * as path from 'path'; import * as dedent from 'dedent'; import * as sinon from 'sinon'; import { commands, NotebookCell, NotebookCellExecutionState, NotebookCellKind, NotebookCellOutput, Uri } from 'vscode'; -import { Common } from '../../../client/common/utils/localize'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo, traceInfoIfCI } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; +import { Common } from '../../../platform/common/utils/localize'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo, traceInfoIfCI } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; import { captureScreenShot, getOSType, IExtensionTestApi, OSType, waitForCondition } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, initialize } from '../../initialize'; import { @@ -45,13 +45,13 @@ import { waitForCellExecutionToComplete } from './helper'; import { openNotebook } from '../helpers'; -import { noop } from '../../../client/common/utils/misc'; +import { noop } from '../../../platform/common/utils/misc'; import { getTextOutputValue, hasErrorOutput, translateCellErrorOutput } from '../../../notebooks/helpers'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; import { ProductNames } from '../../../kernels/installer/productNames'; import { Product } from '../../../kernels/installer/types'; import { IPYTHON_VERSION_CODE, IS_REMOTE_NATIVE_TEST } from '../../constants'; -import { areInterpreterPathsSame } from '../../../client/pythonEnvironments/info/interpreter'; +import { areInterpreterPathsSame } from '../../../platform/pythonEnvironments/info/interpreter'; // eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports const expectedPromptMessageSuffix = `requires ${ProductNames.get(Product.ipykernel)!} to be installed.`; diff --git a/src/test/datascience/notebook/exportFull.vscode.test.ts b/src/test/datascience/notebook/exportFull.vscode.test.ts index 5ba33539842..e24d6e98b69 100644 --- a/src/test/datascience/notebook/exportFull.vscode.test.ts +++ b/src/test/datascience/notebook/exportFull.vscode.test.ts @@ -8,10 +8,10 @@ import { assert, expect } from 'chai'; import * as os from 'os'; import * as path from 'path'; import * as sinon from 'sinon'; -import { Common } from '../../../client/common/utils/localize'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; +import { Common } from '../../../platform/common/utils/localize'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; import { captureScreenShot, IExtensionTestApi } from '../../common'; import { initialize } from '../../initialize'; import { @@ -24,7 +24,7 @@ import { workAroundVSCodeNotebookStartPages } from './helper'; import { commands, ConfigurationTarget, Uri, window, workspace } from 'vscode'; -import { createDeferred } from '../../../client/common/utils/async'; +import { createDeferred } from '../../../platform/common/utils/async'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants'; import { ProductNames } from '../../../kernels/installer/productNames'; import { Product } from '../../../kernels/installer/types'; @@ -111,12 +111,10 @@ suite('DataScience - VSCode Notebook - (Export) (slow)', function () { assert(window.activeTextEditor?.document.languageId === 'python', 'Document opened by export was not python'); const text = window.activeTextEditor?.document.getText(); + const expected = `# %%${os.EOL}print("Hello World")${os.EOL}${os.EOL}# %% [markdown]${os.EOL}# # Markdown Header${os.EOL}# markdown string${os.EOL}${os.EOL}# %%${os.EOL}%whos${os.EOL}${os.EOL}${os.EOL}`; // Verify text content - expect(text).to.equal( - `# %%${os.EOL}print("Hello World")${os.EOL}${os.EOL}# %% [markdown]${os.EOL}# # Markdown Header${os.EOL}# markdown string${os.EOL}${os.EOL}# %%${os.EOL}%whos${os.EOL}${os.EOL}`, - 'Exported text does not match' - ); + expect(text).to.equal(expected, 'Exported text does not match'); // Clean up dispose onDidChangeDispose.dispose(); @@ -145,12 +143,10 @@ suite('DataScience - VSCode Notebook - (Export) (slow)', function () { assert(window.activeTextEditor?.document.languageId === 'python', 'Document opened by export was not python'); const text = window.activeTextEditor?.document.getText(); + const expected = `# %%${os.EOL}print("Hello World")${os.EOL}${os.EOL}# %% [markdown]${os.EOL}# # Markdown Header${os.EOL}# markdown string${os.EOL}${os.EOL}# %%${os.EOL}# %whos${os.EOL}# !shellcmd${os.EOL}${os.EOL}${os.EOL}`; // Verify text content - expect(text).to.equal( - `# %%${os.EOL}print("Hello World")${os.EOL}${os.EOL}# %% [markdown]${os.EOL}# # Markdown Header${os.EOL}# markdown string${os.EOL}${os.EOL}# %%${os.EOL}# %whos${os.EOL}# !shellcmd${os.EOL}${os.EOL}`, - 'Exported text does not match' - ); + expect(text).to.equal(expected, 'Exported text does not match'); // Clean up dispose onDidChangeDispose.dispose(); @@ -179,12 +175,10 @@ suite('DataScience - VSCode Notebook - (Export) (slow)', function () { assert(window.activeTextEditor?.document.languageId === 'python', 'Document opened by export was not python'); const text = window.activeTextEditor?.document.getText(); + const expected = `# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nfrom IPython import get_ipython\n\n# %%\nprint("Hello World")\n\n# %% [markdown]\n# # Markdown Header\n# markdown string\n\n# %%\nget_ipython().run_line_magic('whos', '')\nget_ipython().system('shellcmd')\n\n\n`; // Verify text content - expect(text).to.equal( - `# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nfrom IPython import get_ipython\n\n# %%\nprint("Hello World")\n\n# %% [markdown]\n# # Markdown Header\n# markdown string\n\n# %%\nget_ipython().run_line_magic('whos', '')\nget_ipython().system('shellcmd')\n\n`, - 'Exported text does not match' - ); + expect(text).to.equal(expected, 'Exported text does not match'); // Clean up dispose onDidChangeDispose.dispose(); @@ -218,7 +212,7 @@ suite('DataScience - VSCode Notebook - (Export) (slow)', function () { const text = window.activeTextEditor?.document.getText(); // Verify text content - expect(text).to.equal(`# %%${os.EOL}a=1${os.EOL}a${os.EOL}${os.EOL}`, 'Exported text does not match'); + expect(text).to.equal(`# %%${os.EOL}a=1${os.EOL}a${os.EOL}${os.EOL}${os.EOL}`, 'Exported text does not match'); // Clean up dispose onDidChangeDispose.dispose(); @@ -257,7 +251,7 @@ suite('DataScience - VSCode Notebook - (Export) (slow)', function () { // Verify text content expect(text).to.equal( - `# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\na=1\na\n\n`, + `# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\na=1\na\n\n\n`, 'Exported text does not match' ); diff --git a/src/test/datascience/notebook/helper.ts b/src/test/datascience/notebook/helper.ts index d6ca658a4cb..da9defeb661 100644 --- a/src/test/datascience/notebook/helper.ts +++ b/src/test/datascience/notebook/helper.ts @@ -32,23 +32,23 @@ import { Hover, Diagnostic } from 'vscode'; -import { IApplicationShell, IVSCodeNotebook } from '../../../client/common/application/types'; -import { JVSC_EXTENSION_ID, MARKDOWN_LANGUAGE, PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { traceInfo, traceInfoIfCI } from '../../../client/common/logger'; -import { GLOBAL_MEMENTO, IDisposable, IMemento } from '../../../client/common/types'; -import { createDeferred } from '../../../client/common/utils/async'; -import { swallowExceptions } from '../../../client/common/utils/misc'; -import { IKernelProvider } from '../../../client/../kernels/types'; -import { INotebookEditorProvider } from '../../../client/datascience/types'; +import { IApplicationShell, IVSCodeNotebook } from '../../../platform/common/application/types'; +import { JVSC_EXTENSION_ID, MARKDOWN_LANGUAGE, PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { traceInfo, traceInfoIfCI } from '../../../platform/common/logger'; +import { GLOBAL_MEMENTO, IDisposable, IMemento } from '../../../platform/common/types'; +import { createDeferred } from '../../../platform/common/utils/async'; +import { swallowExceptions } from '../../../platform/common/utils/misc'; +import { IKernelProvider } from '../../../platform/../kernels/types'; +import { INotebookEditorProvider } from '../../../platform/datascience/types'; import { IExtensionTestApi, sleep, waitForCondition } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST, IS_SMOKE_TEST } from '../../constants'; import { noop } from '../../core'; import { closeActiveWindows, initialize, isInsiders } from '../../initialize'; import { JupyterServer } from '../jupyterServer'; import { DebugProtocol } from 'vscode-debugprotocol'; -import { IDebuggingManager, IKernelDebugAdapter } from '../../../client/debugger/types'; -import { DataScience } from '../../../client/common/utils/localize'; +import { IDebuggingManager, IKernelDebugAdapter } from '../../../platform/debugger/types'; +import { DataScience } from '../../../platform/common/utils/localize'; import { JupyterServerSelector } from '../../../kernels/jupyter/serverSelector'; import { LastSavedNotebookCellLanguage } from '../../../intellisense/cellLanguageService'; import { VSCodeNotebookController } from '../../../notebooks/controllers/vscodeNotebookController'; @@ -190,7 +190,7 @@ export async function ensureNewNotebooksHavePythonCells() { export async function closeNotebooksAndCleanUpAfterTests(disposables: IDisposable[] = []) { if (!IS_SMOKE_TEST) { // When running smoke tests, we won't have access to these. - const configSettings = await import('../../../client/common/configSettings'); + const configSettings = await import('../../../platform/common/configSettings'); // Dispose any cached python settings (used only in test env). configSettings.JupyterSettings.dispose(); } diff --git a/src/test/datascience/notebook/intellisense/completion.vscode.test.ts b/src/test/datascience/notebook/intellisense/completion.vscode.test.ts index 7f1a463c412..f0c45d5ead7 100644 --- a/src/test/datascience/notebook/intellisense/completion.vscode.test.ts +++ b/src/test/datascience/notebook/intellisense/completion.vscode.test.ts @@ -5,11 +5,11 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { commands, CompletionList, Position } from 'vscode'; -import { IVSCodeNotebook } from '../../../../client/common/application/types'; -import { traceInfo } from '../../../../client/common/logger'; -import { IDisposable } from '../../../../client/common/types'; +import { IVSCodeNotebook } from '../../../../platform/common/application/types'; +import { traceInfo } from '../../../../platform/common/logger'; +import { IDisposable } from '../../../../platform/common/types'; import { InteractiveWindowProvider } from '../../../../interactive-window/interactiveWindowProvider'; -import { IInteractiveWindowProvider } from '../../../../client/datascience/types'; +import { IInteractiveWindowProvider } from '../../../../platform/datascience/types'; import { getTextOutputValue } from '../../../../notebooks/helpers'; import { captureScreenShot, IExtensionTestApi } from '../../../common'; import { IS_REMOTE_NATIVE_TEST } from '../../../constants'; diff --git a/src/test/datascience/notebook/intellisense/completionProvider.vscode.test.ts b/src/test/datascience/notebook/intellisense/completionProvider.vscode.test.ts index dc862cf6602..7a15335c2f2 100644 --- a/src/test/datascience/notebook/intellisense/completionProvider.vscode.test.ts +++ b/src/test/datascience/notebook/intellisense/completionProvider.vscode.test.ts @@ -17,9 +17,9 @@ import { workspace, WorkspaceEdit } from 'vscode'; -import { IVSCodeNotebook } from '../../../../client/common/application/types'; -import { traceInfo } from '../../../../client/common/logger'; -import { IDisposable } from '../../../../client/common/types'; +import { IVSCodeNotebook } from '../../../../platform/common/application/types'; +import { traceInfo } from '../../../../platform/common/logger'; +import { IDisposable } from '../../../../platform/common/types'; import { PythonKernelCompletionProvider } from '../../../../intellisense/pythonKernelCompletionProvider'; import { IExtensionTestApi, sleep } from '../../../common'; import { IS_REMOTE_NATIVE_TEST } from '../../../constants'; diff --git a/src/test/datascience/notebook/intellisense/diagnostics.vscode.test.ts b/src/test/datascience/notebook/intellisense/diagnostics.vscode.test.ts index 2f45e7d3e9f..e17f3b9f9ab 100644 --- a/src/test/datascience/notebook/intellisense/diagnostics.vscode.test.ts +++ b/src/test/datascience/notebook/intellisense/diagnostics.vscode.test.ts @@ -4,9 +4,9 @@ /* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { IVSCodeNotebook } from '../../../../client/common/application/types'; -import { traceInfo } from '../../../../client/common/logger'; -import { IDisposable } from '../../../../client/common/types'; +import { IVSCodeNotebook } from '../../../../platform/common/application/types'; +import { traceInfo } from '../../../../platform/common/logger'; +import { IDisposable } from '../../../../platform/common/types'; import { IExtensionTestApi } from '../../../common'; import { IS_REMOTE_NATIVE_TEST } from '../../../constants'; import { initialize } from '../../../initialize'; diff --git a/src/test/datascience/notebook/intellisense/gotodef.vscode.test.ts b/src/test/datascience/notebook/intellisense/gotodef.vscode.test.ts index 3644aa958ba..a08cccf2be0 100644 --- a/src/test/datascience/notebook/intellisense/gotodef.vscode.test.ts +++ b/src/test/datascience/notebook/intellisense/gotodef.vscode.test.ts @@ -5,8 +5,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import * as vscode from 'vscode'; -import { traceInfo } from '../../../../client/common/logger'; -import { IDisposable } from '../../../../client/common/types'; +import { traceInfo } from '../../../../platform/common/logger'; +import { IDisposable } from '../../../../platform/common/types'; import { captureScreenShot, createEventHandler, waitForCondition } from '../../../common'; import { IS_REMOTE_NATIVE_TEST } from '../../../constants'; import { diff --git a/src/test/datascience/notebook/intellisense/hover.vscode.test.ts b/src/test/datascience/notebook/intellisense/hover.vscode.test.ts index 1fd2f4fae7d..119b818f787 100644 --- a/src/test/datascience/notebook/intellisense/hover.vscode.test.ts +++ b/src/test/datascience/notebook/intellisense/hover.vscode.test.ts @@ -5,9 +5,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { Position } from 'vscode'; -import { IVSCodeNotebook } from '../../../../client/common/application/types'; -import { traceInfo } from '../../../../client/common/logger'; -import { IDisposable } from '../../../../client/common/types'; +import { IVSCodeNotebook } from '../../../../platform/common/application/types'; +import { traceInfo } from '../../../../platform/common/logger'; +import { IDisposable } from '../../../../platform/common/types'; import { IExtensionTestApi } from '../../../common'; import { IS_REMOTE_NATIVE_TEST } from '../../../constants'; import { initialize } from '../../../initialize'; diff --git a/src/test/datascience/notebook/intellisense/interpreterSwitch.vscode.test.ts b/src/test/datascience/notebook/intellisense/interpreterSwitch.vscode.test.ts index ea98e749e40..ff64386813d 100644 --- a/src/test/datascience/notebook/intellisense/interpreterSwitch.vscode.test.ts +++ b/src/test/datascience/notebook/intellisense/interpreterSwitch.vscode.test.ts @@ -7,9 +7,9 @@ import * as path from 'path'; import * as fs from 'fs-extra'; import * as sinon from 'sinon'; import { languages } from 'vscode'; -import { traceInfo } from '../../../../client/common/logger'; -import { IDisposable } from '../../../../client/common/types'; -import { IInterpreterService } from '../../../../client/interpreter/contracts'; +import { traceInfo } from '../../../../platform/common/logger'; +import { IDisposable } from '../../../../platform/common/types'; +import { IInterpreterService } from '../../../../platform/interpreter/contracts'; import { captureScreenShot, getOSType, IExtensionTestApi, OSType, waitForCondition } from '../../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST } from '../../../constants'; import { initialize, IS_CI_SERVER } from '../../../initialize'; @@ -23,9 +23,9 @@ import { waitForDiagnostics, defaultNotebookTestTimeout } from '../helper'; -import { IVSCodeNotebook } from '../../../../client/common/application/types'; -import { IPythonExecutionFactory } from '../../../../client/common/process/types'; -import { PythonEnvironment } from '../../../../client/pythonEnvironments/info'; +import { IVSCodeNotebook } from '../../../../platform/common/application/types'; +import { IPythonExecutionFactory } from '../../../../platform/common/process/types'; +import { PythonEnvironment } from '../../../../platform/pythonEnvironments/info'; /* eslint-disable @typescript-eslint/no-explicit-any, no-invalid-this */ suite('DataScience - Intellisense Switch interpreters in a notebook', function () { diff --git a/src/test/datascience/notebook/intellisense/semanticTokens.vscode.test.ts b/src/test/datascience/notebook/intellisense/semanticTokens.vscode.test.ts index 057d1136d69..ad8bd735c27 100644 --- a/src/test/datascience/notebook/intellisense/semanticTokens.vscode.test.ts +++ b/src/test/datascience/notebook/intellisense/semanticTokens.vscode.test.ts @@ -5,9 +5,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { commands, Position, window } from 'vscode'; -import { IVSCodeNotebook } from '../../../../client/common/application/types'; -import { traceInfo } from '../../../../client/common/logger'; -import { IDisposable } from '../../../../client/common/types'; +import { IVSCodeNotebook } from '../../../../platform/common/application/types'; +import { traceInfo } from '../../../../platform/common/logger'; +import { IDisposable } from '../../../../platform/common/types'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../../../common'; import { IS_REMOTE_NATIVE_TEST } from '../../../constants'; import { initialize } from '../../../initialize'; diff --git a/src/test/datascience/notebook/interruptRestart.vscode.test.ts b/src/test/datascience/notebook/interruptRestart.vscode.test.ts index 548d339304d..dfac0920052 100644 --- a/src/test/datascience/notebook/interruptRestart.vscode.test.ts +++ b/src/test/datascience/notebook/interruptRestart.vscode.test.ts @@ -6,12 +6,12 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { commands, NotebookCellExecutionState, NotebookEditor as VSCNotebookEditor } from 'vscode'; -import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IConfigurationService, IDisposable, IJupyterSettings, ReadWrite } from '../../../client/common/types'; -import { noop } from '../../../client/common/utils/misc'; -import { Commands } from '../../../client/datascience/constants'; -import { IKernelProvider } from '../../../client/../kernels/types'; +import { IApplicationShell, ICommandManager, IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IConfigurationService, IDisposable, IJupyterSettings, ReadWrite } from '../../../platform/common/types'; +import { noop } from '../../../platform/common/utils/misc'; +import { Commands } from '../../../platform/datascience/constants'; +import { IKernelProvider } from '../../../platform/../kernels/types'; import { captureScreenShot, createEventHandler, IExtensionTestApi, sleep, waitForCondition } from '../../common'; import { IS_NON_RAW_NATIVE_TEST, IS_REMOTE_NATIVE_TEST } from '../../constants'; import { initialize } from '../../initialize'; diff --git a/src/test/datascience/notebook/ipywidget.vscode.test.ts b/src/test/datascience/notebook/ipywidget.vscode.test.ts index 9c8464a489a..74eda03240f 100644 --- a/src/test/datascience/notebook/ipywidget.vscode.test.ts +++ b/src/test/datascience/notebook/ipywidget.vscode.test.ts @@ -8,8 +8,8 @@ import * as path from 'path'; import * as sinon from 'sinon'; import { assert } from 'chai'; import { NotebookDocument, Uri, window } from 'vscode'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { IDisposable } from '../../../client/common/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { IDisposable } from '../../../platform/common/types'; import { IExtensionTestApi } from '../../common'; import { initialize } from '../../initialize'; import { openNotebook } from '../helpers'; @@ -22,8 +22,8 @@ import { waitForKernelToGetAutoSelected } from './helper'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants'; -import { createDeferred, Deferred } from '../../../client/common/utils/async'; -import { InteractiveWindowMessages } from '../../../extension/messageTypes'; +import { createDeferred, Deferred } from '../../../platform/common/utils/async'; +import { InteractiveWindowMessages } from '../../../platform/messageTypes'; import { NotebookIPyWidgetCoordinator } from '../../../kernels/ipywidgets-message-coordination/notebookIPyWidgetCoordinator'; import { INotebookCommunication } from '../../../notebooks/types'; diff --git a/src/test/datascience/notebook/kernelCrashes.vscode.test.ts b/src/test/datascience/notebook/kernelCrashes.vscode.test.ts index ad01ec47f87..e60d28edac7 100644 --- a/src/test/datascience/notebook/kernelCrashes.vscode.test.ts +++ b/src/test/datascience/notebook/kernelCrashes.vscode.test.ts @@ -8,10 +8,10 @@ import * as path from 'path'; import * as fs from 'fs-extra'; import { assert } from 'chai'; import * as sinon from 'sinon'; -import { DataScience } from '../../../client/common/utils/localize'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IConfigurationService, IDisposable, IJupyterSettings, ReadWrite } from '../../../client/common/types'; +import { DataScience } from '../../../platform/common/utils/localize'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IConfigurationService, IDisposable, IJupyterSettings, ReadWrite } from '../../../platform/common/types'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../../common'; import { initialize } from '../../initialize'; import { @@ -31,13 +31,13 @@ import { } from './helper'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_NON_RAW_NATIVE_TEST, IS_REMOTE_NATIVE_TEST } from '../../constants'; import * as dedent from 'dedent'; -import { IKernelProvider } from '../../../client/../kernels/types'; -import { createDeferred } from '../../../client/common/utils/async'; +import { IKernelProvider } from '../../../platform/../kernels/types'; +import { createDeferred } from '../../../platform/common/utils/async'; import { sleep } from '../../core'; -import { getDisplayNameOrNameOfKernelConnection } from '../../../client/../kernels/helpers'; -import { INotebookEditorProvider } from '../../../client/datascience/types'; +import { getDisplayNameOrNameOfKernelConnection } from '../../../platform/../kernels/helpers'; +import { INotebookEditorProvider } from '../../../platform/datascience/types'; import { Uri, window, workspace } from 'vscode'; -import { getDisplayPath } from '../../../client/common/platform/fs-paths'; +import { getDisplayPath } from '../../../platform/common/platform/fs-paths'; import { translateCellErrorOutput } from '../../../notebooks/helpers'; const codeToKillKernel = dedent` diff --git a/src/test/datascience/notebook/kernelRefresh.vscode.test.ts b/src/test/datascience/notebook/kernelRefresh.vscode.test.ts index e107a8fb57c..f59eaca0138 100644 --- a/src/test/datascience/notebook/kernelRefresh.vscode.test.ts +++ b/src/test/datascience/notebook/kernelRefresh.vscode.test.ts @@ -7,8 +7,8 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import { window } from 'vscode'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../../common'; import { initialize } from '../../initialize'; import { @@ -23,7 +23,7 @@ import { defaultNotebookTestTimeout } from './helper'; import { IS_CONDA_TEST } from '../../constants'; -import { EnvironmentType } from '../../../client/pythonEnvironments/info'; +import { EnvironmentType } from '../../../platform/pythonEnvironments/info'; import { JupyterNotebookView } from '../../../notebooks/constants'; import { INotebookControllerManager } from '../../../notebooks/types'; diff --git a/src/test/datascience/notebook/kernelSelection.vscode.test.ts b/src/test/datascience/notebook/kernelSelection.vscode.test.ts index a72d6f65b61..dc536d58c81 100644 --- a/src/test/datascience/notebook/kernelSelection.vscode.test.ts +++ b/src/test/datascience/notebook/kernelSelection.vscode.test.ts @@ -6,14 +6,17 @@ import * as fs from 'fs-extra'; import * as path from 'path'; import * as sinon from 'sinon'; import { commands, window } from 'vscode'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { BufferDecoder } from '../../../client/common/process/decoder'; -import { ProcessService } from '../../../client/common/process/proc'; -import { IDisposable } from '../../../client/common/types'; -import { IKernelProvider } from '../../../client/../kernels/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { getInterpreterHash, getNormalizedInterpreterPath } from '../../../client/pythonEnvironments/info/interpreter'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { BufferDecoder } from '../../../platform/common/process/decoder'; +import { ProcessService } from '../../../platform/common/process/proc'; +import { IDisposable } from '../../../platform/common/types'; +import { IKernelProvider } from '../../../platform/../kernels/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { + getInterpreterHash, + getNormalizedInterpreterPath +} from '../../../platform/pythonEnvironments/info/interpreter'; import { createEventHandler, getOSType, IExtensionTestApi, OSType, waitForCondition } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST } from '../../constants'; import { closeActiveWindows, initialize, IS_CI_SERVER } from '../../initialize'; diff --git a/src/test/datascience/notebook/kernelSysPath.vscode.test.ts b/src/test/datascience/notebook/kernelSysPath.vscode.test.ts index d8fb480d477..6f85dd996e1 100644 --- a/src/test/datascience/notebook/kernelSysPath.vscode.test.ts +++ b/src/test/datascience/notebook/kernelSysPath.vscode.test.ts @@ -5,13 +5,13 @@ import * as fs from 'fs-extra'; import * as path from 'path'; import * as sinon from 'sinon'; import { assert } from 'chai'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { BufferDecoder } from '../../../client/common/process/decoder'; -import { ProcessService } from '../../../client/common/process/proc'; -import { IDisposable } from '../../../client/common/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { BufferDecoder } from '../../../platform/common/process/decoder'; +import { ProcessService } from '../../../platform/common/process/proc'; +import { IDisposable } from '../../../platform/common/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { getOSType, IExtensionTestApi, OSType } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST } from '../../constants'; import { initialize, IS_CI_SERVER } from '../../initialize'; @@ -25,7 +25,7 @@ import { waitForKernelToChange, waitForCellHavingOutput } from './helper'; -import { traceInfoIfCI } from '../../../client/common/logger'; +import { traceInfoIfCI } from '../../../platform/common/logger'; /* eslint-disable no-invalid-this, , , @typescript-eslint/no-explicit-any */ suite('sys.path in Python Kernels', function () { diff --git a/src/test/datascience/notebook/memory.vscode.test.ts b/src/test/datascience/notebook/memory.vscode.test.ts index e1b8810102e..7847ae31340 100644 --- a/src/test/datascience/notebook/memory.vscode.test.ts +++ b/src/test/datascience/notebook/memory.vscode.test.ts @@ -10,9 +10,9 @@ import * as v8 from 'v8'; import * as path from 'path'; import * as sinon from 'sinon'; import * as vscode from 'vscode'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, initialize } from '../../initialize'; import { diff --git a/src/test/datascience/notebook/nonPythonKernels.vscode.test.ts b/src/test/datascience/notebook/nonPythonKernels.vscode.test.ts index 87e639d0b5c..874cecebb67 100644 --- a/src/test/datascience/notebook/nonPythonKernels.vscode.test.ts +++ b/src/test/datascience/notebook/nonPythonKernels.vscode.test.ts @@ -8,11 +8,11 @@ import * as path from 'path'; import * as sinon from 'sinon'; import * as assert from 'assert'; import { Uri } from 'vscode'; -import { IPythonExtensionChecker } from '../../../client/api/types'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; -import { INotebookEditorProvider } from '../../../client/datascience/types'; +import { IPythonExtensionChecker } from '../../../platform/api/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; +import { INotebookEditorProvider } from '../../../platform/datascience/types'; import { IExtensionTestApi, waitForCondition } from '../../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST, IS_NON_RAW_NATIVE_TEST } from '../../constants'; import { initialize } from '../../initialize'; @@ -31,7 +31,7 @@ import { workAroundVSCodeNotebookStartPages, waitForTextOutput } from './helper'; -import { PythonExtensionChecker } from '../../../client/api/pythonApi'; +import { PythonExtensionChecker } from '../../../platform/api/pythonApi'; import { NotebookCellLanguageService } from '../../../intellisense/cellLanguageService'; /* eslint-disable @typescript-eslint/no-explicit-any, no-invalid-this */ diff --git a/src/test/datascience/notebook/notebookControllerManager.unit.test.ts b/src/test/datascience/notebook/notebookControllerManager.unit.test.ts index 11de659c8b4..0eb717c883d 100644 --- a/src/test/datascience/notebook/notebookControllerManager.unit.test.ts +++ b/src/test/datascience/notebook/notebookControllerManager.unit.test.ts @@ -3,9 +3,9 @@ import { assert } from 'chai'; import { when, instance, mock } from 'ts-mockito'; -import { getDisplayNameOrNameOfKernelConnection } from '../../../client/../kernels/helpers'; -import { IJupyterKernelSpec } from '../../../client/datascience/types'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { getDisplayNameOrNameOfKernelConnection } from '../../../platform/../kernels/helpers'; +import { IJupyterKernelSpec } from '../../../platform/datascience/types'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; suite('Notebook Controller Manager', () => { test('Live kernels should display the name`', () => { diff --git a/src/test/datascience/notebook/outputDisplayOrder.vscode.test.ts b/src/test/datascience/notebook/outputDisplayOrder.vscode.test.ts index 2923f83b81b..3cfcac05d0f 100644 --- a/src/test/datascience/notebook/outputDisplayOrder.vscode.test.ts +++ b/src/test/datascience/notebook/outputDisplayOrder.vscode.test.ts @@ -6,7 +6,7 @@ /* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ import * as path from 'path'; import { assert } from 'chai'; -import { traceInfo } from '../../../client/common/logger'; +import { traceInfo } from '../../../platform/common/logger'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../../constants'; import { openNotebook } from '../helpers'; import { closeNotebooksAndCleanUpAfterTests } from './helper'; diff --git a/src/test/datascience/notebook/remoteNotebookEditor.vscode.test.ts b/src/test/datascience/notebook/remoteNotebookEditor.vscode.test.ts index 837ab32a396..e975fe257ba 100644 --- a/src/test/datascience/notebook/remoteNotebookEditor.vscode.test.ts +++ b/src/test/datascience/notebook/remoteNotebookEditor.vscode.test.ts @@ -8,9 +8,9 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; import * as path from 'path'; import { commands, Memento, Uri } from 'vscode'; -import { IEncryptedStorage, IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo, traceInfoIfCI } from '../../../client/common/logger'; -import { GLOBAL_MEMENTO, IDisposable, IMemento } from '../../../client/common/types'; +import { IEncryptedStorage, IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo, traceInfoIfCI } from '../../../platform/common/logger'; +import { GLOBAL_MEMENTO, IDisposable, IMemento } from '../../../platform/common/types'; import { IExtensionTestApi, waitForCondition } from '../../common'; import { closeActiveWindows, EXTENSION_ROOT_DIR_FOR_TESTS, initialize, IS_REMOTE_NATIVE_TEST } from '../../initialize'; import { @@ -29,9 +29,9 @@ import { createEmptyPythonNotebook } from './helper'; import { openNotebook } from '../helpers'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { Settings } from '../../../client/datascience/constants'; -import { RemoteKernelSpecConnectionMetadata } from '../../../client/../kernels/types'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { Settings } from '../../../platform/datascience/constants'; +import { RemoteKernelSpecConnectionMetadata } from '../../../platform/../kernels/types'; import { JupyterServer } from '../jupyterServer'; import { JVSC_EXTENSION_ID_FOR_TESTS } from '../../constants'; import { JupyterServerSelector } from '../../../kernels/jupyter/serverSelector'; diff --git a/src/test/datascience/notebook/saving.vscode.test.ts b/src/test/datascience/notebook/saving.vscode.test.ts index 54cf24619ea..9a5a2c29f52 100644 --- a/src/test/datascience/notebook/saving.vscode.test.ts +++ b/src/test/datascience/notebook/saving.vscode.test.ts @@ -8,10 +8,10 @@ import { assert, expect } from 'chai'; import * as path from 'path'; import * as sinon from 'sinon'; import { NotebookCell, Uri } from 'vscode'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { PYTHON_LANGUAGE } from '../../../client/common/constants'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { PYTHON_LANGUAGE } from '../../../platform/common/constants'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; import { IExtensionTestApi, waitForCondition } from '../../common'; import { IS_REMOTE_NATIVE_TEST } from '../../constants'; import { closeActiveWindows, EXTENSION_ROOT_DIR_FOR_TESTS, initialize } from '../../initialize'; diff --git a/src/test/datascience/notebook/thirdPartyKernels.vscode.test.ts b/src/test/datascience/notebook/thirdPartyKernels.vscode.test.ts index 08f51179002..f715a5b758f 100644 --- a/src/test/datascience/notebook/thirdPartyKernels.vscode.test.ts +++ b/src/test/datascience/notebook/thirdPartyKernels.vscode.test.ts @@ -8,14 +8,14 @@ // import * as sinon from 'sinon'; // import { commands, notebook, NotebookController, workspace, WorkspaceEdit } from 'vscode'; // import { boolean } from 'yargs'; -// import { IPythonExtensionChecker } from '../../../client/api/types'; -// import { IVSCodeNotebook } from '../../../client/common/application/types'; -// import { BufferDecoder } from '../../../client/common/process/decoder'; -// import { ProcessService } from '../../../client/common/process/proc'; -// import { IDisposable } from '../../../client/common/types'; +// import { IPythonExtensionChecker } from '../../../platform/api/types'; +// import { IVSCodeNotebook } from '../../../platform/common/application/types'; +// import { BufferDecoder } from '../../../platform/common/process/decoder'; +// import { ProcessService } from '../../../platform/common/process/proc'; +// import { IDisposable } from '../../../platform/common/types'; // import { JupyterNotebookView } from '../../../notebooks/constants'; // import { getTextOutputValue } from '../../../notebooks/helpers'; -// import { IInterpreterService } from '../../../client/interpreter/contracts'; +// import { IInterpreterService } from '../../../platform/interpreter/contracts'; // import { getOSType, IExtensionTestApi, OSType, waitForCondition } from '../../common'; // import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST } from '../../constants'; // import { closeActiveWindows, initialize, IS_CI_SERVER } from '../../initialize'; diff --git a/src/test/datascience/notebookServerProvider.vscode.test.ts b/src/test/datascience/notebookServerProvider.vscode.test.ts index 315bb1b7b34..dae44d06507 100644 --- a/src/test/datascience/notebookServerProvider.vscode.test.ts +++ b/src/test/datascience/notebookServerProvider.vscode.test.ts @@ -5,19 +5,19 @@ import { assert } from 'chai'; import { Disposable, CancellationTokenSource } from 'vscode'; -import { traceInfo } from '../../client/common/logger'; -import { DisplayOptions } from '../../client/datascience/displayOptions'; -import { IJupyterExecution, IJupyterServerProvider } from '../../client/datascience/types'; +import { traceInfo } from '../../platform/common/logger'; +import { DisplayOptions } from '../../platform/datascience/displayOptions'; +import { IJupyterExecution, IJupyterServerProvider } from '../../platform/datascience/types'; import { IS_NON_RAW_NATIVE_TEST } from '../constants'; import { initialize } from '../initialize'; import { closeNotebooksAndCleanUpAfterTests, startJupyterServer } from './notebook/helper'; import * as getFreePort from 'get-port'; -import { IPythonExecutionFactory } from '../../client/common/process/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { IConfigurationService } from '../../client/common/types'; -import { JupyterSettings } from '../../client/common/configSettings'; -import { IServiceContainer } from '../../client/ioc/types'; +import { IPythonExecutionFactory } from '../../platform/common/process/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { IConfigurationService } from '../../platform/common/types'; +import { JupyterSettings } from '../../platform/common/configSettings'; +import { IServiceContainer } from '../../platform/ioc/types'; import { HostJupyterExecution } from '../../kernels/jupyter/launcher/liveshare/hostJupyterExecution'; import { NotebookServerProvider } from '../../kernels/jupyter/launcher/notebookServerProvider'; diff --git a/src/test/datascience/plotViewer.functional.test.tsx b/src/test/datascience/plotViewer.functional.test.tsx index a66fad1912a..737ce4f4b26 100644 --- a/src/test/datascience/plotViewer.functional.test.tsx +++ b/src/test/datascience/plotViewer.functional.test.tsx @@ -8,7 +8,7 @@ suite('Dummy10', () => { }); }); // /* eslint-disable , comma-dangle, @typescript-eslint/no-explicit-any, no-multi-str */ -// import '../../client/common/extensions'; +// import '../../platform/common/extensions'; // import * as assert from 'assert'; // import { ComponentClass, mount, ReactWrapper } from 'enzyme'; @@ -16,7 +16,7 @@ suite('Dummy10', () => { // import * as React from 'react'; // import { Disposable } from 'vscode'; -// import { IPlotViewerProvider } from '../../client/datascience/types'; +// import { IPlotViewerProvider } from '../../platform/datascience/types'; // import { MainPanel } from '../../datascience-ui/plot/mainPanel'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; diff --git a/src/test/datascience/plotViewer/plotViewer.vscode.test.ts b/src/test/datascience/plotViewer/plotViewer.vscode.test.ts index cb1eeeb5aef..ac9072558c9 100644 --- a/src/test/datascience/plotViewer/plotViewer.vscode.test.ts +++ b/src/test/datascience/plotViewer/plotViewer.vscode.test.ts @@ -5,9 +5,9 @@ import { assert } from 'chai'; import * as vscode from 'vscode'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; import { createJupyterCellFromVSCNotebookCell } from '../../../notebooks/helpers'; import { IExtensionTestApi, waitForCondition } from '../../common'; import { closeActiveWindows, initialize } from '../../initialize'; diff --git a/src/test/datascience/preWarmVariables.unit.test.ts b/src/test/datascience/preWarmVariables.unit.test.ts index eff6283c2cf..8b110ff6488 100644 --- a/src/test/datascience/preWarmVariables.unit.test.ts +++ b/src/test/datascience/preWarmVariables.unit.test.ts @@ -5,16 +5,16 @@ import { anything, instance, mock, verify, when } from 'ts-mockito'; import { EventEmitter } from 'vscode'; -import { IExtensionSingleActivationService } from '../../client/activation/types'; -import { PythonExtensionChecker } from '../../client/api/pythonApi'; -import { IPythonApiProvider, IPythonExtensionChecker } from '../../client/api/types'; -import { IWorkspaceService } from '../../client/common/application/types'; -import { CondaService } from '../../client/common/process/condaService'; -import { createDeferred } from '../../client/common/utils/async'; -import { IEnvironmentVariablesProvider } from '../../client/common/variables/types'; -import { IRawNotebookSupportedService } from '../../client/datascience/types'; -import { IEnvironmentActivationService } from '../../client/interpreter/activation/types'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +import { IExtensionSingleActivationService } from '../../platform/activation/types'; +import { PythonExtensionChecker } from '../../platform/api/pythonApi'; +import { IPythonApiProvider, IPythonExtensionChecker } from '../../platform/api/types'; +import { IWorkspaceService } from '../../platform/common/application/types'; +import { CondaService } from '../../platform/common/process/condaService'; +import { createDeferred } from '../../platform/common/utils/async'; +import { IEnvironmentVariablesProvider } from '../../platform/common/variables/types'; +import { IRawNotebookSupportedService } from '../../platform/datascience/types'; +import { IEnvironmentActivationService } from '../../platform/interpreter/activation/types'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; import { JupyterInterpreterService } from '../../kernels/jupyter/interpreter/jupyterInterpreterService'; import { PreWarmActivatedJupyterEnvironmentVariables } from '../../kernels/variables/preWarmVariables'; import { sleep } from '../core'; diff --git a/src/test/datascience/progress/decorators.unit.test.ts b/src/test/datascience/progress/decorators.unit.test.ts index 099fd7fdf7c..613d3a00910 100644 --- a/src/test/datascience/progress/decorators.unit.test.ts +++ b/src/test/datascience/progress/decorators.unit.test.ts @@ -4,14 +4,14 @@ 'use strict'; import { anything, deepEqual, instance, mock, verify } from 'ts-mockito'; -import { createDeferred } from '../../../client/common/utils/async'; +import { createDeferred } from '../../../platform/common/utils/async'; import { disposeRegisteredReporters, registerReporter, reportAction -} from '../../../client/datascience/progress/decorator'; -import { ProgressReporter } from '../../../client/datascience/progress/progressReporter'; -import { IProgressReporter, ReportableAction } from '../../../client/datascience/progress/types'; +} from '../../../platform/datascience/progress/decorator'; +import { ProgressReporter } from '../../../platform/datascience/progress/progressReporter'; +import { IProgressReporter, ReportableAction } from '../../../platform/datascience/progress/types'; import { noop } from '../../core'; suite('DataScience - Progress Reporter Decorator', () => { diff --git a/src/test/datascience/progress/progressReporter.unit.test.ts b/src/test/datascience/progress/progressReporter.unit.test.ts index 3227d3fab32..0c724452df2 100644 --- a/src/test/datascience/progress/progressReporter.unit.test.ts +++ b/src/test/datascience/progress/progressReporter.unit.test.ts @@ -6,11 +6,11 @@ import { assert } from 'chai'; import { anything, instance, mock, verify, when } from 'ts-mockito'; import { CancellationToken, CancellationTokenSource, Progress as VSCProgress } from 'vscode'; -import { ApplicationShell } from '../../../client/common/application/applicationShell'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { getUserMessageForAction } from '../../../client/datascience/progress/messages'; -import { ProgressReporter } from '../../../client/datascience/progress/progressReporter'; -import { ReportableAction } from '../../../client/datascience/progress/types'; +import { ApplicationShell } from '../../../platform/common/application/applicationShell'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { getUserMessageForAction } from '../../../platform/datascience/progress/messages'; +import { ProgressReporter } from '../../../platform/datascience/progress/progressReporter'; +import { ReportableAction } from '../../../platform/datascience/progress/types'; import { noop, sleep } from '../../core'; type Task = ( progress: VSCProgress<{ message?: string; increment?: number }>, diff --git a/src/test/datascience/raw-kernel/rawKernel.functional.test.ts b/src/test/datascience/raw-kernel/rawKernel.functional.test.ts index 0f90d905492..85559d4316f 100644 --- a/src/test/datascience/raw-kernel/rawKernel.functional.test.ts +++ b/src/test/datascience/raw-kernel/rawKernel.functional.test.ts @@ -11,16 +11,16 @@ suite('Dummy13', () => { // import { noop } from 'jquery'; // import * as portfinder from 'portfinder'; // import * as uuid from 'uuid/v4'; -// import { IPythonExtensionChecker } from '../../../client/api/types'; -// import { IFileSystem } from '../../../client/common/platform/types'; -// import { IProcessServiceFactory } from '../../../client/common/process/types'; -// import { createDeferred, sleep } from '../../../client/common/utils/async'; -// import { KernelDaemonPool } from '../../../client/datascience/kernel-launcher/kernelDaemonPool'; -// import { KernelEnvironmentVariablesService } from '../../../client/datascience/kernel-launcher/kernelEnvVarsService'; -// import { KernelProcess } from '../../../client/datascience/kernel-launcher/kernelProcess'; -// import { createRawKernel, RawKernel } from '../../../client/datascience/raw-kernel/rawKernel'; -// import { IJupyterKernelSpec } from '../../../client/datascience/types'; -// import { IInterpreterService } from '../../../client/interpreter/contracts'; +// import { IPythonExtensionChecker } from '../../../platform/api/types'; +// import { IFileSystem } from '../../../platform/common/platform/types'; +// import { IProcessServiceFactory } from '../../../platform/common/process/types'; +// import { createDeferred, sleep } from '../../../platform/common/utils/async'; +// import { KernelDaemonPool } from '../../../platform/datascience/kernel-launcher/kernelDaemonPool'; +// import { KernelEnvironmentVariablesService } from '../../../platform/datascience/kernel-launcher/kernelEnvVarsService'; +// import { KernelProcess } from '../../../platform/datascience/kernel-launcher/kernelProcess'; +// import { createRawKernel, RawKernel } from '../../../platform/datascience/raw-kernel/rawKernel'; +// import { IJupyterKernelSpec } from '../../../platform/datascience/types'; +// import { IInterpreterService } from '../../../platform/interpreter/contracts'; // import { DataScienceIocContainer } from '../dataScienceIocContainer'; // import { requestExecute, requestInspect } from './rawKernelTestHelpers'; diff --git a/src/test/datascience/raw-kernel/rawKernelTestHelpers.ts b/src/test/datascience/raw-kernel/rawKernelTestHelpers.ts index 9971943ed1e..66f0578b0a2 100644 --- a/src/test/datascience/raw-kernel/rawKernelTestHelpers.ts +++ b/src/test/datascience/raw-kernel/rawKernelTestHelpers.ts @@ -3,7 +3,7 @@ 'use strict'; import { KernelMessage } from '@jupyterlab/services'; import { JSONObject } from '@lumino/coreutils'; -import { createDeferred, Deferred } from '../../../client/common/utils/async'; +import { createDeferred, Deferred } from '../../../platform/common/utils/async'; import { RawKernel } from '../../../kernels/raw/session/rawKernel'; /* eslint-disable @typescript-eslint/no-explicit-any */ diff --git a/src/test/datascience/reactHelpers.ts b/src/test/datascience/reactHelpers.ts index 1785c116c2b..c70f886dc90 100644 --- a/src/test/datascience/reactHelpers.ts +++ b/src/test/datascience/reactHelpers.ts @@ -56,7 +56,7 @@ import { configure } from 'enzyme'; import * as Adapter from 'enzyme-adapter-react-16'; import { DOMWindow, JSDOM } from 'jsdom'; -import { noop } from '../../client/common/utils/misc'; +import { noop } from '../../platform/common/utils/misc'; class MockCanvas implements CanvasRenderingContext2D { public canvas!: HTMLCanvasElement; diff --git a/src/test/datascience/shiftEnterBanner.unit.test.ts b/src/test/datascience/shiftEnterBanner.unit.test.ts index 1dd23471d3d..489e199b95a 100644 --- a/src/test/datascience/shiftEnterBanner.unit.test.ts +++ b/src/test/datascience/shiftEnterBanner.unit.test.ts @@ -6,16 +6,19 @@ import { expect } from 'chai'; import rewiremock from 'rewiremock'; import * as typemoq from 'typemoq'; -import { IApplicationShell } from '../../client/common/application/types'; +import { IApplicationShell } from '../../platform/common/application/types'; import { IConfigurationService, IPersistentState, IPersistentStateFactory, IWatchableJupyterSettings -} from '../../client/common/types'; -import { Telemetry } from '../../client/datascience/constants'; -import { InteractiveShiftEnterBanner, InteractiveShiftEnterStateKeys } from '../../client/datascience/shiftEnterBanner'; -import { clearTelemetryReporter } from '../../client/telemetry'; +} from '../../platform/common/types'; +import { Telemetry } from '../../platform/datascience/constants'; +import { + InteractiveShiftEnterBanner, + InteractiveShiftEnterStateKeys +} from '../../platform/datascience/shiftEnterBanner'; +import { clearTelemetryReporter } from '../../telemetry'; suite('Interactive Shift Enter Banner', () => { const oldValueOfVSC_JUPYTER_UNIT_TEST = process.env.VSC_JUPYTER_UNIT_TEST; diff --git a/src/test/datascience/testInteractiveWindowProvider.ts b/src/test/datascience/testInteractiveWindowProvider.ts index 46bff4d2987..e882b9dd905 100644 --- a/src/test/datascience/testInteractiveWindowProvider.ts +++ b/src/test/datascience/testInteractiveWindowProvider.ts @@ -4,8 +4,8 @@ // import { inject, injectable, named } from 'inversify'; // import * as uuid from 'uuid/v4'; // import { Memento, Uri } from 'vscode'; -// import * as types from '../../client/common/application/types'; -// import { IFileSystem } from '../../client/common/platform/types'; +// import * as types from '../../platform/common/application/types'; +// import { IFileSystem } from '../../platform/common/platform/types'; // import { // GLOBAL_MEMENTO, // IAsyncDisposableRegistry, @@ -14,13 +14,13 @@ // IMemento, // InteractiveWindowMode, // Resource -// } from '../../client/common/types'; -// import { createDeferred, Deferred } from '../../client/common/utils/async'; -// import { resetIdentity } from '../../client/datascience/interactive-window/identity'; -// import { InteractiveWindow } from '../../client/datascience/interactive-window/interactiveWindow'; -// import { InteractiveWindowProvider } from '../../client/datascience/interactive-window/interactiveWindowProvider'; -// import { IInteractiveWindow, IInteractiveWindowProvider } from '../../client/datascience/types'; -// import { IServiceContainer } from '../../client/ioc/types'; +// } from '../../platform/common/types'; +// import { createDeferred, Deferred } from '../../platform/common/utils/async'; +// import { resetIdentity } from '../../platform/datascience/interactive-window/identity'; +// import { InteractiveWindow } from '../../platform/datascience/interactive-window/interactiveWindow'; +// import { InteractiveWindowProvider } from '../../platform/datascience/interactive-window/interactiveWindowProvider'; +// import { IInteractiveWindow, IInteractiveWindowProvider } from '../../platform/datascience/types'; +// import { IServiceContainer } from '../../platform/ioc/types'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; // import { IMountedWebView } from './mountedWebView'; // import { WaitForMessageOptions } from './uiTests/helpers'; diff --git a/src/test/datascience/testNativeEditorProvider.ts b/src/test/datascience/testNativeEditorProvider.ts index f0a5754c02e..84aaf47e908 100644 --- a/src/test/datascience/testNativeEditorProvider.ts +++ b/src/test/datascience/testNativeEditorProvider.ts @@ -6,12 +6,12 @@ export const __ = ''; // import * as uuid from 'uuid/v4'; // import { CustomDocument, Uri, WebviewPanel } from 'vscode'; -// import { ICommandManager, IDocumentManager, IWorkspaceService } from '../../client/common/application/types'; -// import { IFileSystem } from '../../client/common/platform/types'; -// import { IAsyncDisposableRegistry, IConfigurationService, IDisposableRegistry } from '../../client/common/types'; -// import { createDeferred, Deferred } from '../../client/common/utils/async'; -// import { NativeEditor } from '../../client/datascience/interactive-ipynb/nativeEditor'; -// import { NativeEditorProviderOld } from '../../client/datascience/interactive-ipynb/nativeEditorProviderOld'; +// import { ICommandManager, IDocumentManager, IWorkspaceService } from '../../platform/common/application/types'; +// import { IFileSystem } from '../../platform/common/platform/types'; +// import { IAsyncDisposableRegistry, IConfigurationService, IDisposableRegistry } from '../../platform/common/types'; +// import { createDeferred, Deferred } from '../../platform/common/utils/async'; +// import { NativeEditor } from '../../platform/datascience/interactive-ipynb/nativeEditor'; +// import { NativeEditorProviderOld } from '../../platform/datascience/interactive-ipynb/nativeEditorProviderOld'; // import { NativeEditorProvider } from '../../notebooksStorage/nativeEditorProvider'; // import { NativeEditorNotebookModel } from '../../notebooksStorage/notebookModel'; // import { INotebookStorageProvider } from '../../notebooksStorage/notebookStorageProvider'; @@ -20,8 +20,8 @@ export const __ = ''; // INotebookEditor, // INotebookEditorProvider, // INotebookProvider -// } from '../../client/datascience/types'; -// import { ClassType, IServiceContainer } from '../../client/ioc/types'; +// } from '../../platform/datascience/types'; +// import { ClassType, IServiceContainer } from '../../platform/ioc/types'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; // import { IMountedWebView, WaitForMessageOptions } from './mountedWebView'; // import { mountConnectedMainPanel } from './testHelpers'; diff --git a/src/test/datascience/testPersistentStateFactory.ts b/src/test/datascience/testPersistentStateFactory.ts index d06bfe06782..c854f315926 100644 --- a/src/test/datascience/testPersistentStateFactory.ts +++ b/src/test/datascience/testPersistentStateFactory.ts @@ -1,6 +1,6 @@ import { Memento } from 'vscode'; -import { PersistentStateFactory } from '../../client/common/persistentState'; -import { IPersistentState, IPersistentStateFactory } from '../../client/common/types'; +import { PersistentStateFactory } from '../../platform/common/persistentState'; +import { IPersistentState, IPersistentStateFactory } from '../../platform/common/types'; const PrefixesToStore = ['INTERPRETERS_CACHE']; diff --git a/src/test/datascience/variableTestHelpers.ts b/src/test/datascience/variableTestHelpers.ts index 9f7bd6c17f3..3c2db758f50 100644 --- a/src/test/datascience/variableTestHelpers.ts +++ b/src/test/datascience/variableTestHelpers.ts @@ -7,16 +7,16 @@ // import * as React from 'react'; // import { Uri } from 'vscode'; -// import { IDocumentManager } from '../../client/common/application/types'; -// import { createDeferred } from '../../client/common/utils/async'; -// import { Identifiers } from '../../client/datascience/constants'; -// import { getDefaultInteractiveIdentity } from '../../client/datascience/interactive-window/identity'; +// import { IDocumentManager } from '../../platform/common/application/types'; +// import { createDeferred } from '../../platform/common/utils/async'; +// import { Identifiers } from '../../platform/datascience/constants'; +// import { getDefaultInteractiveIdentity } from '../../platform/datascience/interactive-window/identity'; // import { // IJupyterDebugService, // IJupyterVariable, // IJupyterVariables, // INotebookProvider -// } from '../../client/datascience/types'; +// } from '../../platform/datascience/types'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; // import { MockDocumentManager } from './mockDocumentManager'; // import { waitForVariablesUpdated } from './testHelpers'; diff --git a/src/test/datascience/variableView/variableView.vscode.test.ts b/src/test/datascience/variableView/variableView.vscode.test.ts index 0e09c7756c8..8f0c557d584 100644 --- a/src/test/datascience/variableView/variableView.vscode.test.ts +++ b/src/test/datascience/variableView/variableView.vscode.test.ts @@ -3,10 +3,10 @@ 'use strict'; import { assert } from 'chai'; import * as sinon from 'sinon'; -import { ICommandManager, IVSCodeNotebook } from '../../../client/common/application/types'; -import { IDisposable } from '../../../client/common/types'; -import { Commands } from '../../../client/datascience/constants'; -import { IVariableViewProvider } from '../../../client/datascience/variablesView/types'; +import { ICommandManager, IVSCodeNotebook } from '../../../platform/common/application/types'; +import { IDisposable } from '../../../platform/common/types'; +import { Commands } from '../../../platform/datascience/constants'; +import { IVariableViewProvider } from '../../../platform/datascience/variablesView/types'; import { IExtensionTestApi, waitForCondition } from '../../common'; import { initialize, IS_REMOTE_NATIVE_TEST } from '../../initialize'; import { @@ -22,10 +22,10 @@ import { import { waitForVariablesToMatch } from './variableViewHelpers'; import { ITestVariableViewProvider } from './variableViewTestInterfaces'; import { ITestWebviewHost } from '../testInterfaces'; -import { traceInfo } from '../../../client/common/logger'; -import { DataViewer } from '../../../client/datascience/data-viewing/dataViewer'; -import { PythonEnvironment } from '../../../client/pythonEnvironments/info'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; +import { traceInfo } from '../../../platform/common/logger'; +import { DataViewer } from '../../../platform/datascience/data-viewing/dataViewer'; +import { PythonEnvironment } from '../../../platform/pythonEnvironments/info'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; suite('DataScience - VariableView', function () { let api: IExtensionTestApi; diff --git a/src/test/datascience/variableView/variableViewTestInterfaces.ts b/src/test/datascience/variableView/variableViewTestInterfaces.ts index bdc793e017b..db78447fc05 100644 --- a/src/test/datascience/variableView/variableViewTestInterfaces.ts +++ b/src/test/datascience/variableView/variableViewTestInterfaces.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. 'use strict'; -import { IVariableViewProvider } from '../../../client/datascience/variablesView/types'; -import { VariableView } from '../../../client/datascience/variablesView/variableView'; +import { IVariableViewProvider } from '../../../platform/datascience/variablesView/types'; +import { VariableView } from '../../../platform/datascience/variablesView/variableView'; export interface ITestVariableViewProvider extends IVariableViewProvider { readonly activeVariableView: Promise; diff --git a/src/test/datascience/variableexplorer.functional.test.tsx b/src/test/datascience/variableexplorer.functional.test.tsx index b51ba546c81..ade29d44121 100644 --- a/src/test/datascience/variableexplorer.functional.test.tsx +++ b/src/test/datascience/variableexplorer.functional.test.tsx @@ -14,9 +14,9 @@ suite('Dummy11', () => { // import * as React from 'react'; // import * as AdazzleReactDataGrid from 'react-data-grid'; // import { Disposable } from 'vscode'; -// import { sleep } from '../../client/common/utils/async'; -// import { InteractiveWindowMessages } from '../../client/datascience/interactive-common/interactiveWindowTypes'; -// import { IJupyterVariable } from '../../client/datascience/types'; +// import { sleep } from '../../platform/common/utils/async'; +// import { InteractiveWindowMessages } from '../../platform/datascience/interactive-common/interactiveWindowTypes'; +// import { IJupyterVariable } from '../../platform/datascience/types'; // import { DataScienceIocContainer } from './dataScienceIocContainer'; // import { addCode, getOrCreateInteractiveWindow } from './interactiveWindowTestHelpers'; // import { addCell, createNewEditor } from './nativeEditorTestHelpers'; diff --git a/src/test/datascience/vscodeTestHelpers.ts b/src/test/datascience/vscodeTestHelpers.ts index 8e07027552d..d8f1c0e7e32 100644 --- a/src/test/datascience/vscodeTestHelpers.ts +++ b/src/test/datascience/vscodeTestHelpers.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. 'use strict'; -import { createDeferred } from '../../client/common/utils/async'; +import { createDeferred } from '../../platform/common/utils/async'; // Basic shape that something needs to support to hook up to this interface IOnMessageListener { diff --git a/src/test/datascience/widgets/commUtils.ts b/src/test/datascience/widgets/commUtils.ts index 4174c01ed57..57588572d89 100644 --- a/src/test/datascience/widgets/commUtils.ts +++ b/src/test/datascience/widgets/commUtils.ts @@ -2,11 +2,11 @@ // Licensed under the MIT License. import { NotebookEditor, NotebookRendererMessaging, notebooks } from 'vscode'; -import { disposeAllDisposables } from '../../../client/common/helpers'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable, IDisposableRegistry } from '../../../client/common/types'; -import { createDeferred } from '../../../client/common/utils/async'; -import { IServiceContainer } from '../../../client/ioc/types'; +import { disposeAllDisposables } from '../../../platform/common/helpers'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable, IDisposableRegistry } from '../../../platform/common/types'; +import { createDeferred } from '../../../platform/common/utils/async'; +import { IServiceContainer } from '../../../platform/ioc/types'; export function initializeWidgetComms(serviceContainer: IServiceContainer): Utils { const disposables = serviceContainer.get(IDisposableRegistry); diff --git a/src/test/datascience/widgets/ipywidget.ui.functional.test.ts b/src/test/datascience/widgets/ipywidget.ui.functional.test.ts index c145c1eed13..610522192c0 100644 --- a/src/test/datascience/widgets/ipywidget.ui.functional.test.ts +++ b/src/test/datascience/widgets/ipywidget.ui.functional.test.ts @@ -17,9 +17,9 @@ suite('Dummy14', () => { // import * as path from 'path'; // import * as sinon from 'sinon'; // import { Disposable } from 'vscode'; -// import { traceInfo } from '../../../client/common/logger'; -// import { sleep } from '../../../client/common/utils/async'; -// import { EXTENSION_ROOT_DIR } from '../../../client/constants'; +// import { traceInfo } from '../../../platform/common/logger'; +// import { sleep } from '../../../platform/common/utils/async'; +// import { EXTENSION_ROOT_DIR } from '../../../platform/constants'; // import { retryIfFail as retryIfFailOriginal } from '../../common'; // import { mockedVSCodeNamespaces } from '../../vscode-mock'; // import { DataScienceIocContainer } from '../dataScienceIocContainer'; diff --git a/src/test/datascience/widgets/standard.vscode.test.ts b/src/test/datascience/widgets/standard.vscode.test.ts index 99814107e89..48e20e401db 100644 --- a/src/test/datascience/widgets/standard.vscode.test.ts +++ b/src/test/datascience/widgets/standard.vscode.test.ts @@ -8,10 +8,10 @@ import { assert } from 'chai'; import * as path from 'path'; import * as sinon from 'sinon'; import { commands, NotebookCell, Uri } from 'vscode'; -import { IVSCodeNotebook } from '../../../client/common/application/types'; -import { traceInfo } from '../../../client/common/logger'; -import { IDisposable } from '../../../client/common/types'; -import { IKernelProvider } from '../../../client/../kernels/types'; +import { IVSCodeNotebook } from '../../../platform/common/application/types'; +import { traceInfo } from '../../../platform/common/logger'; +import { IDisposable } from '../../../platform/common/types'; +import { IKernelProvider } from '../../../platform/../kernels/types'; import { captureScreenShot, IExtensionTestApi, waitForCondition } from '../../common'; import { closeActiveWindows, EXTENSION_ROOT_DIR_FOR_TESTS, initialize } from '../../initialize'; import { openNotebook } from '../helpers'; diff --git a/src/test/debugger/common/protocolparser.vscode.test.ts b/src/test/debugger/common/protocolparser.vscode.test.ts index bb291ebd172..342b9eb79f3 100644 --- a/src/test/debugger/common/protocolparser.vscode.test.ts +++ b/src/test/debugger/common/protocolparser.vscode.test.ts @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { PassThrough } from 'stream'; -import { createDeferred } from '../../../client/common/utils/async'; -import { ProtocolParser } from '../../../client/debugger/extension/helpers/protocolParser'; +import { createDeferred } from '../../../platform/common/utils/async'; +import { ProtocolParser } from '../../../platform/debugger/extension/helpers/protocolParser'; import { sleep } from '../../common'; suite('Debugging - Protocol Parser', () => { diff --git a/src/test/debugger/jupyter/helpers.unit.test.ts b/src/test/debugger/jupyter/helpers.unit.test.ts index 74c0d08768f..09eb3b622f5 100644 --- a/src/test/debugger/jupyter/helpers.unit.test.ts +++ b/src/test/debugger/jupyter/helpers.unit.test.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import { expect } from 'chai'; -import { isShortNamePath } from '../../../client/debugger/jupyter/helper'; +import { isShortNamePath } from '../../../platform/debugger/jupyter/helper'; suite('Debugging - Helpers', () => { suite('isShortNamePath', async () => { diff --git a/src/test/extension-version.functional.test.ts b/src/test/extension-version.functional.test.ts index 333007101c4..34988b3e477 100644 --- a/src/test/extension-version.functional.test.ts +++ b/src/test/extension-version.functional.test.ts @@ -9,7 +9,7 @@ import { expect } from 'chai'; import * as fs from 'fs'; import * as glob from 'glob'; import * as path from 'path'; -import { EXTENSION_ROOT_DIR } from '../client/common/constants'; +import { EXTENSION_ROOT_DIR } from '../platform/common/constants'; suite('Extension localization files', () => { test('Load localization file', () => { diff --git a/src/test/extension.serviceRegistry.vscode.test.ts b/src/test/extension.serviceRegistry.vscode.test.ts new file mode 100644 index 00000000000..a909e7d835a --- /dev/null +++ b/src/test/extension.serviceRegistry.vscode.test.ts @@ -0,0 +1,192 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +'use strict'; + +/* eslint-disable @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */ +import { assert } from 'chai'; +import { traceInfo } from '../platform/common/logger'; +import { captureScreenShot, IExtensionTestApi } from './common'; + +import * as ts from 'typescript'; +import * as fs from 'fs-extra'; +import * as glob from 'glob'; +import * as path from 'path'; + +import { initialize } from './initialize'; +import { interfaces } from 'inversify/lib/interfaces/interfaces'; + +/** + * A TypeScript language service host + */ +class TypeScriptLanguageServiceHost implements ts.LanguageServiceHost { + private readonly _files: string[]; + private readonly _compilerOptions: ts.CompilerOptions; + + constructor(files: string[], compilerOptions: ts.CompilerOptions) { + this._files = files; + this._compilerOptions = compilerOptions; + } + + // --- language service host --------------- + + getCompilationSettings(): ts.CompilerOptions { + return this._compilerOptions; + } + getScriptFileNames(): string[] { + return this._files; + } + getScriptVersion(_fileName: string): string { + return '1'; + } + getProjectVersion(): string { + return '1'; + } + getScriptSnapshot(fileName: string): ts.IScriptSnapshot { + if (this._files.includes(fileName)) { + return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); + } else { + return ts.ScriptSnapshot.fromString(''); + } + } + getScriptKind(_fileName: string): ts.ScriptKind { + return ts.ScriptKind.TS; + } + getCurrentDirectory(): string { + return ''; + } + getDefaultLibFileName(_options: ts.CompilerOptions): string { + return 'defaultLib:lib.d.ts'; + } + isDefaultLibFileName(fileName: string): boolean { + return fileName === this.getDefaultLibFileName(this._compilerOptions); + } +} + +async function getInjectableClasses(fileNames: string[], options: ts.CompilerOptions) { + let host = new TypeScriptLanguageServiceHost(fileNames, options); + let languageService = ts.createLanguageService(host, undefined, ts.LanguageServiceMode.Semantic); + let program = languageService.getProgram(); + const classes = new Set(); + + // Visit every sourceFile in the program + if (program) { + for (const sourceFile of program.getSourceFiles()) { + if (!sourceFile.isDeclarationFile && !sourceFile.fileName.includes('.test')) { + // Walk the tree to search for classes + ts.forEachChild(sourceFile, visit.bind(undefined, sourceFile)); + } + } + } + + /** visit nodes finding exported classes */ + function visit(sourceFile: ts.SourceFile, node: ts.Node) { + // Only consider exported classes + if (!isNodeExported(node)) { + return; + } + + if (ts.isClassDeclaration(node) && node.decorators) { + // See if it has the 'injectable' decorator or not + if (node.decorators.find((d) => d.getText(sourceFile).includes('injectable'))) { + classes.add(node.name?.escapedText.toString().trim() || ''); + } + } else if (ts.isModuleDeclaration(node)) { + // This is a namespace, visit its children + ts.forEachChild(node, visit.bind(undefined, sourceFile)); + } + } + + /** True if this is visible outside this file, false otherwise */ + function isNodeExported(node: ts.Node): boolean { + return ( + (ts.getCombinedModifierFlags(node as ts.Declaration) & ts.ModifierFlags.Export) !== 0 || + (!!node.parent && node.parent.kind === ts.SyntaxKind.SourceFile) + ); + } + + return classes; +} + +async function getSourceFiles() { + const files = await new Promise((resolve, reject) => { + const globPattern = path.join(__dirname, '..', '..', 'src', '**', '*.ts').replace(/\\/g, '/'); + glob(globPattern, (ex, res) => { + if (ex) { + reject(ex); + } else { + resolve(res); + } + }); + }); + return files; +} + +/* eslint-disable @typescript-eslint/no-explicit-any, no-invalid-this */ +suite('DataScience - Verify serviceRegistry is correct', function () { + let api: IExtensionTestApi; + setup(async function () { + try { + traceInfo(`Start Test ${this.currentTest?.title}`); + api = await initialize(); + traceInfo(`Start Test (completed) ${this.currentTest?.title}`); + } catch (e) { + await captureScreenShot(this.currentTest?.title || 'unknown'); + throw e; + } + }); + teardown(async function () { + traceInfo(`Ended Test ${this.currentTest?.title}`); + traceInfo(`Ended Test (completed) ${this.currentTest?.title}`); + }); + test('Verify all classes with inject on them are in the container', async () => { + assert.ok( + api.serviceContainer, + `Service container not created. Extension should fail to activate. See inversify output` + ); + const files = await getSourceFiles(); + const classes = await getInjectableClasses(files, { + target: ts.ScriptTarget.ES5, + module: ts.ModuleKind.CommonJS + }); + const map = (api.serviceManager.getContainer() as any)._bindingDictionary._map as Map< + number, + Array> + >; + + // Go through all the classes and see that each one is an implementation type of something + const implementationTypes = new Set(); + const notFound = new Set(classes); + [...map.entries()].forEach((e) => { + e[1].forEach((b) => { + let name: string | undefined; + const type = b.implementationType; + if (type) { + name = type.name; + } + const cache = b.cache; + if (b.type === 'ConstantValue' && cache && cache.constructor) { + name = cache.constructor.name; + } + if (name) { + if (notFound.has(name)) { + notFound.delete(name); + } + implementationTypes.add(name); + } + }); + }); + + // There are set of known types that are expected to not be picked up because + // they only show up in dev mode + const devModeExceptions = ['LogReplayService']; + devModeExceptions.forEach((d) => notFound.delete(d)); + + assert.equal( + notFound.size, + 0, + `List of classes not in registry that are marked as injectable: ${[...notFound].join('\n')}` + ); + }); +}); diff --git a/src/test/fixtures.ts b/src/test/fixtures.ts index 9ecadb8ea5b..82297e7cb54 100644 --- a/src/test/fixtures.ts +++ b/src/test/fixtures.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import * as fs from 'fs-extra'; -import { sleep } from '../client/common/utils/async'; +import { sleep } from '../platform/common/utils/async'; import { PYTHON_PATH } from './common'; import { Proc, spawn } from './proc'; diff --git a/src/test/format/extension.format.vscode.test.ts b/src/test/format/extension.format.vscode.test.ts index 34044aefbe4..63051a7318f 100644 --- a/src/test/format/extension.format.vscode.test.ts +++ b/src/test/format/extension.format.vscode.test.ts @@ -7,11 +7,11 @@ // import * as path from 'path'; // import * as sinon from 'sinon'; // import { commands, ConfigurationTarget, Uri } from 'vscode'; -// import { IWorkspaceService } from '../../client/common/application/types'; -// import { IFileSystem } from '../../client/common/platform/types'; -// import { IPythonToolExecutionService } from '../../client/common/process/types'; -// import { IDisposable, Product } from '../../client/common/types'; -// import { INotebookEditorProvider } from '../../client/datascience/types'; +// import { IWorkspaceService } from '../../platform/common/application/types'; +// import { IFileSystem } from '../../platform/common/platform/types'; +// import { IPythonToolExecutionService } from '../../platform/common/process/types'; +// import { IDisposable, Product } from '../../platform/common/types'; +// import { INotebookEditorProvider } from '../../platform/datascience/types'; // import { IExtensionTestApi } from '../common'; // import { // canRunTests, diff --git a/src/test/functionalTests.ts b/src/test/functionalTests.ts index c8e7f3299cc..27f3911873c 100644 --- a/src/test/functionalTests.ts +++ b/src/test/functionalTests.ts @@ -99,7 +99,7 @@ exports.mochaHooks = { } } - const kernelLauncherMod = require('../client/datascience/kernel-launcher/kernelLauncher'); + const kernelLauncherMod = require('../platform/datascience/kernel-launcher/kernelLauncher'); // After all tests run, clean up the kernel launcher mutex files return kernelLauncherMod.KernelLauncher.cleanupStartPort().then(() => nycPromise); diff --git a/src/test/initialize.ts b/src/test/initialize.ts index 8a65a2b7900..bf784e01dd3 100644 --- a/src/test/initialize.ts +++ b/src/test/initialize.ts @@ -1,9 +1,9 @@ import * as path from 'path'; import * as vscode from 'vscode'; -import type { IExtensionApi } from '../client/api'; -import { disposeAllDisposables } from '../client/common/helpers'; -import type { IDisposable } from '../client/common/types'; -import { PythonExtension } from '../client/datascience/constants'; +import type { IExtensionApi } from '../platform/api'; +import { disposeAllDisposables } from '../platform/common/helpers'; +import type { IDisposable } from '../platform/common/types'; +import { PythonExtension } from '../platform/datascience/constants'; import { clearPendingChainedUpdatesForTests } from '../notebooks/execution/notebookUpdater'; import { clearPendingTimers, IExtensionTestApi, PYTHON_PATH, setPythonPathInWorkspaceRoot } from './common'; import { IS_SMOKE_TEST, JVSC_EXTENSION_ID_FOR_TESTS } from './constants'; @@ -58,7 +58,7 @@ export async function initializeTest(): Promise { await closeActiveWindows(); if (!IS_SMOKE_TEST) { // When running smoke tests, we won't have access to these. - const configSettings = await import('../client/common/configSettings'); + const configSettings = await import('../platform/common/configSettings'); // Dispose any cached python settings (used only in test env). configSettings.JupyterSettings.dispose(); } diff --git a/src/test/interpreters/condaHelper.ts b/src/test/interpreters/condaHelper.ts index d3002d5b07b..10a61f730ab 100644 --- a/src/test/interpreters/condaHelper.ts +++ b/src/test/interpreters/condaHelper.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import '../../client/common/extensions'; +import '../../platform/common/extensions'; /** * Parses output returned by the command `conda env list`. diff --git a/src/test/interpreters/condaService.ts b/src/test/interpreters/condaService.ts index b9bfec48c61..45efef5b3cc 100644 --- a/src/test/interpreters/condaService.ts +++ b/src/test/interpreters/condaService.ts @@ -5,10 +5,10 @@ import * as glob from 'glob'; import * as path from 'path'; import { parse, SemVer } from 'semver'; import { promisify } from 'util'; -import { traceError, traceVerbose, traceWarning } from '../../client/common/logger'; -import { arePathsSame } from '../../client/common/platform/fileUtils'; -import { BufferDecoder } from '../../client/common/process/decoder'; -import { ProcessService } from '../../client/common/process/proc'; +import { traceError, traceVerbose, traceWarning } from '../../platform/common/logger'; +import { arePathsSame } from '../../platform/common/platform/fileUtils'; +import { BufferDecoder } from '../../platform/common/process/decoder'; +import { ProcessService } from '../../platform/common/process/proc'; import { getOSType, OSType } from '../common'; import { parseCondaEnvFileContents } from './condaHelper'; import { isCondaEnvironment } from './condaLocator'; diff --git a/src/test/interpreters/envActivation.ts b/src/test/interpreters/envActivation.ts index 0cd9c853c06..17c66d5c947 100644 --- a/src/test/interpreters/envActivation.ts +++ b/src/test/interpreters/envActivation.ts @@ -3,9 +3,9 @@ import { injectable } from 'inversify'; // Licensed under the MIT License. import { getActivatedEnvVariables } from '.'; -import { Resource } from '../../client/common/types'; -import { IEnvironmentActivationService } from '../../client/interpreter/activation/types'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +import { Resource } from '../../platform/common/types'; +import { IEnvironmentActivationService } from '../../platform/interpreter/activation/types'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; @injectable() export class EnvironmentActivationService implements IEnvironmentActivationService { diff --git a/src/test/interpreters/index.ts b/src/test/interpreters/index.ts index 2127d54cb0a..18357dd355b 100644 --- a/src/test/interpreters/index.ts +++ b/src/test/interpreters/index.ts @@ -2,13 +2,13 @@ // Licensed under the MIT License. import * as path from 'path'; -import '../../client/common/extensions'; -import { traceError } from '../../client/common/logger'; -import { BufferDecoder } from '../../client/common/process/decoder'; -import { PythonEnvInfo } from '../../client/common/process/internal/scripts'; -import { ProcessService } from '../../client/common/process/proc'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; -import { parsePythonVersion } from '../../client/pythonEnvironments/info/pythonVersion'; +import '../../platform/common/extensions'; +import { traceError } from '../../platform/common/logger'; +import { BufferDecoder } from '../../platform/common/process/decoder'; +import { PythonEnvInfo } from '../../platform/common/process/internal/scripts'; +import { ProcessService } from '../../platform/common/process/proc'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; +import { parsePythonVersion } from '../../platform/pythonEnvironments/info/pythonVersion'; import { getOSType, OSType } from '../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS } from '../constants'; import { isCondaEnvironment } from './condaLocator'; diff --git a/src/test/interpreters/interpreterService.ts b/src/test/interpreters/interpreterService.ts index 5b07e2677d9..94d2137414b 100644 --- a/src/test/interpreters/interpreterService.ts +++ b/src/test/interpreters/interpreterService.ts @@ -5,10 +5,10 @@ import { inject, injectable } from 'inversify'; import { Event, EventEmitter, Uri } from 'vscode'; import { getInterpreterInfo } from '.'; -import { IPythonExtensionChecker } from '../../client/api/types'; -import { Resource } from '../../client/common/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +import { IPythonExtensionChecker } from '../../platform/api/types'; +import { Resource } from '../../platform/common/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; let interpretersCache: Promise | undefined; @injectable() diff --git a/src/test/interpreters/selector.ts b/src/test/interpreters/selector.ts index 7d3aea350da..90a02972afe 100644 --- a/src/test/interpreters/selector.ts +++ b/src/test/interpreters/selector.ts @@ -1,10 +1,10 @@ import { inject, injectable } from 'inversify'; -import { Resource } from '../../client/common/types'; +import { Resource } from '../../platform/common/types'; // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { IInterpreterQuickPickItem, IInterpreterSelector } from '../../client/interpreter/configuration/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; +import { IInterpreterQuickPickItem, IInterpreterSelector } from '../../platform/interpreter/configuration/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; @injectable() export class InterpreterSelector implements IInterpreterSelector { diff --git a/src/test/kernels/installer/channelManager.channels.unit.test.ts b/src/test/kernels/installer/channelManager.channels.unit.test.ts index b558caeae79..10329df2cc5 100644 --- a/src/test/kernels/installer/channelManager.channels.unit.test.ts +++ b/src/test/kernels/installer/channelManager.channels.unit.test.ts @@ -5,11 +5,11 @@ import * as assert from 'assert'; import { Container } from 'inversify'; import * as TypeMoq from 'typemoq'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { ServiceContainer } from '../../../client/ioc/container'; -import { ServiceManager } from '../../../client/ioc/serviceManager'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { ServiceContainer } from '../../../platform/ioc/container'; +import { ServiceManager } from '../../../platform/ioc/serviceManager'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { InstallationChannelManager } from '../../../kernels/installer/channelManager'; import { Product, IModuleInstaller } from '../../../kernels/installer/types'; diff --git a/src/test/kernels/installer/channelManager.messages.unit.test.ts b/src/test/kernels/installer/channelManager.messages.unit.test.ts index 6273508f80e..8bc476b100b 100644 --- a/src/test/kernels/installer/channelManager.messages.unit.test.ts +++ b/src/test/kernels/installer/channelManager.messages.unit.test.ts @@ -5,13 +5,13 @@ import * as assert from 'assert'; import { Container } from 'inversify'; import { SemVer } from 'semver'; import * as TypeMoq from 'typemoq'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { IPlatformService } from '../../../client/common/platform/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { ServiceContainer } from '../../../client/ioc/container'; -import { ServiceManager } from '../../../client/ioc/serviceManager'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { IPlatformService } from '../../../platform/common/platform/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { ServiceContainer } from '../../../platform/ioc/container'; +import { ServiceManager } from '../../../platform/ioc/serviceManager'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { InstallationChannelManager } from '../../../kernels/installer/channelManager'; import { IModuleInstaller, Product } from '../../../kernels/installer/types'; diff --git a/src/test/kernels/installer/channelManager.unit.test.ts b/src/test/kernels/installer/channelManager.unit.test.ts index c75fb2a4296..7e504a79908 100644 --- a/src/test/kernels/installer/channelManager.unit.test.ts +++ b/src/test/kernels/installer/channelManager.unit.test.ts @@ -5,11 +5,11 @@ import { assert, expect } from 'chai'; import * as sinon from 'sinon'; import * as TypeMoq from 'typemoq'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { IPlatformService } from '../../../client/common/platform/types'; -import { Installer } from '../../../client/common/utils/localize'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { IPlatformService } from '../../../platform/common/platform/types'; +import { Installer } from '../../../platform/common/utils/localize'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { InstallationChannelManager } from '../../../kernels/installer/channelManager'; import { IModuleInstaller, Product } from '../../../kernels/installer/types'; diff --git a/src/test/kernels/installer/condaInstaller.unit.test.ts b/src/test/kernels/installer/condaInstaller.unit.test.ts index d301e7cc9d7..cc800c8d39e 100644 --- a/src/test/kernels/installer/condaInstaller.unit.test.ts +++ b/src/test/kernels/installer/condaInstaller.unit.test.ts @@ -5,13 +5,13 @@ import * as assert from 'assert'; import { instance, mock, when } from 'ts-mockito'; -import { JupyterSettings } from '../../../client/common/configSettings'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { CondaService } from '../../../client/common/process/condaService'; -import { IConfigurationService } from '../../../client/common/types'; -import { ServiceContainer } from '../../../client/ioc/container'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { JupyterSettings } from '../../../platform/common/configSettings'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { CondaService } from '../../../platform/common/process/condaService'; +import { IConfigurationService } from '../../../platform/common/types'; +import { ServiceContainer } from '../../../platform/ioc/container'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { CondaInstaller } from '../../../kernels/installer/condaInstaller'; import { ExecutionInstallArgs } from '../../../kernels/installer/moduleInstaller'; import { ModuleInstallFlags } from '../../../kernels/installer/types'; diff --git a/src/test/kernels/installer/pipEnvInstaller.unit.test.ts b/src/test/kernels/installer/pipEnvInstaller.unit.test.ts index 1aa199f4882..0a66de369d2 100644 --- a/src/test/kernels/installer/pipEnvInstaller.unit.test.ts +++ b/src/test/kernels/installer/pipEnvInstaller.unit.test.ts @@ -8,10 +8,10 @@ import { expect } from 'chai'; import * as sinon from 'sinon'; import * as TypeMoq from 'typemoq'; import { Uri } from 'vscode'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { IInterpreterService } from '../../../client/interpreter/contracts'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { EnvironmentType } from '../../../client/pythonEnvironments/info'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { IInterpreterService } from '../../../platform/interpreter/contracts'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { EnvironmentType } from '../../../platform/pythonEnvironments/info'; import { PipEnvInstaller } from '../../../kernels/installer/pipEnvInstaller'; import * as pipEnvHelper from '../../../kernels/installer/pipenv'; diff --git a/src/test/kernels/installer/pipInstaller.unit.test.ts b/src/test/kernels/installer/pipInstaller.unit.test.ts index 438b34f41a9..182f0891a41 100644 --- a/src/test/kernels/installer/pipInstaller.unit.test.ts +++ b/src/test/kernels/installer/pipInstaller.unit.test.ts @@ -6,9 +6,9 @@ import { assert, expect } from 'chai'; import * as TypeMoq from 'typemoq'; -import { IPythonExecutionFactory, IPythonExecutionService } from '../../../client/common/process/types'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IPythonExecutionFactory, IPythonExecutionService } from '../../../platform/common/process/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { PipInstaller } from '../../../kernels/installer/pipInstaller'; suite('Pip installer', async () => { diff --git a/src/test/kernels/installer/pipenv.unit.test.ts b/src/test/kernels/installer/pipenv.unit.test.ts index 211de6ea880..18d4d768685 100644 --- a/src/test/kernels/installer/pipenv.unit.test.ts +++ b/src/test/kernels/installer/pipenv.unit.test.ts @@ -1,8 +1,8 @@ import * as assert from 'assert'; import * as pathModule from 'path'; import * as sinon from 'sinon'; -import * as platformApis from '../../../client/common/utils/platform'; -import * as fileUtils from '../../../client/common/platform/fileUtils'; +import * as platformApis from '../../../platform/common/utils/platform'; +import * as fileUtils from '../../../platform/common/platform/fileUtils'; import { TEST_LAYOUT_ROOT } from '../../../test/pythonEnvironments/constants'; import { isPipenvEnvironmentRelatedToFolder, diff --git a/src/test/kernels/installer/poetry.unit.test.ts b/src/test/kernels/installer/poetry.unit.test.ts index 72900dfce56..dc5cb09a9b8 100644 --- a/src/test/kernels/installer/poetry.unit.test.ts +++ b/src/test/kernels/installer/poetry.unit.test.ts @@ -5,9 +5,9 @@ import { assert, expect } from 'chai'; import * as path from 'path'; import * as sinon from 'sinon'; import { TEST_LAYOUT_ROOT } from '../../../test/pythonEnvironments/constants'; -import { ShellOptions, ExecutionResult } from '../../../client/common/process/types'; -import * as platformApis from '../../../client/common/utils/platform'; -import * as fileUtils from '../../../client/common/platform/fileUtils'; +import { ShellOptions, ExecutionResult } from '../../../platform/common/process/types'; +import * as platformApis from '../../../platform/common/utils/platform'; +import * as fileUtils from '../../../platform/common/platform/fileUtils'; import { isPoetryEnvironment, Poetry } from '../../../kernels/installer/poetry'; const testPoetryDir = path.join(TEST_LAYOUT_ROOT, 'poetry'); diff --git a/src/test/kernels/installer/poetryInstaller.unit.test.ts b/src/test/kernels/installer/poetryInstaller.unit.test.ts index 2f97212636c..2fee24dc053 100644 --- a/src/test/kernels/installer/poetryInstaller.unit.test.ts +++ b/src/test/kernels/installer/poetryInstaller.unit.test.ts @@ -9,16 +9,16 @@ import * as assert from 'assert'; import { expect } from 'chai'; import { anything, instance, mock, when } from 'ts-mockito'; import { Uri } from 'vscode'; -import { IWorkspaceService } from '../../../client/common/application/types'; -import { WorkspaceService } from '../../../client/common/application/workspace'; -import { ConfigurationService } from '../../../client/common/configuration/service'; -import { ExecutionResult, ShellOptions } from '../../../client/common/process/types'; -import { IConfigurationService } from '../../../client/common/types'; -import { ServiceContainer } from '../../../client/ioc/container'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IWorkspaceService } from '../../../platform/common/application/types'; +import { WorkspaceService } from '../../../platform/common/application/workspace'; +import { ConfigurationService } from '../../../platform/common/configuration/service'; +import { ExecutionResult, ShellOptions } from '../../../platform/common/process/types'; +import { IConfigurationService } from '../../../platform/common/types'; +import { ServiceContainer } from '../../../platform/ioc/container'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { TEST_LAYOUT_ROOT } from '../../../test/pythonEnvironments/constants'; -import * as fileUtils from '../../../client/common/platform/fileUtils'; -import { JupyterSettings } from '../../../client/common/configSettings'; +import * as fileUtils from '../../../platform/common/platform/fileUtils'; +import { JupyterSettings } from '../../../platform/common/configSettings'; import { PoetryInstaller } from '../../../kernels/installer/poetryInstaller'; import { ExecutionInstallArgs } from '../../../kernels/installer/moduleInstaller'; import { ModuleInstallFlags } from '../../../kernels/installer/types'; diff --git a/src/test/kernels/installer/productInstaller.unit.test.ts b/src/test/kernels/installer/productInstaller.unit.test.ts index faa83e18602..2acdd2bfd3b 100644 --- a/src/test/kernels/installer/productInstaller.unit.test.ts +++ b/src/test/kernels/installer/productInstaller.unit.test.ts @@ -7,10 +7,10 @@ import { expect } from 'chai'; import * as TypeMoq from 'typemoq'; import { CancellationTokenSource } from 'vscode'; -import { IApplicationShell } from '../../../client/common/application/types'; -import { InterpreterUri, IOutputChannel } from '../../../client/common/types'; -import { IServiceContainer } from '../../../client/ioc/types'; -import { EnvironmentType, PythonEnvironment } from '../../../client/pythonEnvironments/info'; +import { IApplicationShell } from '../../../platform/common/application/types'; +import { InterpreterUri, IOutputChannel } from '../../../platform/common/types'; +import { IServiceContainer } from '../../../platform/ioc/types'; +import { EnvironmentType, PythonEnvironment } from '../../../platform/pythonEnvironments/info'; import { DataScienceInstaller } from '../../../kernels/installer/productInstaller'; import { Product, diff --git a/src/test/kernels/installer/productPath.unit.test.ts b/src/test/kernels/installer/productPath.unit.test.ts index 84ea948ded8..6279d505b67 100644 --- a/src/test/kernels/installer/productPath.unit.test.ts +++ b/src/test/kernels/installer/productPath.unit.test.ts @@ -8,10 +8,10 @@ import { expect, use } from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as TypeMoq from 'typemoq'; import { Memento, Uri } from 'vscode'; -import '../../../client/common/extensions'; -import { IConfigurationService, IOutputChannel } from '../../../client/common/types'; -import { InterpreterPackages } from '../../../client/datascience/telemetry/interpreterPackages'; -import { IServiceContainer } from '../../../client/ioc/types'; +import '../../../platform/common/extensions'; +import { IConfigurationService, IOutputChannel } from '../../../platform/common/types'; +import { InterpreterPackages } from '../../../telemetry/interpreterPackages'; +import { IServiceContainer } from '../../../platform/ioc/types'; import { ProductInstaller } from '../../../kernels/installer/productInstaller'; import { BaseProductPathsService } from '../../../kernels/installer/productPath'; import { ProductService } from '../../../kernels/installer/productService'; diff --git a/src/test/kernels/installer/pyenv.unit.test.ts b/src/test/kernels/installer/pyenv.unit.test.ts index 2f8c34cffc3..6359e3af51f 100644 --- a/src/test/kernels/installer/pyenv.unit.test.ts +++ b/src/test/kernels/installer/pyenv.unit.test.ts @@ -4,8 +4,8 @@ import * as assert from 'assert'; import * as path from 'path'; import * as sinon from 'sinon'; -import * as platformUtils from '../../../client/common/utils/platform'; -import * as fileUtils from '../../../client/common/platform/fileUtils'; +import * as platformUtils from '../../../platform/common/utils/platform'; +import * as fileUtils from '../../../platform/common/platform/fileUtils'; import { isPyenvEnvironment, IPyenvVersionStrings, diff --git a/src/test/mocks/mementos.ts b/src/test/mocks/mementos.ts index d313e28f4c9..f8b266ef59d 100644 --- a/src/test/mocks/mementos.ts +++ b/src/test/mocks/mementos.ts @@ -1,7 +1,5 @@ -import { injectable } from 'inversify'; import { Memento } from 'vscode'; -@injectable() export class MockMemento implements Memento { // Note: This has to be called _value so that it matches // what VS code has for a memento. We use this to eliminate a bad bug diff --git a/src/test/mocks/proc.ts b/src/test/mocks/proc.ts index 25ec528c11c..93dd1d41446 100644 --- a/src/test/mocks/proc.ts +++ b/src/test/mocks/proc.ts @@ -10,7 +10,7 @@ import { Output, ShellOptions, SpawnOptions -} from '../../client/common/process/types'; +} from '../../platform/common/process/types'; import { noop } from '../core'; type ExecObservableCallback = (result: Observable> | Output) => void; diff --git a/src/test/performance/load.perf.vscode.test.ts b/src/test/performance/load.perf.vscode.test.ts index b04c9000cad..9a351113829 100644 --- a/src/test/performance/load.perf.vscode.test.ts +++ b/src/test/performance/load.perf.vscode.test.ts @@ -10,8 +10,8 @@ import * as fs from 'fs-extra'; import { EOL } from 'os'; import * as path from 'path'; import { commands, extensions } from 'vscode'; -import { JVSC_EXTENSION_ID } from '../../client/common/constants'; -import { StopWatch } from '../../client/common/utils/stopWatch'; +import { JVSC_EXTENSION_ID } from '../../platform/common/constants'; +import { StopWatch } from '../../platform/common/utils/stopWatch'; const AllowedIncreaseInActivationDelayInMS = 500; diff --git a/src/test/performanceTest.ts b/src/test/performanceTest.ts index 3db5a9529e2..86ab892d41a 100644 --- a/src/test/performanceTest.ts +++ b/src/test/performanceTest.ts @@ -22,7 +22,7 @@ import * as download from 'download'; import * as fs from 'fs-extra'; import * as path from 'path'; import * as request from 'request'; -import { EXTENSION_ROOT_DIR, JVSC_EXTENSION_ID } from '../client/common/constants'; +import { EXTENSION_ROOT_DIR, JVSC_EXTENSION_ID } from '../platform/common/constants'; import { unzip } from './common'; import { initializeLogger } from './testLogger'; diff --git a/src/test/proc.ts b/src/test/proc.ts index d674d29b8cc..bc9e8a147b1 100644 --- a/src/test/proc.ts +++ b/src/test/proc.ts @@ -2,7 +2,7 @@ // Licensed under the MIT License. import * as cp from 'child_process'; -import { sleep } from '../client/common/utils/async'; +import { sleep } from '../platform/common/utils/async'; type OutStream = 'stdout' | 'stderr'; diff --git a/src/test/serviceRegistry.ts b/src/test/serviceRegistry.ts deleted file mode 100644 index 4c9cde226c4..00000000000 --- a/src/test/serviceRegistry.ts +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -import * as fsextra from 'fs-extra'; -import { Container } from 'inversify'; -import * as path from 'path'; -import { Disposable, Memento, OutputChannel, Uri } from 'vscode'; -import { STANDARD_OUTPUT_CHANNEL } from '../client/common/constants'; -import { convertStat } from '../client/common/platform/fileSystemUtils'; -import { FileStat, FileType } from '../client/common/platform/types'; -import { - GLOBAL_MEMENTO, - IDisposableRegistry, - IMemento, - IOutputChannel, - WORKSPACE_MEMENTO -} from '../client/common/types'; -import { createDeferred } from '../client/common/utils/async'; -import { ServiceContainer } from '../client/ioc/container'; -import { ServiceManager } from '../client/ioc/serviceManager'; -import { IServiceContainer, IServiceManager } from '../client/ioc/types'; -import { MockOutputChannel } from './mockClasses'; -import { MockMemento } from './mocks/mementos'; - -// This is necessary for unit tests and functional tests, since they -// do not run under VS Code so they do not have access to the actual -// "vscode" namespace. -export class FakeVSCodeFileSystemAPI { - public isWritableFileSystem(_scheme: string): boolean | undefined { - return; - } - public async readFile(uri: Uri): Promise { - return fsextra.readFile(uri.fsPath); - } - public async writeFile(uri: Uri, content: Uint8Array): Promise { - await fsextra.mkdirs(path.dirname(uri.fsPath)); - return fsextra.writeFile(uri.fsPath, Buffer.from(content)); - } - public async delete(uri: Uri, _options?: { recursive: boolean; useTrash: boolean }): Promise { - return ( - fsextra - // Make sure the file exists before deleting. - .stat(uri.fsPath) - .then(() => fsextra.remove(uri.fsPath)) - ); - } - public async stat(uri: Uri): Promise { - const filename = uri.fsPath; - - let filetype = FileType.Unknown; - let stat = await fsextra.lstat(filename); - if (stat.isSymbolicLink()) { - filetype = FileType.SymbolicLink; - stat = await fsextra.stat(filename); - } - if (stat.isFile()) { - filetype |= FileType.File; - } else if (stat.isDirectory()) { - filetype |= FileType.Directory; - } - return convertStat(stat, filetype); - } - public async readDirectory(uri: Uri): Promise<[string, FileType][]> { - const names: string[] = await fsextra.readdir(uri.fsPath); - const promises = names.map((name) => { - const filename = path.join(uri.fsPath, name); - return ( - fsextra - // Get the lstat info and deal with symlinks if necessary. - .lstat(filename) - .then(async (stat) => { - let filetype = FileType.Unknown; - if (stat.isFile()) { - filetype = FileType.File; - } else if (stat.isDirectory()) { - filetype = FileType.Directory; - } else if (stat.isSymbolicLink()) { - filetype = FileType.SymbolicLink; - stat = await fsextra.stat(filename); - if (stat.isFile()) { - filetype |= FileType.File; - } else if (stat.isDirectory()) { - filetype |= FileType.Directory; - } - } - return [name, filetype] as [string, FileType]; - }) - .catch(() => [name, FileType.Unknown] as [string, FileType]) - ); - }); - return Promise.all(promises); - } - public async createDirectory(uri: Uri): Promise { - return fsextra.mkdirp(uri.fsPath); - } - public async copy(src: Uri, dest: Uri): Promise { - const deferred = createDeferred(); - const rs = fsextra - // Set an error handler on the stream. - .createReadStream(src.fsPath) - .on('error', (err) => { - deferred.reject(err); - }); - const ws = fsextra - .createWriteStream(dest.fsPath) - // Set an error & close handler on the stream. - .on('error', (err) => { - deferred.reject(err); - }) - .on('close', () => { - deferred.resolve(); - }); - rs.pipe(ws); - return deferred.promise; - } - public async rename(src: Uri, dest: Uri): Promise { - return fsextra.rename(src.fsPath, dest.fsPath); - } -} - -export class IocContainer { - // This may be set (before any registration happens) to indicate - // whether or not IOC should depend on the VS Code API (e.g. the - // "vscode" module). So in "functional" tests, this should be set - // to "false". - public useVSCodeAPI = true; - - public readonly serviceManager: IServiceManager; - public readonly serviceContainer: IServiceContainer; - - private disposables: Disposable[] = []; - - constructor() { - const cont = new Container(); - this.serviceManager = new ServiceManager(cont); - this.serviceContainer = new ServiceContainer(cont); - - this.serviceManager.addSingletonInstance(IServiceContainer, this.serviceContainer); - this.serviceManager.addSingletonInstance(IDisposableRegistry, this.disposables); - this.serviceManager.addSingleton(IMemento, MockMemento, GLOBAL_MEMENTO); - this.serviceManager.addSingleton(IMemento, MockMemento, WORKSPACE_MEMENTO); - - const stdOutputChannel = new MockOutputChannel('Python'); - this.disposables.push(stdOutputChannel); - this.serviceManager.addSingletonInstance( - IOutputChannel, - stdOutputChannel, - STANDARD_OUTPUT_CHANNEL - ); - } - public async dispose(): Promise { - for (const disposable of this.disposables) { - if (!disposable) { - continue; - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const promise = disposable.dispose() as Promise; - if (promise) { - await promise; - } - } - this.disposables = []; - this.serviceManager.dispose(); - } -} diff --git a/src/test/smoke/datascience.smoke.test.ts b/src/test/smoke/datascience.smoke.test.ts index 991276eaba9..d62710ac150 100644 --- a/src/test/smoke/datascience.smoke.test.ts +++ b/src/test/smoke/datascience.smoke.test.ts @@ -9,9 +9,9 @@ import { assert } from 'chai'; import * as fs from 'fs-extra'; import * as path from 'path'; import * as vscode from 'vscode'; -import { traceInfo } from '../../client/common/logger'; -import { IInteractiveWindowProvider } from '../../client/datascience/types'; -import { IInterpreterService } from '../../client/interpreter/contracts'; +import { traceInfo } from '../../platform/common/logger'; +import { IInteractiveWindowProvider } from '../../platform/datascience/types'; +import { IInterpreterService } from '../../platform/interpreter/contracts'; import { IExtensionTestApi, setAutoSaveDelayInWorkspaceRoot, waitForCondition } from '../common'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_SMOKE_TEST } from '../constants'; import { sleep } from '../core'; diff --git a/src/test/standardTest.ts b/src/test/standardTest.ts index 32d2fb4e1d2..d377aff2c16 100644 --- a/src/test/standardTest.ts +++ b/src/test/standardTest.ts @@ -4,7 +4,7 @@ import { spawnSync } from 'child_process'; import * as path from 'path'; import * as fs from 'fs-extra'; import { downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath, runTests } from '@vscode/test-electron'; -import { PythonExtension, PylanceExtension } from '../client/datascience/constants'; +import { PythonExtension, PylanceExtension } from '../platform/datascience/constants'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_REMOTE_NATIVE_TEST } from './constants'; import { initializeLogger } from './testLogger'; import * as tmp from 'tmp'; diff --git a/src/test/telemetry/importTracker.unit.test.ts b/src/test/telemetry/importTracker.unit.test.ts index 116f152804a..30718ba41f4 100644 --- a/src/test/telemetry/importTracker.unit.test.ts +++ b/src/test/telemetry/importTracker.unit.test.ts @@ -8,12 +8,12 @@ import { instance, mock, when } from 'ts-mockito'; import * as TypeMoq from 'typemoq'; import { EventEmitter, NotebookDocument, TextDocument } from 'vscode'; -import { IDocumentManager, IVSCodeNotebook } from '../../client/common/application/types'; -import { disposeAllDisposables } from '../../client/common/helpers'; -import { IDisposable } from '../../client/common/types'; -import { EventName } from '../../client/telemetry/constants'; -import { getTelemetrySafeHashedString } from '../../client/telemetry/helpers'; -import { ImportTracker } from '../../client/telemetry/importTracker'; +import { IDocumentManager, IVSCodeNotebook } from '../../platform/common/application/types'; +import { disposeAllDisposables } from '../../platform/common/helpers'; +import { IDisposable } from '../../platform/common/types'; +import { EventName } from '../../telemetry/constants'; +import { getTelemetrySafeHashedString } from '../../telemetry/helpers'; +import { ImportTracker } from '../../telemetry/importTracker'; import { createDocument } from '../datascience/editor-integration/helpers'; suite('Import Tracker', () => { diff --git a/src/test/telemetry/index.unit.test.ts b/src/test/telemetry/index.unit.test.ts index d1c4c46d66d..0a5dfe5cded 100644 --- a/src/test/telemetry/index.unit.test.ts +++ b/src/test/telemetry/index.unit.test.ts @@ -9,16 +9,16 @@ import * as TypeMoq from 'typemoq'; import { instance, mock, verify, when } from 'ts-mockito'; import { WorkspaceConfiguration } from 'vscode'; -import { IWorkspaceService } from '../../client/common/application/types'; -import { WorkspaceService } from '../../client/common/application/workspace'; -import { EXTENSION_ROOT_DIR } from '../../client/constants'; +import { IWorkspaceService } from '../../platform/common/application/types'; +import { WorkspaceService } from '../../platform/common/application/workspace'; +import { EXTENSION_ROOT_DIR } from '../../platform/constants'; import { _resetSharedProperties, clearTelemetryReporter, isTelemetryDisabled, sendTelemetryEvent, setSharedProperty -} from '../../client/telemetry'; +} from '../../telemetry'; suite('Telemetry', () => { let workspaceService: IWorkspaceService; diff --git a/src/test/testHashPerf.ts b/src/test/testHashPerf.ts index c394d44ccef..c304725eb6f 100644 --- a/src/test/testHashPerf.ts +++ b/src/test/testHashPerf.ts @@ -1,6 +1,6 @@ import * as crypto from 'crypto'; import * as path from 'path'; -import { getInterpreterHash } from '../client/pythonEnvironments/info/interpreter'; +import { getInterpreterHash } from '../platform/pythonEnvironments/info/interpreter'; function doHash(p: string) { return getInterpreterHash({ path: p }); diff --git a/src/test/testLogger.ts b/src/test/testLogger.ts index b93d51d38ba..e6bf00e809e 100644 --- a/src/test/testLogger.ts +++ b/src/test/testLogger.ts @@ -3,11 +3,11 @@ 'use strict'; -// IMPORTANT: This file should only be importing from the '../client/logging' directory, as we -// delete everything in '../client' except for '../client/logging' before running smoke tests. +// IMPORTANT: This file should only be importing from the '../platform/logging' directory, as we +// delete everything in '../platform' except for '../platform/logging' before running smoke tests. -import { LogLevel } from '../client/logging/levels'; -import { configureLogger, createLogger, getPreDefinedConfiguration, logToAll } from '../client/logging/logger'; +import { LogLevel } from '../platform/logging/levels'; +import { configureLogger, createLogger, getPreDefinedConfiguration, logToAll } from '../platform/logging/logger'; const isCI = process.env.TF_BUILD !== undefined || process.env.GITHUB_ACTIONS === 'true'; const monkeyPatchLogger = createLogger(); diff --git a/src/test/testing/serviceRegistry.ts b/src/test/testing/serviceRegistry.ts deleted file mode 100644 index 92cd6a69c6e..00000000000 --- a/src/test/testing/serviceRegistry.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -'use strict'; -import { Uri } from 'vscode'; - -import { IProcessServiceFactory } from '../../client/common/process/types'; -import { CodeCssGenerator } from '../../client/datascience/codeCssGenerator'; -import { - ICodeCssGenerator, - IJupyterExecution, - INotebookImporter, - INotebookServer -} from '../../client/datascience/types'; -import { JupyterImporter } from '../../kernels/jupyter/import-export/jupyterImporter'; -import { HostJupyterExecution } from '../../kernels/jupyter/launcher/liveshare/hostJupyterExecution'; -import { HostJupyterServer } from '../../kernels/jupyter/launcher/liveshare/hostJupyterServer'; -import { getPythonSemVer } from '../common'; -import { IocContainer } from '../serviceRegistry'; - -export class UnitTestIocContainer extends IocContainer { - public async getPythonMajorVersion(resource: Uri): Promise { - const procServiceFactory = this.serviceContainer.get(IProcessServiceFactory); - const procService = await procServiceFactory.create(resource); - const pythonVersion = await getPythonSemVer(procService); - if (pythonVersion) { - return pythonVersion.major; - } else { - return -1; // log warning already issued by underlying functions... - } - } - - public registerDataScienceTypes() { - this.serviceManager.addSingleton(IJupyterExecution, HostJupyterExecution); - this.serviceManager.add(INotebookImporter, JupyterImporter); - this.serviceManager.add(INotebookServer, HostJupyterServer); - this.serviceManager.addSingleton(ICodeCssGenerator, CodeCssGenerator); - } -} diff --git a/src/test/utils/interpreters.ts b/src/test/utils/interpreters.ts index 1d497582fa2..501e88a44e2 100644 --- a/src/test/utils/interpreters.ts +++ b/src/test/utils/interpreters.ts @@ -3,7 +3,7 @@ 'use strict'; -import { PythonEnvironment } from '../../client/pythonEnvironments/info'; +import { PythonEnvironment } from '../../platform/pythonEnvironments/info'; /** * Creates a PythonInterpreter object for testing purposes, with unique name, version and path. diff --git a/src/test/vscode-mock.ts b/src/test/vscode-mock.ts index ef9ace5c0a6..538ae4b1380 100644 --- a/src/test/vscode-mock.ts +++ b/src/test/vscode-mock.ts @@ -7,7 +7,7 @@ import * as TypeMoq from 'typemoq'; import * as vscode from 'vscode'; -import { noop } from '../client/common/utils/misc'; +import { noop } from '../platform/common/utils/misc'; import * as vscodeMocks from './mocks/vsc'; import { vscMockTelemetryReporter } from './mocks/vsc/telemetryReporter'; const Module = require('module'); @@ -148,7 +148,7 @@ mockedVSCode.FileSystemError = vscodeMocks.vscMockExtHostedTypes.FileSystemError (mockedVSCode as any).NotebookCellMetadata = vscodeMocks.vscMockExtHostedTypes.NotebookCellMetadata; (mockedVSCode as any).notebook = { notebookDocuments: [] }; mockedVSCode.workspace; -// This API is used in src/client/telemetry/telemetry.ts +// This API is used in src/telemetry/telemetry.ts const extensions = TypeMoq.Mock.ofType(); extensions.setup((e) => e.all).returns(() => []); const extension = TypeMoq.Mock.ofType>(); diff --git a/src/tools/telemetryGenerator.ts b/src/tools/telemetryGenerator.ts index d71a5e3d8fc..6fc9ec1117b 100644 --- a/src/tools/telemetryGenerator.ts +++ b/src/tools/telemetryGenerator.ts @@ -333,7 +333,7 @@ function generateDocumentation(fileNames: string[], options: ts.CompilerOptions) if (refSourceFile) { const refNode = findNode(refSourceFile, r.textSpan.start); // See if this is the special 'index.ts' file that forces telemetry to be type safe - if (refNode && r.fileName.endsWith('src/client/telemetry/index.ts')) { + if (refNode && r.fileName.endsWith('src/telemetry/index.ts')) { entries.push( generateTelemetryEntry( program!, diff --git a/src/webviews/dataviewer/dataViewerChecker.ts b/src/webviews/dataviewer/dataViewerChecker.ts index beae59ebc42..fcb043d0541 100644 --- a/src/webviews/dataviewer/dataViewerChecker.ts +++ b/src/webviews/dataviewer/dataViewerChecker.ts @@ -1,8 +1,8 @@ import { ConfigurationTarget } from 'vscode'; -import { IApplicationShell } from '../../client/common/application/types'; -import { IConfigurationService, Resource } from '../../client/common/types'; -import { DataScience } from '../../client/common/utils/localize'; -import { ColumnWarningSize } from '../../client/datascience/data-viewing/types'; +import { IApplicationShell } from '../../platform/common/application/types'; +import { IConfigurationService, Resource } from '../../platform/common/types'; +import { DataScience } from '../../platform/common/utils/localize'; +import { ColumnWarningSize } from '../../platform/datascience/data-viewing/types'; // This helper class validates requests to show large data in the data viewer and configures related settings. export class DataViewerChecker { diff --git a/src/webviews/serviceRegistry.ts b/src/webviews/serviceRegistry.ts new file mode 100644 index 00000000000..00135beb811 --- /dev/null +++ b/src/webviews/serviceRegistry.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; + +import { IServiceManager } from '../platform/ioc/types'; + +export function registerTypes(_serviceManager: IServiceManager, _isDevMode: boolean) { + // TODO: Add webview registrations here +} diff --git a/tsconfig.json b/tsconfig.json index 09f925c3e78..f5b4b37866a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -29,9 +29,9 @@ ".vscode-test", ".vscode test", "src/server/node_modules", - "src/client/node_modules", + "src/node_modules", "src/server/src/typings", - "src/client/src/typings", + "src/typings", "src/ipywidgets", "src/smoke", "src/test/datascience/extensionapi",