diff --git a/.vscode/launch.json b/.vscode/launch.json index 7f07c90..7e1b2c6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,24 +15,10 @@ "outFiles": [ "${workspaceFolder}/out/**/*.js" ], - "preLaunchTask": "${defaultBuildTask}", - + "env": { "TEST_DEVWORKSPACE_NAME": "remote-plugin-runner" } - }, - { - "name": "Extension Tests", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}", - "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" - ], - "outFiles": [ - "${workspaceFolder}/out/test/**/*.js" - ], - "preLaunchTask": "${defaultBuildTask}" } ] } diff --git a/src/command/new-environment-variable.ts b/src/command/new-environment-variable.ts index f69be44..b227b22 100644 --- a/src/command/new-environment-variable.ts +++ b/src/command/new-environment-variable.ts @@ -40,7 +40,7 @@ export class NewEnvironmentVariableImpl implements NewEnvironmentVariable { const environmentVariable = await this.defineEnvironmentVariable(); if (environmentVariable) { // update Devfile, show a popup with proposal to open the Devfile - await this.saveDevfile.onDidDevfileUpdate(`Environmane '${environmentVariable.name}' has been created successfully`); + await this.saveDevfile.onDidDevfileUpdate(`Environment variable '${environmentVariable.name}' has been created successfully`); return true; } diff --git a/src/devfile-extension.ts b/src/devfile-extension.ts index dead01b..92d8114 100644 --- a/src/devfile-extension.ts +++ b/src/devfile-extension.ts @@ -17,6 +17,28 @@ import { initBindings } from './bindings'; import { InstallYaml } from './command/install-yaml'; export async function activate(context: vscode.ExtensionContext): Promise { + // Due to the bug in the upstream https://github.com/microsoft/vscode/issues/214787 it is not possible to show + // several sequential popups. To prevent popup disappear it needs to add a small delay between two popups. + + // Keep the original functions + const _showQuickPick = vscode.window.showQuickPick; + const _showInputBox = vscode.window.showInputBox; + + // Replace with functions with a small delay + Object.assign(vscode.window, { + showQuickPick: async (items, options, token) => { + const result = await _showQuickPick(items, options, token); + await new Promise(resolve => setTimeout(resolve, 300)); + return result; + }, + + showInputBox: async (options, token) => { + const result = await _showInputBox(options, token); + await new Promise(resolve => setTimeout(resolve, 300)); + return result; + } + }); + const container = initBindings(); container.get(DevfileExtensionImpl).start(context); }