3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- import { coalesce } from 'vs/base/common/arrays' ;
7
6
import { IJSONSchema } from 'vs/base/common/jsonSchema' ;
8
7
import * as resources from 'vs/base/common/resources' ;
9
8
import { isFalsyOrWhitespace } from 'vs/base/common/strings' ;
@@ -477,15 +476,18 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
477
476
collector . warn ( localize ( 'ViewContainerDoesnotExist' , "View container '{0}' does not exist and all views registered to it will be added to 'Explorer'." , key ) ) ;
478
477
}
479
478
const container = viewContainer || this . getDefaultViewContainer ( ) ;
480
- const viewDescriptors = coalesce ( value . map ( ( item , index ) => {
479
+ const viewDescriptors : ICustomViewDescriptor [ ] = [ ] ;
480
+
481
+ for ( let index = 0 ; index < value . length ; index ++ ) {
482
+ const item = value [ index ] ;
481
483
// validate
482
484
if ( viewIds . has ( item . id ) ) {
483
485
collector . error ( localize ( 'duplicateView1' , "Cannot register multiple views with same id `{0}`" , item . id ) ) ;
484
- return null ;
486
+ continue ;
485
487
}
486
488
if ( this . viewsRegistry . getView ( item . id ) !== null ) {
487
489
collector . error ( localize ( 'duplicateView2' , "A view with id `{0}` is already registered." , item . id ) ) ;
488
- return null ;
490
+ continue ;
489
491
}
490
492
491
493
const order = ExtensionIdentifier . equals ( extension . description . identifier , container . extensionId )
@@ -504,7 +506,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
504
506
const type = this . getViewType ( item . type ) ;
505
507
if ( ! type ) {
506
508
collector . error ( localize ( 'unknownViewType' , "Unknown view type `{0}`." , item . type ) ) ;
507
- return null ;
509
+ continue ;
508
510
}
509
511
510
512
let weight : number | undefined = undefined ;
@@ -541,8 +543,8 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
541
543
542
544
543
545
viewIds . add ( viewDescriptor . id ) ;
544
- return viewDescriptor ;
545
- } ) ) ;
546
+ viewDescriptors . push ( viewDescriptor ) ;
547
+ }
546
548
547
549
allViewDescriptors . push ( { viewContainer : container , views : viewDescriptors } ) ;
548
550
0 commit comments