Skip to content

Commit 2a4a27b

Browse files
Fix input error in django and flask pickers (#292)
* fix input error * fix filter on windows * fix lint
1 parent 0b5edc2 commit 2a4a27b

File tree

7 files changed

+36
-37
lines changed

7 files changed

+36
-37
lines changed

package-lock.json

+11-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
],
7474
"menus": {
7575
"issue/reporter": [
76-
{
77-
"command": "debugpy.reportIssue"
78-
}
79-
],
76+
{
77+
"command": "debugpy.reportIssue"
78+
}
79+
],
8080
"commandPalette": [
8181
{
8282
"category": "Python Debugger",
@@ -525,7 +525,7 @@
525525
"format-check": "prettier --check 'src/**/*.ts' 'build/**/*.yml' '.github/**/*.yml'",
526526
"format-fix": "prettier --write 'src/**/*.ts' 'build/**/*.yml' '.github/**/*.yml'",
527527
"test": "node ./out/test/runTest.js",
528-
"vsce-package": "vsce package -o python-debugger.vsix"
528+
"vsce-package": "npx @vscode/vsce package -o python-debugger.vsix"
529529
},
530530
"devDependencies": {
531531
"@types/chai": "^4.3.4",
@@ -541,7 +541,7 @@
541541
"@typescript-eslint/eslint-plugin": "^5.31.0",
542542
"@typescript-eslint/parser": "^5.62.0",
543543
"@vscode/test-electron": "^2.3.9",
544-
"@vscode/vsce": "^2.19.0",
544+
"@vscode/vsce": "^2.24.0",
545545
"chai": "^4.3.7",
546546
"chai-as-promised": "^7.1.1",
547547
"eslint": "^8.50.0",

src/extension/common/multiStepInput.ts

+13
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,19 @@ export class MultiStepInput<S> implements IMultiStepInput<S> {
214214
// eslint-disable-next-line @typescript-eslint/no-explicit-any
215215
deferred.resolve(input.value as any);
216216
}),
217+
input.onDidChangeSelection((selectedItems) => {
218+
if (input.value) {
219+
deferred.resolve(input.value as any);
220+
} else {
221+
deferred.resolve(selectedItems[0]);
222+
}
223+
}),
224+
);
225+
} else {
226+
disposables.push(
227+
input.onDidChangeSelection((selectedItems) => {
228+
deferred.resolve(selectedItems[0]);
229+
}),
217230
);
218231
}
219232

src/extension/debugger/configuration/providers/providerQuickPick/djangoProviderQuickPick.ts

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export async function pickDjangoPrompt(
3030
placeholder: DebugConfigStrings.django.djangoConfigPromp.prompt,
3131
items: options,
3232
acceptFilterBoxTextAsSelection: true,
33-
activeItem: options[0],
3433
matchOnDescription: true,
3534
title: DebugConfigStrings.django.djangoConfigPromp.title,
3635
onDidTriggerItemButton: async (e: QuickPickItemButtonEvent<QuickPickType>) => {

src/extension/debugger/configuration/providers/providerQuickPick/flaskProviderQuickPick.ts

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export async function pickFlaskPrompt(
2828
placeholder: DebugConfigStrings.flask.flaskConfigPromp.prompt,
2929
items: options,
3030
acceptFilterBoxTextAsSelection: true,
31-
activeItem: options[0],
3231
matchOnDescription: true,
3332
title: DebugConfigStrings.flask.flaskConfigPromp.title,
3433
onDidTriggerItemButton: async (e: QuickPickItemButtonEvent<QuickPickType>) => {

src/extension/debugger/configuration/providers/providerQuickPick/providerQuickPick.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export const browseFileOption = {
1616
};
1717

1818
export async function openFileExplorer(folder: Uri | undefined) {
19-
const filtersKey = 'Executables';
19+
const filtersKey = 'Python Files';
2020
const filtersObject: { [name: string]: string[] } = {};
21-
filtersObject[filtersKey] = ['exe'];
21+
filtersObject[filtersKey] = ['py'];
2222
return await window.showOpenDialog({
23-
filters: getOSType() == OSType.Windows ? filtersObject : undefined,
23+
filters: getOSType() === OSType.Windows ? filtersObject : undefined,
2424
openLabel: DebugConfigStrings.browsePath.openButtonLabel,
2525
canSelectMany: false,
2626
title: DebugConfigStrings.browsePath.title,

tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"ES2020"
1111
],
1212
"sourceMap": true,
13+
"typeRoots": [
14+
"./node_modules/@types"
15+
],
1316
"rootDir": "src",
1417
"strict": true, /* enable all strict type-checking options */
1518
"experimentalDecorators": true,

0 commit comments

Comments
 (0)