File tree Expand file tree Collapse file tree
extensionManagement/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,6 +112,8 @@ export interface IExtensionContributions {
112112 remoteAuthorityResolvers ?: IRemoteAuthorityResolver [ ] ;
113113}
114114
115+ export type ExtensionKind = 'ui' | 'workspace' ;
116+
115117export interface IExtensionManifest {
116118 name : string ;
117119 publisher : string ;
@@ -126,6 +128,7 @@ export interface IExtensionManifest {
126128 activationEvents ?: string [ ] ;
127129 extensionDependencies ?: string [ ] ;
128130 extensionPack ?: string [ ] ;
131+ extensionKind ?: ExtensionKind ;
129132 contributes ?: IExtensionContributions ;
130133 repository ?: {
131134 url : string ;
Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
7+ import { IExtensionManifest } from 'vs/platform/extensionManagement/common/extensionManagement' ;
8+ import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil' ;
9+
610export const MANIFEST_CACHE_FOLDER = 'CachedExtensions' ;
711export const USER_MANIFEST_CACHE_FILE = 'user' ;
812export const BUILTIN_MANIFEST_CACHE_FILE = 'builtin' ;
13+
14+ const uiExtensions = new Set < string > ( ) ;
15+ uiExtensions . add ( 'msjsdiag.debugger-for-chrome' ) ;
16+
17+ export function isUIExtension ( manifest : IExtensionManifest , configurationService : IConfigurationService ) : boolean {
18+ const extensionId = getGalleryExtensionId ( manifest . publisher , manifest . name ) ;
19+ const configuredUIExtensions = configurationService . getValue < string [ ] > ( '_workbench.uiExtensions' ) || [ ] ;
20+ if ( configuredUIExtensions . length ) {
21+ if ( configuredUIExtensions . indexOf ( extensionId ) !== - 1 ) {
22+ return true ;
23+ }
24+ if ( configuredUIExtensions . indexOf ( `-${ extensionId } ` ) !== - 1 ) {
25+ return false ;
26+ }
27+ }
28+ switch ( manifest . extensionKind ) {
29+ case 'ui' : return true ;
30+ case 'workspace' : return false ;
31+ default : return uiExtensions . has ( extensionId ) || ! manifest . main ;
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments