@@ -31,6 +31,7 @@ import {
3131 IInterpreterDisplay ,
3232 IInterpreterService ,
3333 IInterpreterStatusbarVisibilityFilter ,
34+ PythonEnvironmentsChangedEvent ,
3435} from '../interpreter/contracts' ;
3536import { PythonEnvironment } from '../pythonEnvironments/info' ;
3637import { IDataViewerDataProvider , IJupyterUriProvider } from './types' ;
@@ -72,6 +73,19 @@ type PythonApiForJupyterExtension = {
7273 /**
7374 * IInterpreterService
7475 */
76+ readonly refreshPromise : Promise < void > | undefined ;
77+ /**
78+ * IInterpreterService
79+ */
80+ readonly onDidChangeInterpreters : Event < PythonEnvironmentsChangedEvent > ;
81+ /**
82+ * Equivalent to getInterpreters() in IInterpreterService
83+ */
84+ getKnownInterpreters ( resource ?: Uri ) : PythonEnvironment [ ] ;
85+ /**
86+ * @deprecated Use `getKnownInterpreters`, `onDidChangeInterpreters`, and `refreshPromise` instead.
87+ * Equivalent to getAllInterpreters() in IInterpreterService
88+ */
7589 getInterpreters ( resource ?: Uri ) : Promise < PythonEnvironment [ ] > ;
7690 /**
7791 * IInterpreterService
@@ -91,6 +105,11 @@ type PythonApiForJupyterExtension = {
91105 allowExceptions ?: boolean ,
92106 ) : Promise < NodeJS . ProcessEnv | undefined > ;
93107 isWindowsStoreInterpreter ( pythonPath : string ) : Promise < boolean > ;
108+ suggestionToQuickPickItem ( suggestion : PythonEnvironment , workspaceUri ?: Uri | undefined ) : IInterpreterQuickPickItem ;
109+ getKnownSuggestions ( resource : Resource ) : Promise < IInterpreterQuickPickItem [ ] > ;
110+ /**
111+ * @deprecated Use `getKnownSuggestions` and `suggestionToQuickPickItem` instead.
112+ */
94113 getSuggestions ( resource : Resource ) : Promise < IInterpreterQuickPickItem [ ] > ;
95114 /**
96115 * IInstaller
@@ -170,6 +189,9 @@ export class JupyterExtensionIntegration {
170189 getActiveInterpreter : async ( resource ?: Uri ) => this . interpreterService . getActiveInterpreter ( resource ) ,
171190 getInterpreterDetails : async ( pythonPath : string ) =>
172191 this . interpreterService . getInterpreterDetails ( pythonPath ) ,
192+ refreshPromise : this . interpreterService . refreshPromise ,
193+ onDidChangeInterpreters : this . interpreterService . onDidChangeInterpreters ,
194+ getKnownInterpreters : ( resource : Uri | undefined ) => this . pyenvs . getInterpreters ( resource ) ,
173195 getInterpreters : async ( resource : Uri | undefined ) => this . interpreterService . getAllInterpreters ( resource ) ,
174196 getActivatedEnvironmentVariables : async (
175197 resource : Resource ,
@@ -184,6 +206,13 @@ export class JupyterExtensionIntegration {
184206 } ,
185207 getSuggestions : async ( resource : Resource ) : Promise < IInterpreterQuickPickItem [ ] > =>
186208 this . interpreterSelector . getAllSuggestions ( resource ) ,
209+ getKnownSuggestions : async ( resource : Resource ) : Promise < IInterpreterQuickPickItem [ ] > =>
210+ this . interpreterSelector . getSuggestions ( resource ) ,
211+ suggestionToQuickPickItem : (
212+ suggestion : PythonEnvironment ,
213+ workspaceUri ?: Uri | undefined ,
214+ ) : IInterpreterQuickPickItem =>
215+ this . interpreterSelector . suggestionToQuickPickItem ( suggestion , workspaceUri ) ,
187216 install : async (
188217 product : JupyterProductToInstall ,
189218 resource ?: InterpreterUri ,
0 commit comments