From 2a4a27bb8308464c1b2d3eaf7e54f36659c88061 Mon Sep 17 00:00:00 2001 From: Paula Date: Wed, 27 Mar 2024 15:57:14 -0700 Subject: [PATCH] Fix input error in django and flask pickers (#292) * fix input error * fix filter on windows * fix lint --- package-lock.json | 37 ++++++------------- package.json | 12 +++--- src/extension/common/multiStepInput.ts | 13 +++++++ .../djangoProviderQuickPick.ts | 1 - .../flaskProviderQuickPick.ts | 1 - .../providerQuickPick/providerQuickPick.ts | 6 +-- tsconfig.json | 3 ++ 7 files changed, 36 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae06972b..e6b40ff5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "@typescript-eslint/eslint-plugin": "^5.31.0", "@typescript-eslint/parser": "^5.62.0", "@vscode/test-electron": "^2.3.9", - "@vscode/vsce": "^2.19.0", + "@vscode/vsce": "^2.24.0", "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "eslint": "^8.50.0", @@ -1134,15 +1134,15 @@ } }, "node_modules/@vscode/vsce": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.19.0.tgz", - "integrity": "sha512-dAlILxC5ggOutcvJY24jxz913wimGiUrHaPkk16Gm9/PGFbz1YezWtrXsTKUtJws4fIlpX2UIlVlVESWq8lkfQ==", + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.24.0.tgz", + "integrity": "sha512-p6CIXpH5HXDqmUkgFXvIKTjZpZxy/uDx4d/UsfhS9vQUun43KDNUbYeZocyAHgqcJlPEurgArHz9te1PPiqPyA==", "dev": true, "dependencies": { "azure-devops-node-api": "^11.0.1", "chalk": "^2.4.2", "cheerio": "^1.0.0-rc.9", - "commander": "^6.1.0", + "commander": "^6.2.1", "glob": "^7.0.6", "hosted-git-info": "^4.0.2", "jsonc-parser": "^3.2.0", @@ -1152,7 +1152,7 @@ "minimatch": "^3.0.3", "parse-semver": "^1.1.1", "read": "^1.0.7", - "semver": "^5.1.0", + "semver": "^7.5.2", "tmp": "^0.2.1", "typed-rest-client": "^1.8.4", "url-join": "^4.0.1", @@ -1190,15 +1190,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@vscode/vsce/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -7731,15 +7722,15 @@ } }, "@vscode/vsce": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.19.0.tgz", - "integrity": "sha512-dAlILxC5ggOutcvJY24jxz913wimGiUrHaPkk16Gm9/PGFbz1YezWtrXsTKUtJws4fIlpX2UIlVlVESWq8lkfQ==", + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.24.0.tgz", + "integrity": "sha512-p6CIXpH5HXDqmUkgFXvIKTjZpZxy/uDx4d/UsfhS9vQUun43KDNUbYeZocyAHgqcJlPEurgArHz9te1PPiqPyA==", "dev": true, "requires": { "azure-devops-node-api": "^11.0.1", "chalk": "^2.4.2", "cheerio": "^1.0.0-rc.9", - "commander": "^6.1.0", + "commander": "^6.2.1", "glob": "^7.0.6", "hosted-git-info": "^4.0.2", "jsonc-parser": "^3.2.0", @@ -7750,7 +7741,7 @@ "minimatch": "^3.0.3", "parse-semver": "^1.1.1", "read": "^1.0.7", - "semver": "^5.1.0", + "semver": "^7.5.2", "tmp": "^0.2.1", "typed-rest-client": "^1.8.4", "url-join": "^4.0.1", @@ -7772,12 +7763,6 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" } - }, - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true } } }, diff --git a/package.json b/package.json index 68b47b31..457eb7fb 100644 --- a/package.json +++ b/package.json @@ -73,10 +73,10 @@ ], "menus": { "issue/reporter": [ - { - "command": "debugpy.reportIssue" - } - ], + { + "command": "debugpy.reportIssue" + } + ], "commandPalette": [ { "category": "Python Debugger", @@ -525,7 +525,7 @@ "format-check": "prettier --check 'src/**/*.ts' 'build/**/*.yml' '.github/**/*.yml'", "format-fix": "prettier --write 'src/**/*.ts' 'build/**/*.yml' '.github/**/*.yml'", "test": "node ./out/test/runTest.js", - "vsce-package": "vsce package -o python-debugger.vsix" + "vsce-package": "npx @vscode/vsce package -o python-debugger.vsix" }, "devDependencies": { "@types/chai": "^4.3.4", @@ -541,7 +541,7 @@ "@typescript-eslint/eslint-plugin": "^5.31.0", "@typescript-eslint/parser": "^5.62.0", "@vscode/test-electron": "^2.3.9", - "@vscode/vsce": "^2.19.0", + "@vscode/vsce": "^2.24.0", "chai": "^4.3.7", "chai-as-promised": "^7.1.1", "eslint": "^8.50.0", diff --git a/src/extension/common/multiStepInput.ts b/src/extension/common/multiStepInput.ts index 614f7d61..395f9a75 100644 --- a/src/extension/common/multiStepInput.ts +++ b/src/extension/common/multiStepInput.ts @@ -214,6 +214,19 @@ export class MultiStepInput implements IMultiStepInput { // eslint-disable-next-line @typescript-eslint/no-explicit-any deferred.resolve(input.value as any); }), + input.onDidChangeSelection((selectedItems) => { + if (input.value) { + deferred.resolve(input.value as any); + } else { + deferred.resolve(selectedItems[0]); + } + }), + ); + } else { + disposables.push( + input.onDidChangeSelection((selectedItems) => { + deferred.resolve(selectedItems[0]); + }), ); } diff --git a/src/extension/debugger/configuration/providers/providerQuickPick/djangoProviderQuickPick.ts b/src/extension/debugger/configuration/providers/providerQuickPick/djangoProviderQuickPick.ts index 07feb0f9..177c3be5 100644 --- a/src/extension/debugger/configuration/providers/providerQuickPick/djangoProviderQuickPick.ts +++ b/src/extension/debugger/configuration/providers/providerQuickPick/djangoProviderQuickPick.ts @@ -30,7 +30,6 @@ export async function pickDjangoPrompt( placeholder: DebugConfigStrings.django.djangoConfigPromp.prompt, items: options, acceptFilterBoxTextAsSelection: true, - activeItem: options[0], matchOnDescription: true, title: DebugConfigStrings.django.djangoConfigPromp.title, onDidTriggerItemButton: async (e: QuickPickItemButtonEvent) => { diff --git a/src/extension/debugger/configuration/providers/providerQuickPick/flaskProviderQuickPick.ts b/src/extension/debugger/configuration/providers/providerQuickPick/flaskProviderQuickPick.ts index 6dfd3b27..935dea8f 100644 --- a/src/extension/debugger/configuration/providers/providerQuickPick/flaskProviderQuickPick.ts +++ b/src/extension/debugger/configuration/providers/providerQuickPick/flaskProviderQuickPick.ts @@ -28,7 +28,6 @@ export async function pickFlaskPrompt( placeholder: DebugConfigStrings.flask.flaskConfigPromp.prompt, items: options, acceptFilterBoxTextAsSelection: true, - activeItem: options[0], matchOnDescription: true, title: DebugConfigStrings.flask.flaskConfigPromp.title, onDidTriggerItemButton: async (e: QuickPickItemButtonEvent) => { diff --git a/src/extension/debugger/configuration/providers/providerQuickPick/providerQuickPick.ts b/src/extension/debugger/configuration/providers/providerQuickPick/providerQuickPick.ts index bf776f65..edb33f11 100644 --- a/src/extension/debugger/configuration/providers/providerQuickPick/providerQuickPick.ts +++ b/src/extension/debugger/configuration/providers/providerQuickPick/providerQuickPick.ts @@ -16,11 +16,11 @@ export const browseFileOption = { }; export async function openFileExplorer(folder: Uri | undefined) { - const filtersKey = 'Executables'; + const filtersKey = 'Python Files'; const filtersObject: { [name: string]: string[] } = {}; - filtersObject[filtersKey] = ['exe']; + filtersObject[filtersKey] = ['py']; return await window.showOpenDialog({ - filters: getOSType() == OSType.Windows ? filtersObject : undefined, + filters: getOSType() === OSType.Windows ? filtersObject : undefined, openLabel: DebugConfigStrings.browsePath.openButtonLabel, canSelectMany: false, title: DebugConfigStrings.browsePath.title, diff --git a/tsconfig.json b/tsconfig.json index 98e3a9a9..a8f1d68a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,9 @@ "ES2020" ], "sourceMap": true, + "typeRoots": [ + "./node_modules/@types" + ], "rootDir": "src", "strict": true, /* enable all strict type-checking options */ "experimentalDecorators": true,