ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / api / browser / viewsExtensionPoint.ts 761 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
import { MarkdownString } from '../../../base/common/htmlContent.js' ;
import { IJSONSchema } from '../../../base/common/jsonSchema.js' ;
import { Disposable } from '../../../base/common/lifecycle.js' ;
import * as resources from '../../../base/common/resources.js' ;
import { isFalsyOrWhitespace } from '../../../base/common/strings.js' ;
import { ThemeIcon } from '../../../base/common/themables.js' ;
import { URI } from '../../../base/common/uri.js' ;
import { localize }
ContextKeyExpr
ExtensionIdentifier ExtensionIdentifierSet IExtensionDescription IExtensionManifest
SyncDescriptor
IInstantiationService
ILogService
Registry
PaneCompositeRegistry Extensions ViewletExtensions
CustomTreeView TreeViewPane
ViewPaneContainer
IWorkbenchContribution WorkbenchPhase registerWorkbenchContribution2
ICustomViewDescriptor IViewContainersRegistry IViewDescriptor IViewsRegistry ViewContainer Extensions ViewContainerExtensions ViewContainerLocation
WebviewViewPane
Extensions ExtensionFeaturesRegistryExtensions IExtensionFeatureTableRenderer IExtensionFeaturesRegistry IRenderedData IRowData ITableData
isProposedApiEnabled
ExtensionMessageCollector ExtensionsRegistry IExtensionPoint IExtensionPointUser
id
title
icon
viewsContainerSchema IJSONSchema
type
properties
id
description key comment
type
pattern
title
description
type
icon
description
type
required
viewsContainersContribution IJSONSchema
description
type
properties
description
type
items viewsContainerSchema
description
type
items viewsContainerSchema
description
type
items viewsContainerSchema
additionalProperties
ViewType
Tree
Webview
type ViewType
id
name
when
icon
contextualTitle
visibility
initialSize
remoteName
virtualWorkspace
accessibilityHelpContent
InitialVisibility
Visible
Hidden
Collapsed
viewDescriptor IJSONSchema
type
required
defaultSnippets body id name icon
properties
type
markdownDescription
type
markdownEnumDescriptions
id
markdownDescription
type
name
description
type
when
description
type
icon
description
type
contextualTitle
description
type
visibility
description
type
enumDescriptions
initialSize
type
description
accessibilityHelpContent
type
markdownDescription
remoteViewDescriptor IJSONSchema
type
required
properties
id
description
type
name
description
type
when
description
type
group
description
type
remoteName
description
type
items
type
viewsContribution IJSONSchema
description
type
properties
description
type
items viewDescriptor
description
type
items viewDescriptor
description
type
items viewDescriptor
description
type
items viewDescriptor
description
type
items remoteViewDescriptor
additionalProperties
description
type
items viewDescriptor
loc IUserFriendlyViewsContainerDescriptor
viewsContainersExtensionPoint IExtensionPoint ViewContainerExtensionPointType ExtensionsRegistry
extensionPoint
jsonSchema viewsContainersContribution
loc IUserFriendlyViewDescriptor
viewsExtensionPoint IExtensionPoint ViewExtensionPointType ExtensionsRegistry
extensionPoint
deps viewsContainersExtensionPoint
jsonSchema viewsContribution
viewExtensionPointTypeArray
viewExtensionPointType viewExtensionPointTypeArray
viewDescriptors Object viewExtensionPointType
viewDescriptor viewDescriptors
viewDescriptor id
viewContainersRegistry IViewContainersRegistry
viewsRegistry IViewsRegistry
instantiationService IInstantiationService
logService ILogService
viewContainersRegistry Registry ViewContainerExtensions ViewContainersRegistry
viewsRegistry Registry ViewContainerExtensions ViewsRegistry
viewsContainersExtensionPoint extensions added removed
removed length
removed
added length
added viewContainersRegistry all
extensionPoints IExtensionPointUser ViewContainerExtensionPointType existingViewContainers ViewContainer
viewContainersRegistry Registry ViewContainerExtensions ViewContainersRegistry
activityBarOrder viewContainersRegistry all v v extensionId viewContainersRegistry v ViewContainerLocation Sidebar length
panelOrder viewContainersRegistry all v v extensionId viewContainersRegistry v ViewContainerLocation Panel length
auxiliaryBarOrder viewContainersRegistry all v v extensionId viewContainersRegistry v ViewContainerLocation AuxiliaryBar length
value collector description extensionPoints
Object value key value
value collector
key
activityBarOrder value description activityBarOrder existingViewContainers ViewContainerLocation Sidebar
panelOrder value description panelOrder existingViewContainers ViewContainerLocation Panel
auxiliaryBarOrder value description auxiliaryBarOrder existingViewContainers ViewContainerLocation AuxiliaryBar
extensionPoints IExtensionPointUser ViewContainerExtensionPointType
viewContainersRegistry Registry ViewContainerExtensions ViewContainersRegistry
removedExtensions ExtensionIdentifierSet extensionPoints result e result e description identifier result
viewContainer viewContainersRegistry all
viewContainer extensionId removedExtensions viewContainer extensionId
views viewsRegistry viewContainer
views length
viewsRegistry views
viewContainer
viewsContainersDescriptors IUserFriendlyViewsContainerDescriptor collector ExtensionMessageCollector
viewsContainersDescriptors
collector
descriptor viewsContainersDescriptors
descriptor id descriptor id
collector
descriptor id
collector
descriptor title
collector
descriptor icon
collector
descriptor title
collector
containers IUserFriendlyViewsContainerDescriptor extension IExtensionDescription order existingViewContainers ViewContainer location ViewContainerLocation
containers descriptor
themeIcon ThemeIcon descriptor icon
icon themeIcon resources extension extensionLocation descriptor icon
id
title descriptor title id
viewContainer id title icon order extension identifier location
existingViewContainers length
viewsToMove IViewDescriptor
existingViewContainer existingViewContainers
viewContainer existingViewContainer
viewsToMove viewsRegistry existingViewContainer view view ICustomViewDescriptor originalContainerId descriptor id
viewsToMove length
viewsRegistry viewsToMove viewContainer
order
id title icon ThemeIcon order extensionId ExtensionIdentifier location ViewContainerLocation ViewContainer
viewContainer viewContainersRegistry id
viewContainer
viewContainer viewContainersRegistry
id
title value title original title
extensionId
ctorDescriptor
ViewPaneContainer
id mergeViewWithContainerWhenSingleView
hideIfEmpty
order
icon
location
viewContainer
viewContainer ViewContainer
viewContainersRegistry viewContainer
Registry ViewletExtensions Viewlets viewContainer id
viewsExtensionPoint extensions added removed
removed length
removed
added length
added
extensions IExtensionPointUser ViewExtensionPointType
viewIds Set
allViewDescriptors views IViewDescriptor viewContainer ViewContainer
extension extensions
value collector extension
Object value key value
value collector
key extension description
collector key
key extension description
collector key
viewContainer key
viewContainer
collector key
container viewContainer
viewDescriptors ICustomViewDescriptor
index index value length index
item value index
viewIds item id
collector item id
viewsRegistry item id
collector item id
order ExtensionIdentifier extension description identifier container extensionId
index
container viewOrderDelegate
container viewOrderDelegate item group
icon ThemeIcon
item icon
icon ThemeIcon item icon resources extension description extensionLocation item icon
initialVisibility item visibility
type item type
type
collector item type
weight
item initialSize
container extensionId value extension description identifier value
weight item initialSize
logService
accessibilityHelpContent
extension description item accessibilityHelpContent
accessibilityHelpContent item accessibilityHelpContent
viewDescriptor ICustomViewDescriptor
type type
ctorDescriptor type ViewType Tree TreeViewPane WebviewViewPane
id item id
name value item name original item name
when ContextKeyExpr item when
containerIcon icon viewContainer icon
containerTitle item contextualTitle viewContainer viewContainer title viewContainer title viewContainer title value
canToggleVisibility
canMoveView viewContainer id
treeView type ViewType Tree instantiationService CustomTreeView item id item name extension description identifier value
collapsed container initialVisibility InitialVisibility Collapsed
order order
extensionId extension description identifier
originalContainerId key
group item group
remoteAuthority item remoteName item remoteAuthority
virtualWorkspace item virtualWorkspace
hideByDefault initialVisibility InitialVisibility Hidden
workspace viewContainer id
weight
accessibilityHelpContent
viewIds viewDescriptor id
viewDescriptors viewDescriptor
allViewDescriptors viewContainer container views viewDescriptors
viewsRegistry allViewDescriptors
type ViewType
type ViewType Webview
ViewType Webview
type type ViewType Tree
ViewType Tree
ViewContainer
viewContainersRegistry
extensions IExtensionPointUser ViewExtensionPointType
removedExtensions ExtensionIdentifierSet extensions result e result e description identifier result
viewContainer viewContainersRegistry all
removedViews viewsRegistry viewContainer v v ICustomViewDescriptor extensionId removedExtensions v ICustomViewDescriptor extensionId
removedViews length
viewsRegistry removedViews viewContainer
view removedViews
anyView view ICustomViewDescriptor
anyView treeView
anyView treeView
value InitialVisibility
Object InitialVisibility value InitialVisibility
value InitialVisibility
viewDescriptors IUserFriendlyViewDescriptor collector ExtensionMessageCollector
viewDescriptors
collector
descriptor viewDescriptors
descriptor id
collector
descriptor name
collector
descriptor when descriptor when
collector
descriptor icon descriptor icon
collector
descriptor contextualTitle descriptor contextualTitle
collector
descriptor visibility descriptor visibility
collector Object InitialVisibility
value ViewContainer
value
viewContainersRegistry
viewContainersRegistry
viewContainersRegistry
viewContainersRegistry
viewContainersRegistry
container ViewContainer
container id
type
manifest IExtensionManifest
manifest contributes viewsContainers
manifest IExtensionManifest IRenderedData ITableData
contrib manifest contributes viewsContainers
viewContainers Object contrib result location
viewContainersForLocation contrib location
result viewContainersForLocation viewContainer viewContainer location
result
id title location
viewContainers length
data headers rows
headers
rows IRowData viewContainers
a b a id b id
viewContainer
viewContainer id
viewContainer title
viewContainer location
data
headers
rows
type
manifest IExtensionManifest
manifest contributes views
manifest IExtensionManifest IRenderedData ITableData
contrib manifest contributes views
views Object contrib result location
viewsForLocation contrib location
result viewsForLocation view view location
result
id name location
views length
data headers rows
headers
rows IRowData views
a b a id b id
view
view id
view name
view location
data
headers
rows
Registry ExtensionFeaturesRegistryExtensions ExtensionFeaturesRegistry
id
label
access
canToggle
renderer ViewContainersDataRenderer
Registry ExtensionFeaturesRegistryExtensions ExtensionFeaturesRegistry
id
label
access
canToggle
renderer ViewsDataRenderer
ViewsExtensionHandler ViewsExtensionHandler WorkbenchPhase BlockStartup
from
'../../../nls.js'
;
import
{
}
from
'../../../platform/contextkey/common/contextkey.js'
;
import
{
,
,
,
}
from
'../../../platform/extensions/common/extensions.js'
;
import
{
}
from
'../../../platform/instantiation/common/descriptors.js'
;
import
{
}
from
'../../../platform/instantiation/common/instantiation.js'
;
import
{
}
from
'../../../platform/log/common/log.js'
;
import
{
}
from
'../../../platform/registry/common/platform.js'
;
import
{
,
as
}
from
'../../browser/panecomposite.js'
;
import
{
,
}
from
'../../browser/parts/views/treeView.js'
;
import
{
}
from
'../../browser/parts/views/viewPaneContainer.js'
;
import
{
,
,
}
from
'../../common/contributions.js'
;
import
{
,
,
,
,
,
as
,
}
from
'../../common/views.js'
;
import
{
VIEWLET_ID
as
DEBUG
}
from
'../../contrib/debug/common/debug.js'
;
import
{
VIEWLET_ID
as
EXPLORER
}
from
'../../contrib/files/common/files.js'
;
import
{
VIEWLET_ID
as
REMOTE
}
from
'../../contrib/remote/browser/remoteExplorer.js'
;
import
{
VIEWLET_ID
as
SCM
}
from
'../../contrib/scm/common/scm.js'
;
import
{
}
from
'../../contrib/webviewView/browser/webviewViewPane.js'
;
import
{
as
,
,
,
,
,
}
from
'../../services/extensionManagement/common/extensionFeatures.js'
;
import
{
}
from
'../../services/extensions/common/extensions.js'
;
import
{
,
,
,
}
from
'../../services/extensions/common/extensionsRegistry.js'
;
export
interface
IUserFriendlyViewsContainerDescriptor
{
:
string
;
:
string
;
:
string
;
}
const
:
=
{
:
'object'
,
:
{
:
{
:
localize
(
{
:
'vscode.extension.contributes.views.containers.id'
,
:
[
'Contribution refers to those that an extension contributes to VS Code through an extension/contribution point. '
]
}
,
"Unique id used to identify the container in which views can be contributed using 'views' contribution point"
)
,
:
'string'
,
:
'^[a-zA-Z0-9_-]+$'
}
,
:
{
:
localize
(
'vscode.extension.contributes.views.containers.title'
,
'Human readable string used to render the container'
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.views.containers.icon'
,
"Path to the container icon. Icons are 24x24 centered on a 50x40 block and have a fill color of 'rgb(215, 218, 224)' or '#d7dae0'. It is recommended that icons be in SVG, though any image file type is accepted."
)
,
:
'string'
}
}
,
:
[
'id'
,
'title'
,
'icon'
]
}
;
export
const
:
=
{
:
localize
(
'vscode.extension.contributes.viewsContainers'
,
'Contributes views containers to the editor'
)
,
:
'object'
,
:
{
'activitybar'
:
{
:
localize
(
'views.container.activitybar'
,
"Contribute views containers to Activity Bar"
)
,
:
'array'
,
:
}
,
'panel'
:
{
:
localize
(
'views.container.panel'
,
"Contribute views containers to Panel"
)
,
:
'array'
,
:
}
,
'secondarySidebar'
:
{
:
localize
(
'views.container.secondarySidebar'
,
"Contribute views containers to Secondary Side Bar"
)
,
:
'array'
,
:
}
}
,
:
false
}
;
enum
{
=
'tree'
,
=
'webview'
}
interface
IUserFriendlyViewDescriptor
{
?
:
;
:
string
;
:
string
;
?
:
string
;
?
:
string
;
?
:
string
;
?
:
string
;
?
:
number
;
group
?
:
string
;
?
:
string
|
string
[
]
;
?
:
string
;
?
:
string
;
}
enum
{
=
'visible'
,
=
'hidden'
,
=
'collapsed'
}
const
:
=
{
:
'object'
,
:
[
'id'
,
'name'
,
'icon'
]
,
:
[
{
:
{
:
'${1:id}'
,
:
'${2:name}'
,
:
'${3:icon}'
}
}
]
,
:
{
:
{
:
localize
(
'vscode.extension.contributes.view.type'
,
"Type of the view. This can either be `tree` for a tree view based view or `webview` for a webview based view. The default is `tree`."
)
,
:
'string'
,
enum
:
[
'tree'
,
'webview'
,
]
,
:
[
localize
(
'vscode.extension.contributes.view.tree'
,
"The view is backed by a `TreeView` created by `createTreeView`."
)
,
localize
(
'vscode.extension.contributes.view.webview'
,
"The view is backed by a `WebviewView` registered by `registerWebviewViewProvider`."
)
,
]
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.id'
,
'Identifier of the view. This should be unique across all views. It is recommended to include your extension id as part of the view id. 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`.'
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.name'
,
'The human-readable name of the view. Will be shown'
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.when'
,
'Condition which must be true to show this view'
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.icon'
,
"Path to the view icon. View icons are displayed when the name of the view cannot be shown. It is recommended that icons be in SVG, though any image file type is accepted."
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.contextualTitle'
,
"Human-readable context for when the view is moved out of its original location. By default, the view's container name will be used."
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.initialState'
,
"Initial state of the view when the extension is first installed. Once the user has changed the view state by collapsing, moving, or hiding the view, the initial state will not be used again."
)
,
:
'string'
,
enum
:
[
'visible'
,
'hidden'
,
'collapsed'
]
,
default
:
'visible'
,
:
[
localize
(
'vscode.extension.contributes.view.initialState.visible'
,
"The default initial state for the view. In most containers the view will be expanded, however; some built-in containers (explorer, scm, and debug) show all contributed views collapsed regardless of the `visibility`."
)
,
localize
(
'vscode.extension.contributes.view.initialState.hidden'
,
"The view will not be shown in the view container, but will be discoverable through the views menu and other view entry points and can be un-hidden by the user."
)
,
localize
(
'vscode.extension.contributes.view.initialState.collapsed'
,
"The view will show in the view container, but will be collapsed."
)
]
}
,
:
{
:
'number'
,
:
localize
(
'vscode.extension.contributs.view.size'
,
"The initial size of the view. The size will behave like the css 'flex' property, and will set the initial size when the view is first shown. In the side bar, this is the height of the view. This value is only respected when the same extension owns both the view and the view container."
)
,
}
,
:
{
:
'string'
,
:
localize
(
'vscode.extension.contributes.view.accessibilityHelpContent'
,
"When the accessibility help dialog is invoked in this view, this content will be presented to the user as a markdown string. Keybindings will be resolved when provided in the format of <keybinding:commandId>. If there is no keybinding, that will be indicated and this command will be included in a quickpick for easy configuration."
)
}
}
}
;
const
:
=
{
:
'object'
,
:
[
'id'
,
'name'
]
,
:
{
:
{
:
localize
(
'vscode.extension.contributes.view.id'
,
'Identifier of the view. This should be unique across all views. It is recommended to include your extension id as part of the view id. 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`.'
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.name'
,
'The human-readable name of the view. Will be shown'
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.when'
,
'Condition which must be true to show this view'
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.group'
,
'Nested group in the viewlet'
)
,
:
'string'
}
,
:
{
:
localize
(
'vscode.extension.contributes.view.remoteName'
,
'The name of the remote type associated with this view'
)
,
:
[
'string'
,
'array'
]
,
:
{
:
'string'
}
}
}
}
;
const
:
=
{
:
localize
(
'vscode.extension.contributes.views'
,
"Contributes views to the editor"
)
,
:
'object'
,
:
{
'explorer'
:
{
:
localize
(
'views.explorer'
,
"Contributes views to Explorer container in the Activity bar"
)
,
:
'array'
,
:
,
default
:
[
]
}
,
'debug'
:
{
:
localize
(
'views.debug'
,
"Contributes views to Debug container in the Activity bar"
)
,
:
'array'
,
:
,
default
:
[
]
}
,
'scm'
:
{
:
localize
(
'views.scm'
,
"Contributes views to SCM container in the Activity bar"
)
,
:
'array'
,
:
,
default
:
[
]
}
,
'test'
:
{
:
localize
(
'views.test'
,
"Contributes views to Test container in the Activity bar"
)
,
:
'array'
,
:
,
default
:
[
]
}
,
'remote'
:
{
:
localize
(
'views.remote'
,
"Contributes views to Remote container in the Activity bar. To contribute to this container, the 'contribViewsRemote' API proposal must be enabled."
)
,
:
'array'
,
:
,
default
:
[
]
}
,
}
,
:
{
:
localize
(
'views.contributed'
,
"Contributes views to contributed views container"
)
,
:
'array'
,
:
,
default
:
[
]
}
}
;
type
ViewContainerExtensionPointType
=
{
[
:
string
]
:
[
]
}
;
const
:
<
>
=
.
registerExtensionPoint < ViewContainerExtensionPointType>
(
{
:
'viewsContainers'
,
:
}
)
;
type
ViewExtensionPointType
=
{
[
:
string
]
:
[
]
}
;
const
:
<
>
=
.
registerExtensionPoint < ViewExtensionPointType>
(
{
:
'views'
,
:
[
]
,
:
,
activationEventsGenerator
:
function
*
(
)
{
for
(
const
of
)
{
for
(
const
of
.
values
(
)
)
{
for
(
const
of
)
{
if
(
.
)
{
yield
` onView: ${ viewDescriptor. id} `
;
}
}
}
}
}
}
)
;
const
CUSTOM_VIEWS_START_ORDER
=
7
;
class
ViewsExtensionHandler
implements
IWorkbenchContribution
{
static
readonly
ID
=
'workbench.contrib.viewsExtensionHandler'
;
private
:
;
private
:
;
constructor
(
@ IInstantiationService
private
readonly
:
,
@ ILogService
private
readonly
:
)
{
this
.
=
.
as < IViewContainersRegistry>
(
.
)
;
this
.
=
.
as < IViewsRegistry>
(
.
)
;
this
.
handleAndRegisterCustomViewContainers
(
)
;
this
.
handleAndRegisterCustomViews
(
)
;
}
private
handleAndRegisterCustomViewContainers
(
)
{
.
setHandler
(
(
,
{
,
}
)
=>
{
if
(
.
)
{
this
.
removeCustomViewContainers
(
)
;
}
if
(
.
)
{
this
.
addCustomViewContainers
(
,
this
.
.
)
;
}
}
)
;
}
private
addCustomViewContainers
(
:
readonly
<
>
[
]
,
:
[
]
)
:
void
{
const
=
.
as < IViewContainersRegistry>
(
.
)
;
let
=
CUSTOM_VIEWS_START_ORDER
+
.
.
filter
(
=>
!
!
.
&&
.
getViewContainerLocation
(
)
===
.
)
.
;
let
=
5
+
.
.
filter
(
=>
!
!
.
&&
.
getViewContainerLocation
(
)
===
.
)
.
+
1
;
let
=
100
+
.
.
filter
(
=>
!
!
.
&&
.
getViewContainerLocation
(
)
===
.
)
.
+
1
;
for
(
const
{
,
,
}
of
)
{
.
entries
(
)
.
forEach
(
(
[
,
]
)
=>
{
if
(
!
this
.
isValidViewsContainer
(
,
)
)
{
return
;
}
switch
(
)
{
case
'activitybar'
:
=
this
.
registerCustomViewContainers
(
,
,
,
,
.
)
;
break
;
case
'panel'
:
=
this
.
registerCustomViewContainers
(
,
,
,
,
.
)
;
break
;
case
'secondarySidebar'
:
=
this
.
registerCustomViewContainers
(
,
,
,
,
.
)
;
break
;
}
}
)
;
}
}
private
removeCustomViewContainers
(
:
readonly
<
>
[
]
)
:
void
{
const
=
.
as < IViewContainersRegistry>
(
.
)
;
const
:
=
.
reduce
(
(
,
)
=>
{
.
add
(
.
.
)
;
return
;
}
,
new
ExtensionIdentifierSet
(
)
)
;
for
(
const
of
.
)
{
if
(
.
&&
.
has
(
.
)
)
{
const
=
this
.
.
getViews
(
)
;
if
(
.
)
{
this
.
.
moveViews
(
,
this
.
getDefaultViewContainer
(
)
)
;
}
this
.
deregisterCustomViewContainer
(
)
;
}
}
}
private
isValidViewsContainer
(
:
[
]
,
:
)
:
boolean
{
if
(
!
Array
.
isArray
(
)
)
{
.
error
(
localize
(
'viewcontainer requirearray'
,
"views containers must be an array"
)
)
;
return
false
;
}
for
(
const
of
)
{
if
(
typeof
.
!==
'string'
&&
isFalsyOrWhitespace
(
.
)
)
{
.
error
(
localize
(
'requireidstring'
,
"property `{0}` is mandatory and must be of type `string` with non-empty value. Only alphanumeric characters, '_', and '-' are allowed."
,
'id'
)
)
;
return
false
;
}
if
(
!
(
/ ^ [ a- z 0- 9 _-] + $ / i
.
test
(
.
)
)
)
{
.
error
(
localize
(
'requireidstring'
,
"property `{0}` is mandatory and must be of type `string` with non-empty value. Only alphanumeric characters, '_', and '-' are allowed."
,
'id'
)
)
;
return
false
;
}
if
(
typeof
.
!==
'string'
)
{
.
error
(
localize
(
'requirestring'
,
"property `{0}` is mandatory and must be of type `string`"
,
'title'
)
)
;
return
false
;
}
if
(
typeof
.
!==
'string'
)
{
.
error
(
localize
(
'requirestring'
,
"property `{0}` is mandatory and must be of type `string`"
,
'icon'
)
)
;
return
false
;
}
if
(
isFalsyOrWhitespace
(
.
)
)
{
.
warn
(
localize
(
'requirenonemptystring'
,
"property `{0}` is mandatory and must be of type `string` with non-empty value"
,
'title'
)
)
;
return
true
;
}
}
return
true
;
}
private
registerCustomViewContainers
(
:
[
]
,
:
,
:
number
,
:
[
]
,
:
)
:
number
{
.
forEach
(
=>
{
const
=
.
fromString
(
.
)
;
const
=
||
.
joinPath
(
.
,
.
)
;
const
=
` workbench.view.extension. ${ descriptor. id} `
;
const
=
.
||
;
const
=
this
.
registerCustomViewContainer
(
,
,
,
++
,
.
,
)
;
if
(
.
)
{
const
:
[
]
=
[
]
;
for
(
const
of
)
{
if
(
!==
)
{
.
push
(
...
this
.
.
getViews
(
)
.
filter
(
=>
(
as
)
.
===
.
)
)
;
}
}
if
(
.
)
{
this
.
.
moveViews
(
,
)
;
}
}
}
)
;
return
;
}
private
registerCustomViewContainer
(
:
string
,
:
string
,
:
URI
|
,
:
number
,
:
|
undefined
,
:
)
:
{
let
=
this
.
.
get
(
)
;
if
(
!
)
{
=
this
.
.
registerViewContainer
(
{
,
:
{
:
,
:
}
,
,
:
new
SyncDescriptor
(
,
[
,
{
:
true
}
]
)
,
:
true
,
,
,
}
,
)
;
}
return
;
}
private
deregisterCustomViewContainer
(
:
)
:
void
{
this
.
.
deregisterViewContainer
(
)
;
.
as < PaneCompositeRegistry>
(
.
)
.
deregisterPaneComposite
(
.
)
;
}
private
handleAndRegisterCustomViews
(
)
{
.
setHandler
(
(
,
{
,
}
)
=>
{
if
(
.
)
{
this
.
removeViews
(
)
;
}
if
(
.
)
{
this
.
addViews
(
)
;
}
}
)
;
}
private
addViews
(
:
readonly
<
>
[
]
)
:
void
{
const
:
<
string
>
=
new
Set< string >
(
)
;
const
:
{
:
[
]
;
:
}
[
]
=
[
]
;
for
(
const
of
)
{
const
{
,
}
=
;
.
entries
(
)
.
forEach
(
(
[
,
]
)
=>
{
if
(
!
this
.
isValidViewDescriptors
(
,
)
)
{
return
;
}
if
(
===
'remote'
&&
!
isProposedApiEnabled
(
.
,
'contribViewsRemote'
)
)
{
.
warn
(
localize
(
'ViewContainerRequiresProposedAPI'
,
"View container '{0}' requires 'enabledApiProposals: [\"contribViewsRemote\"]' to be added to 'Remote'."
,
)
)
;
return
;
}
if
(
===
'agentSessions'
&&
!
isProposedApiEnabled
(
.
,
'chatSessionsProvider'
)
)
{
.
warn
(
localize
(
'RequiresChatSessionsProposedAPI'
,
"View container '{0}' requires 'enabledApiProposals: [\"chatSessionsProvider\"]'."
,
)
)
;
return
;
}
const
=
this
.
getViewContainer
(
)
;
if
(
!
)
{
.
warn
(
localize
(
'ViewContainerDoesnotExist'
,
"View container '{0}' does not exist and all views registered to it will be added to 'Explorer'."
,
)
)
;
}
const
=
||
this
.
getDefaultViewContainer
(
)
;
const
:
[
]
=
[
]
;
for
(
let
=
0
;
<
.
;
++
)
{
const
=
[
]
;
if
(
.
has
(
.
)
)
{
.
error
(
localize
(
'duplicateView1'
,
"Cannot register multiple views with same id `{0}`"
,
.
)
)
;
continue
;
}
if
(
this
.
.
getView
(
.
)
!==
null
)
{
.
error
(
localize
(
'duplicateView2'
,
"A view with id `{0}` is already registered."
,
.
)
)
;
continue
;
}
const
=
.
equals
(
.
.
,
.
)
?
+
1
:
.
?
.
.
getOrder
(
.
)
:
undefined
;
let
:
|
URI
|
undefined
;
if
(
typeof
.
===
'string'
)
{
=
.
fromString
(
.
)
||
.
joinPath
(
.
.
,
.
)
;
}
const
=
this
.
convertInitialVisibility
(
.
)
;
const
=
this
.
getViewType
(
.
)
;
if
(
!
)
{
.
error
(
localize
(
'unknownViewType'
,
"Unknown view type `{0}`."
,
.
)
)
;
continue
;
}
let
:
number
|
undefined
=
undefined
;
if
(
typeof
.
===
'number'
)
{
if
(
.
?.
===
.
.
.
)
{
=
.
;
}
else
{
this
.
.
warn
(
` ${ extension. description. identifier. value} tried to set the view size of ${ item. id} but it was ignored because the view container does not belong to it. `
)
;
}
}
let
;
if
(
isProposedApiEnabled
(
.
,
'contribAccessibilityHelpContent'
)
&&
.
)
{
=
new
MarkdownString
(
.
)
;
}
const
:
=
{
:
,
:
===
.
?
new
SyncDescriptor
(
)
:
new
SyncDescriptor
(
)
,
:
.
,
:
{
:
.
,
:
.
}
,
:
.
deserialize
(
.
)
,
:
||
?.
,
:
.
||
(
&&
(
typeof
.
===
'string'
?
.
:
.
.
)
)
,
:
true
,
:
?.
!==
REMOTE
,
:
===
.
?
this
.
.
createInstance
(
,
.
,
.
,
.
.
.
)
:
undefined
,
:
this
.
showCollapsed
(
)
||
===
.
,
:
,
:
.
.
,
:
,
:
.
,
:
.
||
(
<
any
>
)
.
,
:
.
,
:
===
.
,
:
?.
===
REMOTE
?
true
:
undefined
,
,
}
;
.
add
(
.
)
;
.
push
(
)
;
}
.
push
(
{
:
,
:
}
)
;
}
)
;
}
this
.
.
registerViews2
(
)
;
}
private
getViewType
(
:
string
|
undefined
)
:
|
undefined
{
if
(
===
.
)
{
return
.
;
}
if
(
!
||
===
.
)
{
return
.
;
}
return
undefined
;
}
private
getDefaultViewContainer
(
)
:
{
return
this
.
.
get
(
EXPLORER
)
!
;
}
private
removeViews
(
:
readonly
<
>
[
]
)
:
void
{
const
:
=
.
reduce
(
(
,
)
=>
{
.
add
(
.
.
)
;
return
;
}
,
new
ExtensionIdentifierSet
(
)
)
;
for
(
const
of
this
.
.
)
{
const
=
this
.
.
getViews
(
)
.
filter
(
=>
(
as
)
.
&&
.
has
(
(
as
)
.
)
)
;
if
(
.
)
{
this
.
.
deregisterViews
(
,
)
;
for
(
const
of
)
{
const
=
as
;
if
(
.
)
{
.
.
dispose
(
)
;
}
}
}
}
}
private
convertInitialVisibility
(
:
string
|
undefined
)
:
|
undefined
{
if
(
.
values
(
)
.
includes
(
as
)
)
{
return
as
;
}
return
undefined
;
}
private
isValidViewDescriptors
(
:
[
]
,
:
)
:
boolean
{
if
(
!
Array
.
isArray
(
)
)
{
.
error
(
localize
(
'requirearray'
,
"views must be an array"
)
)
;
return
false
;
}
for
(
const
of
)
{
if
(
typeof
.
!==
'string'
)
{
.
error
(
localize
(
'requirestring'
,
"property `{0}` is mandatory and must be of type `string`"
,
'id'
)
)
;
return
false
;
}
if
(
typeof
.
!==
'string'
)
{
.
error
(
localize
(
'requirestring'
,
"property `{0}` is mandatory and must be of type `string`"
,
'name'
)
)
;
return
false
;
}
if
(
.
&&
typeof
.
!==
'string'
)
{
.
error
(
localize
(
'optstring'
,
"property `{0}` can be omitted or must be of type `string`"
,
'when'
)
)
;
return
false
;
}
if
(
.
&&
typeof
.
!==
'string'
)
{
.
error
(
localize
(
'optstring'
,
"property `{0}` can be omitted or must be of type `string`"
,
'icon'
)
)
;
return
false
;
}
if
(
.
&&
typeof
.
!==
'string'
)
{
.
error
(
localize
(
'optstring'
,
"property `{0}` can be omitted or must be of type `string`"
,
'contextualTitle'
)
)
;
return
false
;
}
if
(
.
&&
!
this
.
convertInitialVisibility
(
.
)
)
{
.
error
(
localize
(
'optenum'
,
"property `{0}` can be omitted or must be one of {1}"
,
'visibility'
,
.
values
(
)
.
join
(
', '
)
)
)
;
return
false
;
}
}
return
true
;
}
private
getViewContainer
(
:
string
)
:
|
undefined
{
switch
(
)
{
case
'explorer'
:
return
this
.
.
get
(
EXPLORER
)
;
case
'debug'
:
return
this
.
.
get
(
DEBUG
)
;
case
'scm'
:
return
this
.
.
get
(
SCM
)
;
case
'remote'
:
return
this
.
.
get
(
REMOTE
)
;
default
:
return
this
.
.
get
(
` workbench.view.extension. ${ value} `
)
;
}
}
private
showCollapsed
(
:
)
:
boolean
{
switch
(
.
)
{
case
EXPLORER
:
case
SCM
:
case
DEBUG
:
return
true
;
}
return
false
;
}
}
class
ViewContainersDataRenderer
extends
Disposable
implements
IExtensionFeatureTableRenderer
{
readonly
=
'table'
;
shouldRender
(
:
)
:
boolean
{
return
!
!
.
?.
;
}
render
(
:
)
:
<
>
{
const
=
.
?.
||
{
}
;
const
=
.
keys
(
)
.
reduce
(
(
,
)
=>
{
const
=
[
]
;
.
push
(
...
.
map
(
=>
(
{
...
,
}
)
)
)
;
return
;
}
,
[
]
as
Array
<
{
:
string
;
:
string
;
:
string
}
>
)
;
if
(
!
.
)
{
return
{
:
{
:
[
]
,
:
[
]
}
,
dispose
:
(
)
=>
{
}
}
;
}
const
=
[
localize
(
'view container id'
,
"ID"
)
,
localize
(
'view container title'
,
"Title"
)
,
localize
(
'view container location'
,
"Where"
)
,
]
;
const
:
[
]
[
]
=
.
sort
(
(
,
)
=>
.
.
localeCompare
(
.
)
)
.
map
(
=>
{
return
[
.
,
.
,
.
]
;
}
)
;
return
{
:
{
,
}
,
dispose
:
(
)
=>
{
}
}
;
}
}
class
ViewsDataRenderer
extends
Disposable
implements
IExtensionFeatureTableRenderer
{
readonly
=
'table'
;
shouldRender
(
:
)
:
boolean
{
return
!
!
.
?.
;
}
render
(
:
)
:
<
>
{
const
=
.
?.
||
{
}
;
const
=
.
keys
(
)
.
reduce
(
(
,
)
=>
{
const
=
[
]
;
.
push
(
...
.
map
(
=>
(
{
...
,
}
)
)
)
;
return
;
}
,
[
]
as
Array
<
{
:
string
;
:
string
;
:
string
}
>
)
;
if
(
!
.
)
{
return
{
:
{
:
[
]
,
:
[
]
}
,
dispose
:
(
)
=>
{
}
}
;
}
const
=
[
localize
(
'view id'
,
"ID"
)
,
localize
(
'view name title'
,
"Name"
)
,
localize
(
'view container location'
,
"Where"
)
,
]
;
const
:
[
]
[
]
=
.
sort
(
(
,
)
=>
.
.
localeCompare
(
.
)
)
.
map
(
=>
{
return
[
.
,
.
,
.
]
;
}
)
;
return
{
:
{
,
}
,
dispose
:
(
)
=>
{
}
}
;
}
}
.
as < IExtensionFeaturesRegistry>
(
.
)
.
registerExtensionFeature
(
{
:
'viewsContainers'
,
:
localize
(
'viewsContainers'
,
"View Containers"
)
,
:
{
:
false
}
,
:
new
SyncDescriptor
(
)
,
}
)
;
.
as < IExtensionFeaturesRegistry>
(
.
)
.
registerExtensionFeature
(
{
:
'views'
,
:
localize
(
'views'
,
"Views"
)
,
:
{
:
false
}
,
:
new
SyncDescriptor
(
)
,
}
)
;
registerWorkbenchContribution2
(
.
ID
,
,
.
)
;