Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove private Jupyter APIs from public API types #21761

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pythonExtensionApi/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pythonExtensionApi/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@vscode/python-extension",
"description": "An API facade for the Python extension in VS Code",
"version": "1.0.2",
"version": "1.0.3",
"author": {
"name": "Microsoft Corporation"
},
Expand Down
7 changes: 7 additions & 0 deletions src/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export function buildApi(
const outputChannel = serviceContainer.get<ILanguageServerOutputChannel>(ILanguageServerOutputChannel);

const api: PythonExtension & {
/**
* Internal API just for Jupyter, hence don't include in the official types.
*/
jupyter: {
registerHooks(): void;
};
} & {
/**
* @deprecated Temporarily exposed for Pylance until we expose this API generally. Will be removed in an
* iteration or two.
Expand Down
46 changes: 1 addition & 45 deletions src/client/api/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { CancellationToken, Event, Uri, WorkspaceFolder, QuickPickItem, extensions } from 'vscode';
import { CancellationToken, Event, Uri, WorkspaceFolder, extensions } from 'vscode';

/*
* Do not introduce any breaking changes to this API.
Expand All @@ -12,9 +12,6 @@ export interface PythonExtension {
* Promise indicating whether all parts of the extension have completed loading or not.
*/
ready: Promise<void>;
jupyter: {
registerHooks(): void;
};
debug: {
/**
* Generate an array of strings for commands to pass to the Python executable to launch the debugger for remote debugging.
Expand Down Expand Up @@ -109,47 +106,6 @@ export interface PythonExtension {
};
}

interface IJupyterServerUri {
baseUrl: string;
token: string;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
authorizationHeader: any; // JSON object for authorization header.
expiration?: Date; // Date/time when header expires and should be refreshed.
displayName: string;
}

type JupyterServerUriHandle = string;

export interface IJupyterUriProvider {
readonly id: string; // Should be a unique string (like a guid)
getQuickPickEntryItems(): QuickPickItem[];
handleQuickPick(item: QuickPickItem, backEnabled: boolean): Promise<JupyterServerUriHandle | 'back' | undefined>;
getServerUri(handle: JupyterServerUriHandle): Promise<IJupyterServerUri>;
}

interface IDataFrameInfo {
columns?: { key: string; type: ColumnType }[];
indexColumn?: string;
rowCount?: number;
}

export interface IDataViewerDataProvider {
dispose(): void;
getDataFrameInfo(): Promise<IDataFrameInfo>;
getAllRows(): Promise<IRowsResponse>;
getRows(start: number, end: number): Promise<IRowsResponse>;
}

enum ColumnType {
String = 'string',
Number = 'number',
Bool = 'bool',
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type IRowsResponse = any[];

export type RefreshOptions = {
/**
* When `true`, force trigger a refresh regardless of whether a refresh was already triggered. Note this can be expensive so
Expand Down
Loading