Skip to content

Commit 98d6704

Browse files
committed
Remove unwanted Jupyter API
1 parent 83107cc commit 98d6704

File tree

4 files changed

+1
-112
lines changed

4 files changed

+1
-112
lines changed

pythonExtensionApi/src/main.ts

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import { CancellationToken, Event, Uri, WorkspaceFolder, QuickPickItem, extensions } from 'vscode';
4+
import { CancellationToken, Event, Uri, WorkspaceFolder, extensions } from 'vscode';
55

66
/*
77
* Do not introduce any breaking changes to this API.
@@ -12,9 +12,6 @@ export interface PythonExtension {
1212
* Promise indicating whether all parts of the extension have completed loading or not.
1313
*/
1414
ready: Promise<void>;
15-
jupyter: {
16-
registerHooks(): void;
17-
};
1815
debug: {
1916
/**
2017
* Generate an array of strings for commands to pass to the Python executable to launch the debugger for remote debugging.
@@ -33,20 +30,6 @@ export interface PythonExtension {
3330
getDebuggerPackagePath(): Promise<string | undefined>;
3431
};
3532

36-
datascience: {
37-
/**
38-
* Launches Data Viewer component.
39-
* @param dataProvider Instance that will be used by the Data Viewer component to fetch data.
40-
* @param title Data Viewer title
41-
*/
42-
showDataViewer(dataProvider: IDataViewerDataProvider, title: string): Promise<void>;
43-
/**
44-
* Registers a remote server provider component that's used to pick remote jupyter server URIs
45-
* @param serverProvider object called back when picking jupyter server URI
46-
*/
47-
registerRemoteServerProvider(serverProvider: IJupyterUriProvider): void;
48-
};
49-
5033
/**
5134
* These APIs provide a way for extensions to work with by python environments available in the user's machine
5235
* as found by the Python extension. See
@@ -123,47 +106,6 @@ export interface PythonExtension {
123106
};
124107
}
125108

126-
interface IJupyterServerUri {
127-
baseUrl: string;
128-
token: string;
129-
130-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
131-
authorizationHeader: any; // JSON object for authorization header.
132-
expiration?: Date; // Date/time when header expires and should be refreshed.
133-
displayName: string;
134-
}
135-
136-
type JupyterServerUriHandle = string;
137-
138-
export interface IJupyterUriProvider {
139-
readonly id: string; // Should be a unique string (like a guid)
140-
getQuickPickEntryItems(): QuickPickItem[];
141-
handleQuickPick(item: QuickPickItem, backEnabled: boolean): Promise<JupyterServerUriHandle | 'back' | undefined>;
142-
getServerUri(handle: JupyterServerUriHandle): Promise<IJupyterServerUri>;
143-
}
144-
145-
interface IDataFrameInfo {
146-
columns?: { key: string; type: ColumnType }[];
147-
indexColumn?: string;
148-
rowCount?: number;
149-
}
150-
151-
export interface IDataViewerDataProvider {
152-
dispose(): void;
153-
getDataFrameInfo(): Promise<IDataFrameInfo>;
154-
getAllRows(): Promise<IRowsResponse>;
155-
getRows(start: number, end: number): Promise<IRowsResponse>;
156-
}
157-
158-
enum ColumnType {
159-
String = 'string',
160-
Number = 'number',
161-
Bool = 'bool',
162-
}
163-
164-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
165-
type IRowsResponse = any[];
166-
167109
export type RefreshOptions = {
168110
/**
169111
* When `true`, force trigger a refresh regardless of whether a refresh was already triggered. Note this can be expensive so

src/client/api.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@ export function buildApi(
111111
return { execCommand: pythonPath === '' ? undefined : [pythonPath] };
112112
},
113113
},
114-
// These are for backwards compatibility. Other extensions are using these APIs and we don't want
115-
// to force them to move to the jupyter extension ... yet.
116-
datascience: {
117-
registerRemoteServerProvider: jupyterIntegration
118-
? jupyterIntegration.registerRemoteServerProvider.bind(jupyterIntegration)
119-
: ((noop as unknown) as (serverProvider: IJupyterUriProvider) => void),
120-
showDataViewer: jupyterIntegration
121-
? jupyterIntegration.showDataViewer.bind(jupyterIntegration)
122-
: ((noop as unknown) as (dataProvider: IDataViewerDataProvider, title: string) => Promise<void>),
123-
},
124114
pylance: {
125115
createClient: (...args: any[]): BaseLanguageClient => {
126116
// Make sure we share output channel so that we can share one with

src/client/api/types.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,6 @@ export interface PythonExtension {
3333
getDebuggerPackagePath(): Promise<string | undefined>;
3434
};
3535

36-
datascience: {
37-
/**
38-
* Launches Data Viewer component.
39-
* @param dataProvider Instance that will be used by the Data Viewer component to fetch data.
40-
* @param title Data Viewer title
41-
*/
42-
showDataViewer(dataProvider: IDataViewerDataProvider, title: string): Promise<void>;
43-
/**
44-
* Registers a remote server provider component that's used to pick remote jupyter server URIs
45-
* @param serverProvider object called back when picking jupyter server URI
46-
*/
47-
registerRemoteServerProvider(serverProvider: IJupyterUriProvider): void;
48-
};
49-
5036
/**
5137
* These APIs provide a way for extensions to work with by python environments available in the user's machine
5238
* as found by the Python extension. See

src/client/jupyter/jupyterIntegration.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,6 @@ type JupyterExtensionApi = {
168168
* @param interpreterService
169169
*/
170170
registerPythonApi(interpreterService: PythonApiForJupyterExtension): void;
171-
/**
172-
* Launches Data Viewer component.
173-
* @param {IDataViewerDataProvider} dataProvider Instance that will be used by the Data Viewer component to fetch data.
174-
* @param {string} title Data Viewer title
175-
*/
176-
showDataViewer(dataProvider: IDataViewerDataProvider, title: string): Promise<void>;
177-
/**
178-
* Registers a remote server provider component that's used to pick remote jupyter server URIs
179-
* @param serverProvider object called back when picking jupyter server URI
180-
*/
181-
registerRemoteServerProvider(serverProvider: IJupyterUriProvider): void;
182171
};
183172

184173
@injectable()
@@ -286,24 +275,6 @@ export class JupyterExtensionIntegration {
286275
}
287276
}
288277

289-
public registerRemoteServerProvider(serverProvider: IJupyterUriProvider): void {
290-
this.getExtensionApi()
291-
.then((e) => {
292-
if (e) {
293-
e.registerRemoteServerProvider(serverProvider);
294-
}
295-
})
296-
.ignoreErrors();
297-
}
298-
299-
public async showDataViewer(dataProvider: IDataViewerDataProvider, title: string): Promise<void> {
300-
const api = await this.getExtensionApi();
301-
if (api) {
302-
return api.showDataViewer(dataProvider, title);
303-
}
304-
return undefined;
305-
}
306-
307278
private async getExtensionApi(): Promise<JupyterExtensionApi | undefined> {
308279
if (!this.pylanceExtension) {
309280
const pylanceExtension = this.extensions.getExtension<PylanceApi>(PYLANCE_EXTENSION_ID);

0 commit comments

Comments
 (0)