33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ import * as nls from 'vs/nls' ;
67import { Disposable , IDisposable } from 'vs/base/common/lifecycle' ;
78import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey' ;
89import { IWorkbenchContribution } from 'vs/workbench/common/contributions' ;
9- import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensionsRegistry' ;
10+ import { IExtensionPoint , IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry' ;
1011import { ViewsWelcomeExtensionPoint , ViewWelcome , ViewIdentifierMap } from './viewsWelcomeExtensionPoint' ;
1112import { Registry } from 'vs/platform/registry/common/platform' ;
1213import { Extensions as ViewContainerExtensions , IViewsRegistry } from 'vs/workbench/common/views' ;
@@ -34,7 +35,7 @@ export class ViewsWelcomeContribution extends Disposable implements IWorkbenchCo
3435 for ( const contribution of added ) {
3536 for ( const welcome of contribution . value ) {
3637 const id = ViewIdentifierMap [ welcome . view ] ?? welcome . view ;
37- const { group, order } = parseGroupAndOrder ( welcome ) ;
38+ const { group, order } = parseGroupAndOrder ( welcome , contribution ) ;
3839 const disposable = viewsRegistry . registerViewWelcomeContent ( id , {
3940 content : welcome . contents ,
4041 when : ContextKeyExpr . deserialize ( welcome . when ) ,
@@ -49,10 +50,16 @@ export class ViewsWelcomeContribution extends Disposable implements IWorkbenchCo
4950 }
5051}
5152
52- function parseGroupAndOrder ( welcome : ViewWelcome ) : { group : string | undefined , order : number | undefined } {
53+ function parseGroupAndOrder ( welcome : ViewWelcome , contribution : IExtensionPointUser < ViewsWelcomeExtensionPoint > ) : { group : string | undefined , order : number | undefined } {
54+
5355 let group : string | undefined ;
5456 let order : number | undefined ;
5557 if ( welcome . group ) {
58+ if ( ! contribution . description . enableProposedApi ) {
59+ contribution . collector . warn ( nls . localize ( 'ViewsWelcomeExtensionPoint.proposedAPI' , "The viewsWelcome contribution in '{0}' requires 'enableProposedApi' to be enabled." , contribution . description . identifier . value ) ) ;
60+ return { group, order } ;
61+ }
62+
5663 const idx = welcome . group . lastIndexOf ( '@' ) ;
5764 if ( idx > 0 ) {
5865 group = welcome . group . substr ( 0 , idx ) ;
0 commit comments