Skip to content

Commit 0f218bd

Browse files
authored
fix(): "API proposal" error for older vscode #2822
Problem: Error on vscode 1.63 or older: 2022-08-10 18:29:21 [ERROR]: aws.login: Error: Extension 'amazonwebservices.aws-toolkit-vscode' CANNOT use API proposal: quickPickSeparators. Its package.json#enabledApiProposals-property declares: [] but NOT quickPickSeparators. The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api amazonwebservices.aws-toolkit-vscode Solution: Check vscode version instead of relying on feature-detection. ref #2820
1 parent f8ac944 commit 0f218bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shared/credentials/defaultCredentialSelectionDataProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// Based on the multiStepInput code in the QuickInput VSCode extension sample.
1313

1414
import * as vscode from 'vscode'
15+
import * as semver from 'semver'
1516
import * as nls from 'vscode-nls'
1617
const localize = nls.loadMessageBundle()
1718

@@ -51,7 +52,7 @@ export class DefaultCredentialSelectionDataProvider implements CredentialSelecti
5152
state: Partial<CredentialSelectionState>
5253
): Promise<vscode.QuickPickItem> {
5354
// Remove this stub after we bump minimum to vscode 1.64
54-
const QuickPickItemKind = (vscode as any).QuickPickItemKind
55+
const QuickPickItemKind = semver.gte(vscode.version, '1.64.0') ? (vscode as any).QuickPickItemKind : undefined
5556
const menuTop: vscode.QuickPickItem[] = [
5657
// vscode 1.64 supports QuickPickItemKind.Separator.
5758
// https://github.com/microsoft/vscode/commit/eb416b4f9ebfda1c798aa7c8b2f4e81c6ce1984f

0 commit comments

Comments
 (0)