description:localize('vscode.extension.contributes.view.id','Identifier of the view. Use this to register a data provider through `vscode.window.registerTreeDataProviderForView` API. Also to trigger activating your extension by registering `onView:${id}` event to `activationEvents`.'),
type:'string'
},
name:{
description:localize('vscode.extension.contributes.view.name','The human-readable name of the view. Will be shown'),
type:'string'
},
when:{
description:localize('vscode.extension.contributes.view.when','Condition which must be true to show this view'),
type:'string'
},
}
};
constviewsContribution:IJSONSchema={
description:localize('vscode.extension.contributes.views',"Contributes views to the editor"),
type:'object',
properties:{
'explorer':{
description:localize('views.explorer',"Contributes views to Explorer container in the Activity bar"),
type:'array',
items:viewDescriptor,
default:[]
},
'debug':{
description:localize('views.debug',"Contributes views to Debug container in the Activity bar"),
type:'array',
items:viewDescriptor,
default:[]
},
'scm':{
description:localize('views.scm',"Contributes views to SCM container in the Activity bar"),
type:'array',
items:viewDescriptor,
default:[]
},
'test':{
description:localize('views.test',"Contributes views to Test container in the Activity bar"),
type:'array',
items:viewDescriptor,
default:[]
}
},
additionalProperties:{
description:localize('views.contributed',"Contributes views to contributed views container"),
collector.warn(localize('ViewContainerDoesnotExist',"View container '{0}' does not exist and all views registered to it will be added to 'Explorer'.",entry.key));
collector.error(localize('requirearray',"views must be an array"));
returnfalse;
...
...
@@ -46,124 +174,26 @@ namespace schema {
returntrue;
}
constviewDescriptor:IJSONSchema={
type:'object',
properties:{
id:{
description:localize('vscode.extension.contributes.view.id','Identifier of the view. Use this to register a data provider through `vscode.window.registerTreeDataProviderForView` API. Also to trigger activating your extension by registering `onView:${id}` event to `activationEvents`.'),
type:'string'
},
name:{
description:localize('vscode.extension.contributes.view.name','The human-readable name of the view. Will be shown'),
type:'string'
},
when:{
description:localize('vscode.extension.contributes.view.when','Condition which must be true to show this view'),
type:'string'
},
}
};
exportconstviewsContribution:IJSONSchema={
description:localize('vscode.extension.contributes.views',"Contributes views to the editor"),
type:'object',
properties:{
'explorer':{
description:localize('views.explorer',"Contributes views to Explorer container in the Activity bar"),
type:'array',
items:viewDescriptor,
default:[]
},
'debug':{
description:localize('views.debug',"Contributes views to Debug container in the Activity bar"),
type:'array',
items:viewDescriptor,
default:[]
},
'scm':{
description:localize('views.scm',"Contributes views to SCM container in the Activity bar"),
type:'array',
items:viewDescriptor,
default:[]
},
'test':{
description:localize('views.test',"Contributes views to Test container in the Activity bar"),
type:'array',
items:viewDescriptor,
default:[]
}
},
additionalProperties:{
description:localize('views.contributed',"Contributes views to contributed views container"),
collector.warn(localize('ViewContainerDoesnotExist',"View container '{0}' does not exist and all views registered to it will be added to 'Explorer'.",entry.key));
collector.error(localize('duplicateView1',"Cannot register multiple views with same id `{0}` in the location `{1}`",viewDescriptor.id,viewDescriptor.location.id));
collector.error(localize('duplicateView2',"A view with id `{0}` is already registered in the location `{1}`",viewDescriptor.id,viewDescriptor.location.id));