Skip to content
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
1 change: 1 addition & 0 deletions news/1 Enhancements/17043.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for dynamic updates in interpreter list.
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"Interpreters.RefreshingInterpreters": "Refreshing Python Interpreters",
"Interpreters.entireWorkspace": "Entire workspace",
"Interpreters.pythonInterpreterPath": "Python interpreter path: {0}",
"Interpreters.LoadingInterpreters": "Loading Python Interpreters",
"Interpreters.DiscoveringInterpreters": "Discovering Python Interpreters",
"Interpreters.condaInheritEnvMessage": "We noticed you're using a conda environment. If you are experiencing issues with this environment in the integrated terminal, we recommend that you let the Python extension change \"terminal.integrated.inheritEnv\" to false in your user settings.",
"Logging.CurrentWorkingDirectory": "cwd:",
"InterpreterQuickPickList.quickPickListPlaceholder": "Current: {0}",
Expand Down
1 change: 0 additions & 1 deletion package.nls.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"LanguageService.lsFailedToDownload": "We zijn een probleem tegengekomen bij het downloaden van de language server. Aan het terugschakelen naar het alternatief, Jedi. Bekijk het weergavepaneel voor details.",
"LanguageService.lsFailedToExtract": "We zijn een probleem tegengekomen bij het uitpakken van de language server. Aan het terugschakelen naar het alternatief, Jedi. Bekijk het weergavepaneel voor details.",
"Interpreters.RefreshingInterpreters": "Python-Interpreters verversen",
"Interpreters.LoadingInterpreters": "Python-Interpreters laden",
"Linter.InstalledButNotEnabled": "Linter {0} is geinstalleerd maar niet ingeschakeld.",
"Linter.replaceWithSelectedLinter": "Meerdere linters zijn ingeschakeld in de instellingen. Vervangen met '{0}'?",
"diagnostics.warnSourceMaps": "Bronkaartondersteuning is ingeschakeld in de Python-extensie, dit zal een ongunstige impact hebben op de uitvoering van de extensie.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"Interpreters.RefreshingInterpreters": "正在刷新 Python 解释器",
"Interpreters.entireWorkspace": "完整工作区",
"Interpreters.pythonInterpreterPath": "Python 解释器路径: {0}",
"Interpreters.LoadingInterpreters": "正在加载 Python 解释器",
"Interpreters.condaInheritEnvMessage": "您正在使用 conda 环境,如果您在集成终端中遇到相关问题,建议您允许 Python 扩展将用户设置中的 \"terminal.integrated.inheritEnv\" 改为 false。",
"Logging.CurrentWorkingDirectory": "cwd:",
"InterpreterQuickPickList.quickPickListPlaceholder": "当前: {0}",
Expand Down
1 change: 0 additions & 1 deletion package.nls.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"LanguageService.lsFailedToExtract": "擷取語言伺服器時遇到問題。改回使用替代方案 \"Jedi\"。請檢查 Python 輸出面板以取得更多資訊。",
"Experiments.inGroup": "使用者屬於 \"{0}\" 實驗性群組",
"Interpreters.RefreshingInterpreters": "正在重新整理 Python 解譯器",
"Interpreters.LoadingInterpreters": "正在載入 Python 解譯器",
"Interpreters.condaInheritEnvMessage": "我們發覺到您在使用 conda 環境。如果你在整合式終端器中使用這個環境時遇到問題,建議您讓 Python 延伸模組變更使用者設定中的 \"terminal.integrated.inheritEnv\" 為 false。",
"Logging.CurrentWorkingDirectory": "cwd:",
"Common.doNotShowAgain": "不再顯示",
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/utils/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DeferredImpl<T> implements Deferred<T> {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
export function createDeferred<T>(scope: any = null): Deferred<T> {
export function createDeferred<T = void>(scope: any = null): Deferred<T> {
return new DeferredImpl<T>(scope);
}

Expand Down
2 changes: 1 addition & 1 deletion src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export namespace Experiments {
export const optedOutOf = localize('Experiments.optedOutOf', "User opted out of experiment group '{0}'");
}
export namespace Interpreters {
export const loading = localize('Interpreters.LoadingInterpreters', 'Loading Python Interpreters');
export const discovering = localize('Interpreters.DiscoveringInterpreters', 'Discovering Python Interpreters');
export const refreshing = localize('Interpreters.RefreshingInterpreters', 'Refreshing Python Interpreters');
export const condaInheritEnvMessage = localize(
'Interpreters.condaInheritEnvMessage',
Expand Down
19 changes: 17 additions & 2 deletions src/client/common/utils/multiStepInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

import { inject, injectable } from 'inversify';
import { Disposable, QuickInput, QuickInputButton, QuickInputButtons, QuickPick, QuickPickItem } from 'vscode';
import { Disposable, QuickInput, QuickInputButton, QuickInputButtons, QuickPick, QuickPickItem, Event } from 'vscode';
import { IApplicationShell } from '../application/types';

// Borrowed from https://github.com/Microsoft/vscode-extension-samples/blob/master/quickinput-sample/src/multiStepInput.ts
Expand Down Expand Up @@ -39,7 +39,8 @@ type QuickInputButtonSetup = {
*/
callback: buttonCallbackType<QuickPickItem>;
};
export interface IQuickPickParameters<T extends QuickPickItem> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface IQuickPickParameters<T extends QuickPickItem, E = any> {
title?: string;
step?: number;
totalSteps?: number;
Expand All @@ -50,7 +51,13 @@ export interface IQuickPickParameters<T extends QuickPickItem> {
customButtonSetup?: QuickInputButtonSetup;
matchOnDescription?: boolean;
matchOnDetail?: boolean;
keepScrollPosition?: boolean;
sortByLabel?: boolean;
acceptFilterBoxTextAsSelection?: boolean;
onChangeItem?: {
callback: (event: E, quickPick: QuickPick<T>) => Promise<void>;
event: Event<E>;
};
}

interface InputBoxParameters {
Expand Down Expand Up @@ -110,13 +117,18 @@ export class MultiStepInput<S> implements IMultiStepInput<S> {
matchOnDescription,
matchOnDetail,
acceptFilterBoxTextAsSelection,
onChangeItem,
keepScrollPosition,
sortByLabel,
}: P): Promise<MultiStepInputQuickPicResponseType<T, P>> {
const disposables: Disposable[] = [];
try {
return await new Promise<MultiStepInputQuickPicResponseType<T, P>>((resolve, reject) => {
const input = this.shell.createQuickPick<T>();
input.title = title;
input.step = step;
input.keepScrollPosition = keepScrollPosition;
input.sortByLabel = sortByLabel || false;
input.totalSteps = totalSteps;
input.placeholder = placeholder;
input.ignoreFocusOut = true;
Expand Down Expand Up @@ -160,6 +172,9 @@ export class MultiStepInput<S> implements IMultiStepInput<S> {
this.current.dispose();
}
this.current = input;
if (onChangeItem) {
disposables.push(onChangeItem.event((e) => onChangeItem.callback(e, input)));
}
this.current.show();
});
} finally {
Expand Down
Loading