File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed
Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,14 @@ export function getExtension<T = any>(extensionId: string): Extension<T> | undef
88export function allExtensions ( ) : readonly Extension < any > [ ] {
99 return extensions . all ;
1010}
11+
12+ export function allExternalExtensions ( ) : readonly Extension < any > [ ] {
13+ return allExtensions ( ) . filter ( ( extension ) => {
14+ try {
15+ return extension . packageJSON . publisher !== 'vscode' ;
16+ } catch {
17+ // No publisher
18+ return false ;
19+ }
20+ } ) ;
21+ }
Original file line number Diff line number Diff line change 11import { l10n , SecretStorage } from 'vscode' ;
2- import { pickExtension } from './pickers' ;
2+ import { pickExtensionForPermissions } from './pickers' ;
33import { showInformationMessage , showWarningMessage } from '../../common/window.apis' ;
44import { PermissionsCommon } from '../../common/localize' ;
55import { traceLog } from '../../common/logging' ;
6- import { allExtensions } from '../../common/extension.apis' ;
6+ import { allExternalExtensions } from '../../common/extension.apis' ;
77import { getCallingExtension } from '../../common/utils/frameUtils' ;
88
99type PermissionType = 'Ask' | 'Allow' | 'Deny' ;
@@ -42,7 +42,7 @@ export class PackageManagerPermissionsImpl implements PackageManagerPermissions
4242 }
4343
4444 async resetPermissions ( ) : Promise < void > {
45- const ids = allExtensions ( ) . map ( ( e ) => `python-envs.permissions.packageManagement.${ e . id } ` ) ;
45+ const ids = allExternalExtensions ( ) . map ( ( e ) => `python-envs.permissions.packageManagement.${ e . id } ` ) ;
4646 await Promise . all ( ids . map ( ( id ) => this . secretStore . delete ( id ) ) ) ;
4747 traceLog ( 'All package management permissions have been reset.' ) ;
4848 }
@@ -180,7 +180,7 @@ export async function checkPackageManagementPermissions(
180180}
181181
182182export async function handlePermissionsCommand ( pm : PermissionsManager < PermissionType > , extensionId ?: string ) {
183- extensionId = extensionId ?? ( await pickExtension ( ) ) ;
183+ extensionId = extensionId ?? ( await pickExtensionForPermissions ( ) ) ;
184184 if ( ! extensionId ) {
185185 return ;
186186 }
Original file line number Diff line number Diff line change 11import { Extension , QuickPickItem } from 'vscode' ;
2- import { allExtensions } from '../../common/extension.apis' ;
2+ import { allExternalExtensions } from '../../common/extension.apis' ;
33import { showQuickPick } from '../../common/window.apis' ;
44
55function getExtensionName ( ext : Extension < unknown > ) : string {
@@ -11,7 +11,7 @@ function getExtensionName(ext: Extension<unknown>): string {
1111}
1212
1313function getExtensionItems ( ) : QuickPickItem [ ] {
14- const extensions = allExtensions ( ) ;
14+ const extensions = allExternalExtensions ( ) ;
1515 return extensions . map ( ( ext ) => {
1616 return {
1717 description : ext . id ,
@@ -20,7 +20,7 @@ function getExtensionItems(): QuickPickItem[] {
2020 } ) ;
2121}
2222
23- export async function pickExtension ( ) : Promise < string | undefined > {
23+ export async function pickExtensionForPermissions ( ) : Promise < string | undefined > {
2424 const items = getExtensionItems ( ) ;
2525
2626 const result = await showQuickPick ( items , {
You can’t perform that action at this time.
0 commit comments