diff --git a/src/api.d.ts b/src/api.d.ts index d4f2ef784b3..85011223d8c 100644 --- a/src/api.d.ts +++ b/src/api.d.ts @@ -4,6 +4,10 @@ import type { CancellationToken, ProviderResult, CancellationError, Event, Uri } from 'vscode'; export interface Jupyter { + /** + * Access to the Jupyter Kernels API. + */ + readonly kernels: Kernels; /** * Creates a Jupyter Server Collection that can be displayed in the Notebook Kernel Picker. * @@ -21,6 +25,7 @@ export interface Jupyter { ): JupyterServerCollection; } +// #region JupyterServersCollections API /** * Provides information required to connect to a Jupyter Server. */ @@ -161,3 +166,60 @@ export interface JupyterServerCollection { */ dispose(): void; } +// #endregion + +// #region Kernels API +interface Output { + /** + * The output items of this output. + */ + items: OutputItem[]; + /** + * Arbitrary metadata for this cell output. Can be anything but must be JSON-stringifyable. + */ + metadata?: { [key: string]: any }; +} +interface OutputItem { + /** + * The mime type of the output. + * Includes standard mime types (but not limited to) `text/plain`, `application/json`, `text/html`, etc. + * + * Special mime types are: + * - `application/x.notebook.stream.stdout`: The output is a stream of stdout. (same as `NotebookCellOutputItem.stdout('').mime`) + * - `application/x.notebook.stream.stderr`: The output is a stream of stderr. (same as `NotebookCellOutputItem.stderr('').mime`) + * - `application/vnd.code.notebook.error`: The output is a stream of stderr. (same as `NotebookCellOutputItem.error(...).mime`) + * + */ + mime: string; + /** + * The data of this output item. + */ + data: Uint8Array; +} +/** + * Represents a Jupyter Kernel. + */ +export interface Kernel { + /** + * Language of the kernel. + * E.g. python, r, julia, etc. + */ + language: string; + /** + * Executes code in the kernel without affecting the execution count & execution history. + * + * @param code Code to be executed. + * @param token Triggers the cancellation of the execution. + * @returns Async iterable of outputs, that completes when the execution is complete. + */ + executeCode(code: string, token: CancellationToken): AsyncIterable; +} +export interface Kernels { + /** + * Gets an the kernel associated with a given resource. + * For instance if the resource is a notebook, then get the kernel associated with the given Notebook document. + * Only kernels which have already been started by the user and belonging to Notebooks that are currently opened will be returned. + */ + getKernel(uri: Uri): Thenable; +} +// #endregion Kernels API diff --git a/src/api.proposed.kernelApi.d.ts b/src/api.proposed.kernelApi.d.ts deleted file mode 100644 index eb37c436eeb..00000000000 --- a/src/api.proposed.kernelApi.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import type { CancellationToken, Uri } from 'vscode'; - -declare module './api' { - interface Output { - /** - * The output items of this output. - */ - items: OutputItem[]; - /** - * Arbitrary metadata for this cell output. Can be anything but must be JSON-stringifyable. - */ - metadata?: { [key: string]: any }; - } - interface OutputItem { - /** - * The mime type of the output. - * Includes standard mime types (but not limited to) `text/plain`, `application/json`, `text/html`, etc. - * - * Special mime types are: - * - `application/x.notebook.stream.stdout`: The output is a stream of stdout. (same as `NotebookCellOutputItem.stdout('').mime`) - * - `application/x.notebook.stream.stderr`: The output is a stream of stderr. (same as `NotebookCellOutputItem.stderr('').mime`) - * - `application/vnd.code.notebook.error`: The output is a stream of stderr. (same as `NotebookCellOutputItem.error(...).mime`) - * - */ - mime: string; - /** - * The data of this output item. - */ - data: Uint8Array; - } - /** - * Represents a Jupyter Kernel. - */ - export interface Kernel { - /** - * Language of the kernel. - * E.g. python, r, julia, etc. - */ - language: string; - /** - * Executes code in the kernel without affecting the execution count & execution history. - * - * @param code Code to be executed. - * @param token Triggers the cancellation of the execution. - * @returns Async iterable of outputs, that completes when the execution is complete. - */ - executeCode(code: string, token: CancellationToken): AsyncIterable; - } - export interface Kernels { - /** - * Gets an the kernel associated with a given resource. - * For instance if the resource is a notebook, then get the kernel associated with the given Notebook document. - * Only kernels which have already been started by the user and belonging to Notebooks that are currently opened will be returned. - */ - getKernel(uri: Uri): Thenable; - } - export interface Jupyter { - /** - * Access to the Jupyter Kernels API. - */ - readonly kernels: Kernels; - } -} diff --git a/src/test/datascience/data-viewing/showInDataViewerPythonInterpreter.vscode.test.ts b/src/test/datascience/data-viewing/showInDataViewerPythonInterpreter.vscode.test.ts index 714fc44b4d1..31bc01fcf02 100644 --- a/src/test/datascience/data-viewing/showInDataViewerPythonInterpreter.vscode.test.ts +++ b/src/test/datascience/data-viewing/showInDataViewerPythonInterpreter.vscode.test.ts @@ -57,7 +57,7 @@ suite('DataViewer @webview', function () { await vscode.commands.executeCommand('workbench.debug.viewlet.action.removeAllBreakpoints'); }); // Start debugging using the python extension - test('Open from Python debug variables', async () => { + test.skip('Open from Python debug variables', async () => { // First off, open up our python test file and make sure editor and groups are how we want them const textDocument = await openFile(testPythonFile); diff --git a/src/test/datascience/plotViewer/plotViewer.vscode.test.ts b/src/test/datascience/plotViewer/plotViewer.vscode.test.ts index 1a0cf84d857..d78184fac4f 100644 --- a/src/test/datascience/plotViewer/plotViewer.vscode.test.ts +++ b/src/test/datascience/plotViewer/plotViewer.vscode.test.ts @@ -39,7 +39,7 @@ suite('VSCode Notebook PlotViewer integration - VSCode Notebook @webview', funct }); suiteTeardown(() => closeNotebooksAndCleanUpAfterTests(disposables)); - test('Verify plot viewer is active for PNG plots', async function () { + test.skip('Verify plot viewer is active for PNG plots', async function () { await startJupyterServer(); await closeActiveWindows(); await createEmptyPythonNotebook(disposables); diff --git a/src/test/datascience/variableView/variableView.vscode.test.ts b/src/test/datascience/variableView/variableView.vscode.test.ts index 80c7f215e5d..42f6b34fb09 100644 --- a/src/test/datascience/variableView/variableView.vscode.test.ts +++ b/src/test/datascience/variableView/variableView.vscode.test.ts @@ -272,7 +272,7 @@ mySet = {1, 2, 3} }); // Test opening data viewers while another dataviewer is open - test('Open dataviewer', async function () { + test.skip('Open dataviewer', async function () { // Send the command to open the view await commands.executeCommand(Commands.OpenVariableView);