ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / workbench / contrib / extensions / browser / extensionsWidgets.ts 1147 строк · изменён 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
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
import './media/extensionsWidgets.css' ;
import * as semver from '../../../../base/common/semver/semver.js' ;
import { Disposable, toDisposable, DisposableStore, MutableDisposable, IDisposable } from '../../../../base/common/lifecycle.js' ;
import { IExtension, IExtensionsWorkbenchService, IExtensionContainer, ExtensionState, ExtensionEditorTab, IExtensionsViewState } from '../common/extensions.js' ;
import { append, $, reset, addDisposableListener, EventType, finalHandler } from '../../../../base/browser/dom.js' ;
import * as platform
localize
IExtensionManagementServerService
IExtensionIgnoredRecommendationsService IExtensionRecommendationsService
ILabelService
extensionButtonProminentBackground ExtensionStatusAction
IThemeService registerThemingParticipant
ThemeIcon
Emitter Event
IInstantiationService
CountBadge
IConfigurationService
IUserDataSyncEnablementService
activationTimeIcon errorIcon infoIcon installCountIcon preReleaseIcon privateExtensionIcon ratingIcon remoteIcon restartRequiredIcon sponsorIcon starEmptyIcon starFullIcon starHalfIcon syncIgnoredIcon warningIcon
registerColor textLinkForeground
IHoverService
HoverPosition
createCommandUri MarkdownString
IExtensionService
areSameExtensions
Severity
Color
IOpenerService
renderIcon
StandardKeyboardEvent
KeyCode
defaultCountBadgeStyles
getDefaultHoverDelegate
IWorkspaceContextService
IManagedHover
Registry
Extensions IExtensionFeaturesManagementService IExtensionFeaturesRegistry
ExtensionIdentifier
extensionDefaultIcon extensionVerifiedPublisherIconColor verifiedPublisherIcon
IUriIdentityService
IExplorerService
IViewsService
IExtensionGalleryManifest IExtensionGalleryManifestService
IMarkdownRendererService
_extension IExtension
IExtension _extension
extension IExtension _extension extension
element HTMLElement IDisposable
disposables DisposableStore
disposables element EventType callback
disposables element EventType e
keyboardEvent e
keyboardEvent KeyCode Space keyboardEvent KeyCode Enter
e
e
disposables
iconLoadingDisposable
iconErrorDisposable
element HTMLElement
iconElement HTMLImageElement
defaultIconElement HTMLElement
iconUrl
container HTMLElement
element container
iconElement element alt
iconElement style display
defaultIconElement element ThemeIcon extensionDefaultIcon
defaultIconElement style display
iconUrl
iconElement src
iconElement style display
defaultIconElement style display
iconErrorDisposable
iconLoadingDisposable
extension
extension iconUrl
iconUrl extension iconUrl
iconElement style display
defaultIconElement style display
iconUrl extension iconUrl
iconErrorDisposable value iconElement
extension iconUrlFallback
iconElement src extension iconUrlFallback
iconElement style display
defaultIconElement style display
once
iconElement src iconUrl
iconElement complete
iconElement style visibility
iconLoadingDisposable value iconElement
iconElement style visibility
iconElement style visibility
iconUrl
iconElement style display
iconElement src
defaultIconElement style display
iconErrorDisposable
iconLoadingDisposable
disposables
container HTMLElement
small
hoverService IHoverService
container innerText
disposables
extension
small extension state ExtensionState Uninstalled
installLabel InstallCountWidget extension small
installLabel
parent small container container tabIndex
parent ThemeIcon installCountIcon
count parent
count textContent installLabel
small
disposables hoverService container
extension IExtension small
installCount extension installCount
installCount
installLabel
small
installCount
installLabel
installCount
installLabel
installLabel installCount
installLabel installCount platform language
installLabel
containerHover IManagedHover
disposables
container HTMLElement
small
hoverService IHoverService
openerService IOpenerService
container classList
small
container classList
container innerText
disposables
extension
small extension state ExtensionState Uninstalled
extension rating
small extension ratingCount
extension url
rating Math extension rating
small
container ThemeIcon starFullIcon
count container
count textContent rating
element container tabIndex
i i i
rating i
element ThemeIcon starFullIcon
rating i
element ThemeIcon starHalfIcon
element ThemeIcon starEmptyIcon
extension ratingCount
ratingCountElemet element
ratingCountElemet style paddingLeft
containerHover hoverService element
containerHover rating
element
extension ratingUrl
disposables element openerService extension ratingUrl
element HTMLElement
containerHover IManagedHover
disposables
container HTMLElement
small
extensionsWorkbenchService IExtensionsWorkbenchService
hoverService IHoverService
openerService IOpenerService
element
disposables
extension
extension resourceExtension
extension local source
element container
publisherDisplayName
publisherDisplayName textContent extension publisherDisplayName
verifiedPublisher
verifiedPublisher verifiedPublisherIcon
small
extension publisherDomain verified
element verifiedPublisher
element publisherDisplayName
element classList extension url
element
element tabIndex
containerHover disposables hoverService element extension publisherDisplayName
element publisherDisplayName
extension publisherDomain verified
element verifiedPublisher
publisherDomainLink extension publisherDomain link
verifiedPublisher tabIndex
verifiedPublisher
containerHover extension publisherDomain link
verifiedPublisher
verifiedPublisher publisherDomainLink authority publisherDomainLink authority publisherDomainLink authority
disposables verifiedPublisher openerService publisherDomainLink
extension url
disposables element extensionsWorkbenchService
disposables
container HTMLElement
hoverService IHoverService
openerService IOpenerService
container
disposables
extension publisherSponsorLink
sponsor container tabIndex
disposables hoverService sponsor extension publisherSponsorLink
sponsor
sponsorIconElement sponsorIcon
label
sponsor sponsorIconElement label
disposables sponsor
openerService extension publisherSponsorLink
element HTMLElement
disposables
parent HTMLElement
extensionRecommendationsService IExtensionRecommendationsService
extensionRecommendationsService
element
element
disposables
extension extension state ExtensionState Installed extension deprecationInfo
extRecommendations extensionRecommendationsService
extRecommendations extension identifier id
element parent
recommendation element
recommendation ThemeIcon ratingIcon
element HTMLElement
disposables
parent HTMLElement
element
element
disposables
extension state ExtensionState Installed extension preRelease extension hasPreReleaseVersion
element parent
preRelease element
preRelease ThemeIcon preReleaseIcon
remoteBadge
element HTMLElement
parent HTMLElement
tooltip
extensionManagementServerService IExtensionManagementServerService
instantiationService IInstantiationService
element parent
remoteBadge value element
remoteBadge
extension extension local extension server extensionManagementServerService localExtensionManagementServer extensionManagementServerService remoteExtensionManagementServer extension server extensionManagementServerService remoteExtensionManagementServer
tooltip
tooltip extensionManagementServerService remoteExtensionManagementServer
tooltip extensionManagementServerService remoteExtensionManagementServer label
remoteBadge value instantiationService ExtensionIconBadge remoteIcon tooltip
element remoteBadge value element
element HTMLElement
elementHover IManagedHover
icon ThemeIcon
tooltip
hoverService IHoverService
labelService ILabelService
themeService IThemeService
element
elementHover hoverService element
element ThemeIcon icon
element
bgColor themeService
fgColor themeService
element style backgroundColor bgColor bgColor
element style color fgColor fgColor
themeService
tooltip
element
elementHover tooltip
labelService
element HTMLElement
countBadge CountBadge
parent HTMLElement
element
countBadge
countBadge
extension extension categories category category extension extensionPack length
element parent
countBadge element defaultCountBadgeStyles
countBadge extension extensionPack length
element HTMLElement
extensionGalleryManifest IExtensionGalleryManifest
disposables
container HTMLElement
small
hoverService IHoverService
contextService IWorkspaceContextService
uriIdentityService IUriIdentityService
explorerService IExplorerService
viewsService IViewsService
extensionGalleryManifestService IExtensionGalleryManifestService
extensionGalleryManifestService manifest
_store isDisposed
extensionGalleryManifest manifest
element
disposables
extension
extension private
element container
small extensionGalleryManifest capabilities extensions includePublicExtensions extensionGalleryManifest capabilities extensions includePrivateExtensions
element ThemeIcon privateExtensionIcon
small
element
small
location extension resourceExtension location extension local source extension local location
location
element container
workspaceFolder contextService location
workspaceFolder extension isWorkspaceScoped
element textContent
element classList
element
disposables hoverService element uriIdentityService extUri workspaceFolder uri location
disposables element
viewsService explorerService location
disposables hoverService element location path
element textContent
disposables
container HTMLElement
configurationService IConfigurationService
extensionsWorkbenchService IExtensionsWorkbenchService
hoverService IHoverService
userDataSyncEnablementService IUserDataSyncEnablementService
Event configurationService onDidChangeConfiguration e e
userDataSyncEnablementService
disposables
container innerText
extension extension state ExtensionState Installed userDataSyncEnablementService extensionsWorkbenchService extension
element container ThemeIcon syncIgnoredIcon
disposables hoverService element
element classList ThemeIcon syncIgnoredIcon
disposables
container HTMLElement
hoverService IHoverService
disposables
container innerText
runtimeState extension runtimeState
reason runtimeState reason runtimeState reason
runtimeState reason
element container ThemeIcon restartRequiredIcon
container
disposables hoverService element reason
extensionViewState IExtensionsViewState
container HTMLElement
extensionService IExtensionService
extensionFeaturesManagementService IExtensionFeaturesManagementService
extensionsWorkbenchService IExtensionsWorkbenchService
extensionService extensions
extension extensions e id e value extension identifier
extensionFeaturesManagementService e
extension ExtensionIdentifier extension identifier id e extension
container innerText
extension
extensionViewState filters featureId extension state ExtensionState Installed
accessData extensionFeaturesManagementService extension identifier id extensionViewState filters featureId
feature Registry Extensions ExtensionFeaturesRegistry extensionViewState filters featureId
feature icon accessData
featureAccessTimeElement container
featureAccessTimeElement textContent accessData accessTimes length
iconElement container ThemeIcon feature icon
iconElement style paddingLeft
extensionStatus extensionsWorkbenchService extension
extensionStatus activationTimes
activationTime extensionStatus activationTimes codeLoadingTime extensionStatus activationTimes activateCallTime
container ThemeIcon activationTimeIcon
activationTimeElement container
activationTimeElement textContent
HoverPosition
target HTMLElement
hover
options ExtensionHoverOptions
extensionStatusAction ExtensionStatusAction
extensionsWorkbenchService IExtensionsWorkbenchService
extensionFeaturesManagementService IExtensionFeaturesManagementService
hoverService IHoverService
configurationService IConfigurationService
extensionRecommendationsService IExtensionRecommendationsService
themeService IThemeService
contextService IWorkspaceContextService
hover value
extension
hover value hoverService
delay configurationService
options focus
hoverService
options
additionalClasses
position
hoverPosition options
forcePosition
persistence
hideOnKeyDown
focus
placement
options target
extensionStatusAction
error
markdownNotSupportedFallback
appearance
showHoverHint
MarkdownString
extension
markdown isTrusted supportThemeIcons
markdown extension displayName
semver extension version
markdown
markdown
addSeparator
extension private
markdown
addSeparator
extension state ExtensionState Installed
installLabel InstallCountWidget extension
installLabel
addSeparator
markdown
markdown
addSeparator
extension rating
addSeparator
markdown
rating Math extension rating
markdown
addSeparator
extension publisherSponsorLink
addSeparator
markdown
markdown
addSeparator
addSeparator
markdown
location extension resourceExtension location extension local source extension local location
location
extension isWorkspaceScoped contextService location
markdown
markdown
markdown
extension description
markdown extension description
markdown
extension publisherDomain verified
bgColor themeService extensionVerifiedPublisherIconColor
publisherVerifiedTooltip
markdown
markdown
extension outdated
markdown
markdown
markdown
preReleaseMessage ExtensionHoverWidget extension
extensionRuntimeStatus extensionsWorkbenchService extension
extensionFeaturesAccessData extensionFeaturesManagementService extension identifier id
extensionStatus extensionStatusAction status
runtimeState extension runtimeState
recommendationMessage extension
extensionRuntimeStatus extensionFeaturesAccessData size extensionStatus length runtimeState recommendationMessage preReleaseMessage
markdown
markdown
extensionRuntimeStatus
extensionRuntimeStatus activationTimes
activationTime extensionRuntimeStatus activationTimes codeLoadingTime extensionRuntimeStatus activationTimes activateCallTime
markdown
markdown
extensionRuntimeStatus runtimeErrors length extensionRuntimeStatus messages length
hasErrors extensionRuntimeStatus runtimeErrors length extensionRuntimeStatus messages message message type Severity Error
hasWarnings extensionRuntimeStatus messages message message type Severity Warning
errorsLink extensionRuntimeStatus runtimeErrors length
messageLink extensionRuntimeStatus messages length
markdown
errorsLink messageLink
markdown
markdown
markdown
extensionFeaturesAccessData size
registry Registry Extensions ExtensionFeaturesRegistry
featureId accessData extensionFeaturesAccessData
accessData accessTimes length
feature registry featureId
feature
markdown feature label
markdown
markdown
status extensionStatus
status icon
markdown
markdown status message value
markdown
runtimeState
markdown
markdown
markdown
preReleaseMessage
extensionPreReleaseIcon themeService extensionPreReleaseIconColor
markdown
markdown
recommendationMessage
markdown recommendationMessage
markdown
markdown
extension IExtension
extension state ExtensionState Installed
extension deprecationInfo
recommendation extensionRecommendationsService extension identifier id
recommendation reasonText
bgColor themeService extensionButtonProminentBackground
extension IExtension
extension hasPreReleaseVersion
extension isBuiltin
extension isPreReleaseVersion
extension preRelease
preReleaseVersionLink
preReleaseVersionLink
renderDisposables
_onDidRender
onDidRender Event _onDidRender event
container HTMLElement
extensionStatusAction ExtensionStatusAction
markdownRendererService IMarkdownRendererService
extensionStatusAction
container
renderDisposables value
disposables
renderDisposables value disposables
extensionStatus extensionStatusAction status
extensionStatus length
markdown isTrusted supportThemeIcons
i i extensionStatus length i
status extensionStatus i
status icon
markdown
markdown status message value
i extensionStatus length
markdown
rendered disposables markdownRendererService markdown
container rendered element
_onDidRender
_onDidRender
onDidRender Event _onDidRender event
container HTMLElement
extensionRecommendationsService IExtensionRecommendationsService
extensionIgnoredRecommendationsService IExtensionIgnoredRecommendationsService
extensionRecommendationsService
container
recommendationStatus
recommendationStatus
recommendationStatus icon
container
container recommendationStatus message
_onDidRender
icon ThemeIcon message
extension
extension deprecationInfo
extension state ExtensionState Installed
extRecommendations extensionRecommendationsService
extRecommendations extension identifier id
reasonText extRecommendations extension identifier id reasonText
reasonText
icon starEmptyIcon message reasonText
extensionIgnoredRecommendationsService globalIgnoredRecommendations extension identifier id
icon message
extensionRatingIconColor light dark hcDark hcLight textLinkForeground
extensionPreReleaseIconColor dark light hcDark hcLight textLinkForeground
extensionSponsorIconColor light dark hcDark hcLight
extensionPrivateBadgeBackground dark light hcDark hcLight
theme collector
extensionRatingIcon theme extensionRatingIconColor
extensionRatingIcon
collector
collector
extensionVerifiedPublisherIcon theme extensionVerifiedPublisherIconColor
extensionVerifiedPublisherIcon
collector
collector
collector
privateBadgeBackground theme extensionPrivateBadgeBackground
privateBadgeBackground
collector
from
'../../../../base/common/platform.js'
;
import
{
}
from
'../../../../nls.js'
;
import
{
}
from
'../../../services/extensionManagement/common/extensionManagement.js'
;
import
{
,
}
from
'../../../services/extensionRecommendations/common/extensionRecommendations.js'
;
import
{
}
from
'../../../../platform/label/common/label.js'
;
import
{
,
}
from
'./extensionsActions.js'
;
import
{
,
}
from
'../../../../platform/theme/common/themeService.js'
;
import
{
}
from
'../../../../base/common/themables.js'
;
import
{
EXTENSION_BADGE_BACKGROUND
,
EXTENSION_BADGE_FOREGROUND
}
from
'../../../common/theme.js'
;
import
{
,
}
from
'../../../../base/common/event.js'
;
import
{
}
from
'../../../../platform/instantiation/common/instantiation.js'
;
import
{
}
from
'../../../../base/browser/ui/countBadge/countBadge.js'
;
import
{
}
from
'../../../../platform/configuration/common/configuration.js'
;
import
{
}
from
'../../../../platform/userDataSync/common/userDataSync.js'
;
import
{
,
,
,
,
,
,
,
,
,
,
,
,
,
,
}
from
'./extensionsIcons.js'
;
import
{
,
}
from
'../../../../platform/theme/common/colorRegistry.js'
;
import
{
}
from
'../../../../platform/hover/browser/hover.js'
;
import
{
}
from
'../../../../base/browser/ui/hover/hoverWidget.js'
;
import
{
,
}
from
'../../../../base/common/htmlContent.js'
;
import
{
URI
}
from
'../../../../base/common/uri.js'
;
import
{
}
from
'../../../services/extensions/common/extensions.js'
;
import
{
}
from
'../../../../platform/extensionManagement/common/extensionManagementUtil.js'
;
import
from
'../../../../base/common/severity.js'
;
import
{
}
from
'../../../../base/common/color.js'
;
import
{
}
from
'../../../../platform/opener/common/opener.js'
;
import
{
}
from
'../../../../base/browser/ui/iconLabel/iconLabels.js'
;
import
{
}
from
'../../../../base/browser/keyboardEvent.js'
;
import
{
}
from
'../../../../base/common/keyCodes.js'
;
import
{
}
from
'../../../../platform/theme/browser/defaultStyles.js'
;
import
{
}
from
'../../../../base/browser/ui/hover/hoverDelegateFactory.js'
;
import
{
}
from
'../../../../platform/workspace/common/workspace.js'
;
import
type
{
}
from
'../../../../base/browser/ui/hover/hover.js'
;
import
{
}
from
'../../../../platform/registry/common/platform.js'
;
import
{
,
,
}
from
'../../../services/extensionManagement/common/extensionFeatures.js'
;
import
{
}
from
'../../../../platform/extensions/common/extensions.js'
;
import
{
,
,
}
from
'../../../services/extensionManagement/common/extensionsIcons.js'
;
import
{
}
from
'../../../../platform/uriIdentity/common/uriIdentity.js'
;
import
{
}
from
'../../files/browser/files.js'
;
import
{
}
from
'../../../services/views/common/viewsService.js'
;
import
{
VIEW_ID
as
EXPLORER_VIEW_ID
}
from
'../../files/common/files.js'
;
import
{
,
}
from
'../../../../platform/extensionManagement/common/extensionGalleryManifest.js'
;
import
{
}
from
'../../../../platform/markdown/browser/markdownRenderer.js'
;
export
abstract
class
ExtensionWidget
extends
Disposable
implements
IExtensionContainer
{
private
:
|
null
=
null
;
get
extension
(
)
:
|
null
{
return
this
.
;
}
set
extension
(
:
|
null
)
{
this
.
=
;
this
.
update
(
)
;
}
update
(
)
:
void
{
this
.
render
(
)
;
}
abstract
render
(
)
:
void
;
}
export
function
onClick
(
:
,
callback
:
(
)
=>
void
)
:
{
const
:
=
new
DisposableStore
(
)
;
.
add
(
addDisposableListener
(
,
.
CLICK
,
finalHandler
(
)
)
)
;
.
add
(
addDisposableListener
(
,
.
KEY_UP
,
=>
{
const
=
new
StandardKeyboardEvent
(
)
;
if
(
.
equals
(
.
)
||
.
equals
(
.
)
)
{
.
preventDefault
(
)
;
.
stopPropagation
(
)
;
callback
(
)
;
}
}
)
)
;
return
;
}
export
class
ExtensionIconWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
MutableDisposable
(
)
)
;
private
readonly
=
this
.
_register
(
new
MutableDisposable
(
)
)
;
private
readonly
:
;
private
readonly
:
;
private
readonly
:
;
private
:
string
|
undefined
;
constructor
(
:
,
)
{
super
(
)
;
this
.
=
append
(
,
$
(
'.extension-icon'
)
)
;
this
.
=
append
(
this
.
,
$
(
'img.icon'
,
{
:
''
}
)
)
;
this
.
.
.
=
'none'
;
this
.
=
append
(
this
.
,
$
(
.
asCSSSelector
(
)
)
)
;
this
.
.
.
=
'none'
;
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
}
private
clear
(
)
:
void
{
this
.
=
undefined
;
this
.
.
=
''
;
this
.
.
.
=
'none'
;
this
.
.
.
=
'none'
;
this
.
.
clear
(
)
;
this
.
.
clear
(
)
;
}
render
(
)
:
void
{
if
(
!
this
.
)
{
this
.
clear
(
)
;
return
;
}
if
(
this
.
.
)
{
if
(
this
.
!==
this
.
.
)
{
this
.
.
.
=
'inherit'
;
this
.
.
.
=
'none'
;
this
.
=
this
.
.
;
this
.
.
=
addDisposableListener
(
this
.
,
'error'
,
(
)
=>
{
if
(
this
.
?.
)
{
this
.
.
=
this
.
.
;
}
else
{
this
.
.
.
=
'none'
;
this
.
.
.
=
'inherit'
;
}
}
,
{
:
true
}
)
;
this
.
.
=
this
.
;
if
(
!
this
.
.
)
{
this
.
.
.
=
'hidden'
;
this
.
.
=
addDisposableListener
(
this
.
,
'load'
,
(
)
=>
{
this
.
.
.
=
'inherit'
;
}
)
;
}
else
{
this
.
.
.
=
'inherit'
;
}
}
}
else
{
this
.
=
undefined
;
this
.
.
.
=
'none'
;
this
.
.
=
''
;
this
.
.
.
=
'inherit'
;
this
.
.
clear
(
)
;
this
.
.
clear
(
)
;
}
}
}
export
class
InstallCountWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
readonly
:
,
private
:
boolean
,
@ IHoverService
private
readonly
:
,
)
{
super
(
)
;
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
}
private
clear
(
)
:
void
{
this
.
.
=
''
;
this
.
.
clear
(
)
;
}
render
(
)
:
void
{
this
.
clear
(
)
;
if
(
!
this
.
)
{
return
;
}
if
(
this
.
&&
this
.
.
!==
.
)
{
return
;
}
const
=
.
getInstallLabel
(
this
.
,
this
.
)
;
if
(
!
)
{
return
;
}
const
=
this
.
?
this
.
:
append
(
this
.
,
$
(
'span.install'
,
{
:
0
}
)
)
;
append
(
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
const
=
append
(
,
$
(
'span.count'
)
)
;
.
=
;
if
(
!
this
.
)
{
this
.
.
add
(
this
.
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
this
.
,
localize
(
'install count'
,
"Install count"
)
)
)
;
}
}
static
getInstallLabel
(
:
,
:
boolean
)
:
string
|
undefined
{
const
=
.
;
if
(
!
)
{
return
undefined
;
}
let
:
string
;
if
(
)
{
if
(
>
1000000
)
{
=
` ${ Math. floor ( installCount / 100000 ) / 10 } M `
;
}
else
if
(
>
1000
)
{
=
` ${ Math. floor ( installCount / 1000 ) } K `
;
}
else
{
=
String
(
)
;
}
}
else
{
=
.
toLocaleString
(
.
)
;
}
return
;
}
}
export
class
RatingsWidget
extends
ExtensionWidget
{
private
:
|
undefined
;
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
readonly
:
,
private
:
boolean
,
@ IHoverService
private
readonly
:
,
@ IOpenerService
private
readonly
:
,
)
{
super
(
)
;
.
.
add
(
'extension-ratings'
)
;
if
(
this
.
)
{
.
.
add
(
'small'
)
;
}
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
}
private
clear
(
)
:
void
{
this
.
.
=
''
;
this
.
.
clear
(
)
;
}
render
(
)
:
void
{
this
.
clear
(
)
;
if
(
!
this
.
)
{
return
;
}
if
(
this
.
&&
this
.
.
!==
.
)
{
return
;
}
if
(
this
.
.
===
undefined
)
{
return
;
}
if
(
this
.
&&
!
this
.
.
)
{
return
;
}
if
(
!
this
.
.
)
{
return
;
}
const
=
.
round
(
this
.
.
*
2
)
/
2
;
if
(
this
.
)
{
append
(
this
.
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
const
=
append
(
this
.
,
$
(
'span.count'
)
)
;
.
=
String
(
)
;
}
else
{
const
=
append
(
this
.
,
$
(
'span.rating.clickable'
,
{
:
0
}
)
)
;
for
(
let
=
1
;
<=
5
;
++
)
{
if
(
>=
)
{
append
(
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
}
else
if
(
>=
-
0.5
)
{
append
(
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
}
else
{
append
(
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
}
}
if
(
this
.
.
)
{
const
=
append
(
,
$
(
'span'
,
undefined
,
` ( ${ this . extension. ratingCount} ) `
)
)
;
.
.
=
'1px'
;
}
this
.
=
this
.
_register
(
this
.
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
,
''
)
)
;
this
.
.
update
(
localize
(
'ratedLabel'
,
"Average rating: {0} out of 5"
,
)
)
;
.
setAttribute
(
'role'
,
'link'
)
;
if
(
this
.
.
)
{
this
.
.
add
(
onClick
(
,
(
)
=>
this
.
.
open
(
URI
.
parse
(
this
.
!
.
!
)
)
)
)
;
}
}
}
}
export
class
PublisherWidget
extends
ExtensionWidget
{
private
:
|
undefined
;
private
:
|
undefined
;
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
readonly
:
,
private
:
boolean
,
@ IExtensionsWorkbenchService
private
readonly
:
,
@ IHoverService
private
readonly
:
,
@ IOpenerService
private
readonly
:
,
)
{
super
(
)
;
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
}
private
clear
(
)
:
void
{
this
.
?.
remove
(
)
;
this
.
.
clear
(
)
;
}
render
(
)
:
void
{
this
.
clear
(
)
;
if
(
!
this
.
)
{
return
;
}
if
(
this
.
.
)
{
return
;
}
if
(
this
.
.
?.
===
'resource'
)
{
return
;
}
this
.
=
append
(
this
.
,
$
(
'.publisher'
)
)
;
const
=
$
(
'.publisher-name.ellipsis'
)
;
.
=
this
.
.
;
const
=
$
(
'.verified-publisher'
)
;
append
(
,
$
(
'span.extension-verified-publisher.clickable'
)
,
renderIcon
(
)
)
;
if
(
this
.
)
{
if
(
this
.
.
?.
)
{
append
(
this
.
,
)
;
}
append
(
this
.
,
)
;
}
else
{
this
.
.
.
toggle
(
'clickable'
,
!
!
this
.
.
)
;
this
.
.
setAttribute
(
'role'
,
'button'
)
;
this
.
.
=
0
;
this
.
=
this
.
.
add
(
this
.
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
this
.
,
localize
(
'publisher'
,
"Publisher ({0})"
,
this
.
.
)
)
)
;
append
(
this
.
,
)
;
if
(
this
.
.
?.
)
{
append
(
this
.
,
)
;
const
=
URI
.
parse
(
this
.
.
.
)
;
.
=
0
;
.
setAttribute
(
'role'
,
'button'
)
;
this
.
.
update
(
localize
(
'verified publisher'
,
"This publisher has verified ownership of {0}"
,
this
.
.
.
)
)
;
.
setAttribute
(
'role'
,
'link'
)
;
append
(
,
$
(
'span.extension-verified-publisher-domain'
,
undefined
,
.
.
startsWith
(
'www.'
)
?
.
.
substring
(
4
)
:
.
)
)
;
this
.
.
add
(
onClick
(
,
(
)
=>
this
.
.
open
(
)
)
)
;
}
if
(
this
.
.
)
{
this
.
.
add
(
onClick
(
this
.
,
(
)
=>
this
.
.
openSearch
(
` publisher:" ${ this . extension?. publisherDisplayName} " `
)
)
)
;
}
}
}
}
export
class
SponsorWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
readonly
:
,
@ IHoverService
private
readonly
:
,
@ IOpenerService
private
readonly
:
,
)
{
super
(
)
;
this
.
render
(
)
;
}
render
(
)
:
void
{
reset
(
this
.
)
;
this
.
.
clear
(
)
;
if
(
!
this
.
?.
)
{
return
;
}
const
=
append
(
this
.
,
$
(
'span.sponsor.clickable'
,
{
:
0
}
)
)
;
this
.
.
add
(
this
.
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
,
this
.
?.
.
toString
(
)
??
''
)
)
;
.
setAttribute
(
'role'
,
'link'
)
;
const
=
renderIcon
(
)
;
const
=
$
(
'span'
,
undefined
,
localize
(
'sponsor'
,
"Sponsor"
)
)
;
append
(
,
,
)
;
this
.
.
add
(
onClick
(
,
(
)
=>
{
this
.
.
open
(
this
.
!
.
!
)
;
}
)
)
;
}
}
export
class
RecommendationWidget
extends
ExtensionWidget
{
private
?
:
;
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
private
:
,
@ IExtensionRecommendationsService
private
readonly
:
)
{
super
(
)
;
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
this
.
_register
(
this
.
.
onDidChangeRecommendations
(
(
)
=>
this
.
render
(
)
)
)
;
}
private
clear
(
)
:
void
{
this
.
?.
remove
(
)
;
this
.
=
undefined
;
this
.
.
clear
(
)
;
}
render
(
)
:
void
{
this
.
clear
(
)
;
if
(
!
this
.
||
this
.
.
===
.
||
this
.
.
)
{
return
;
}
const
=
this
.
.
getAllRecommendationsWithReason
(
)
;
if
(
[
this
.
.
.
.
toLowerCase
(
)
]
)
{
this
.
=
append
(
this
.
,
$
(
'div.extension-bookmark'
)
)
;
const
=
append
(
this
.
,
$
(
'.recommendation'
)
)
;
append
(
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
}
}
}
export
class
PreReleaseBookmarkWidget
extends
ExtensionWidget
{
private
?
:
;
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
private
:
,
)
{
super
(
)
;
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
}
private
clear
(
)
:
void
{
this
.
?.
remove
(
)
;
this
.
=
undefined
;
this
.
.
clear
(
)
;
}
render
(
)
:
void
{
this
.
clear
(
)
;
if
(
this
.
?.
===
.
?
this
.
.
:
this
.
?.
)
{
this
.
=
append
(
this
.
,
$
(
'div.extension-bookmark'
)
)
;
const
=
append
(
this
.
,
$
(
'.pre-release'
)
)
;
append
(
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
}
}
}
export
class
RemoteBadgeWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
MutableDisposable< ExtensionIconBadge>
(
)
)
;
private
:
;
constructor
(
:
,
private
readonly
:
boolean
,
@ IExtensionManagementServerService
private
readonly
:
,
@ IInstantiationService
private
readonly
:
)
{
super
(
)
;
this
.
=
append
(
,
$
(
''
)
)
;
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
}
private
clear
(
)
:
void
{
this
.
.
?.
.
remove
(
)
;
this
.
.
clear
(
)
;
}
render
(
)
:
void
{
this
.
clear
(
)
;
if
(
!
this
.
||
!
this
.
.
||
!
this
.
.
||
!
(
this
.
.
&&
this
.
.
)
||
this
.
.
!==
this
.
.
)
{
return
;
}
let
:
string
|
undefined
;
if
(
this
.
&&
this
.
.
)
{
=
localize
(
'remote extension title'
,
"Extension in {0}"
,
this
.
.
.
)
;
}
this
.
.
=
this
.
.
createInstance
(
,
,
)
;
append
(
this
.
,
this
.
.
.
)
;
}
}
export
class
ExtensionIconBadge
extends
Disposable
{
readonly
:
;
readonly
:
;
constructor
(
private
readonly
:
,
private
readonly
:
string
|
undefined
,
@ IHoverService
:
,
@ ILabelService
private
readonly
:
,
@ IThemeService
private
readonly
:
,
)
{
super
(
)
;
this
.
=
$
(
'div.extension-badge.extension-icon-badge'
)
;
this
.
=
this
.
_register
(
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
this
.
,
''
)
)
;
this
.
render
(
)
;
}
private
render
(
)
:
void
{
append
(
this
.
,
$
(
'span'
+
.
asCSSSelector
(
this
.
)
)
)
;
const
applyBadgeStyle
=
(
)
=>
{
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
getColorTheme
(
)
.
getColor
(
EXTENSION_BADGE_BACKGROUND
)
;
const
=
this
.
.
getColorTheme
(
)
.
getColor
(
EXTENSION_BADGE_FOREGROUND
)
;
this
.
.
.
=
?
.
toString
(
)
:
''
;
this
.
.
.
=
?
.
toString
(
)
:
''
;
}
;
applyBadgeStyle
(
)
;
this
.
_register
(
this
.
.
onDidColorThemeChange
(
(
)
=>
applyBadgeStyle
(
)
)
)
;
if
(
this
.
)
{
const
updateTitle
=
(
)
=>
{
if
(
this
.
)
{
this
.
.
update
(
this
.
)
;
}
}
;
this
.
_register
(
this
.
.
onDidChangeFormatters
(
(
)
=>
updateTitle
(
)
)
)
;
updateTitle
(
)
;
}
}
}
export
class
ExtensionPackCountWidget
extends
ExtensionWidget
{
private
:
|
undefined
;
private
:
|
undefined
;
constructor
(
private
readonly
:
,
)
{
super
(
)
;
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
}
private
clear
(
)
:
void
{
this
.
?.
remove
(
)
;
this
.
?.
dispose
(
)
;
this
.
=
undefined
;
}
render
(
)
:
void
{
this
.
clear
(
)
;
if
(
!
this
.
||
!
(
this
.
.
?.
some
(
=>
.
toLowerCase
(
)
===
'extension packs'
)
)
||
!
this
.
.
.
)
{
return
;
}
this
.
=
append
(
this
.
,
$
(
'.extension-badge.extension-pack-badge'
)
)
;
this
.
=
new
CountBadge
(
this
.
,
{
}
,
)
;
this
.
.
setCount
(
this
.
.
.
)
;
}
}
export
class
ExtensionKindIndicatorWidget
extends
ExtensionWidget
{
private
:
|
undefined
;
private
:
|
null
=
null
;
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
readonly
:
,
private
:
boolean
,
@ IHoverService
private
readonly
:
,
@ IWorkspaceContextService
private
readonly
:
,
@ IUriIdentityService
private
readonly
:
,
@ IExplorerService
private
readonly
:
,
@ IViewsService
private
readonly
:
,
@ IExtensionGalleryManifestService
:
,
)
{
super
(
)
;
this
.
render
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
clear
(
)
)
)
;
.
getExtensionGalleryManifest
(
)
.
then
(
=>
{
if
(
this
.
.
)
{
return
;
}
this
.
=
;
this
.
render
(
)
;
}
)
;
}
private
clear
(
)
:
void
{
this
.
?.
remove
(
)
;
this
.
.
clear
(
)
;
}
render
(
)
:
void
{
this
.
clear
(
)
;
if
(
!
this
.
)
{
return
;
}
if
(
this
.
?.
)
{
this
.
=
append
(
this
.
,
$
(
'.extension-kind-indicator'
)
)
;
if
(
!
this
.
||
(
this
.
?.
.
?.
&&
this
.
?.
.
?.
)
)
{
append
(
this
.
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
}
if
(
!
this
.
)
{
append
(
this
.
,
$
(
'span.private-extension-label'
,
undefined
,
localize
(
'privateExtension'
,
"Private Extension"
)
)
)
;
}
return
;
}
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
?.
??
(
this
.
.
?.
===
'resource'
?
this
.
.
?.
:
undefined
)
;
if
(
!
)
{
return
;
}
this
.
=
append
(
this
.
,
$
(
'.extension-kind-indicator'
)
)
;
const
=
this
.
.
getWorkspaceFolder
(
)
;
if
(
&&
this
.
.
)
{
this
.
.
=
localize
(
'workspace extension'
,
"Workspace Extension"
)
;
this
.
.
.
add
(
'clickable'
)
;
this
.
.
setAttribute
(
'role'
,
'button'
)
;
this
.
.
add
(
this
.
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
this
.
,
this
.
.
.
relativePath
(
.
,
)
)
)
;
this
.
.
add
(
onClick
(
this
.
,
(
)
=>
{
this
.
.
openView
(
EXPLORER_VIEW_ID
,
true
)
.
then
(
(
)
=>
this
.
.
select
(
,
true
)
)
;
}
)
)
;
}
else
{
this
.
.
add
(
this
.
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
this
.
,
.
)
)
;
this
.
.
=
localize
(
'local extension'
,
"Local Extension"
)
;
}
}
}
export
class
SyncIgnoredWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
private
readonly
:
,
@ IConfigurationService
private
readonly
:
,
@ IExtensionsWorkbenchService
private
readonly
:
,
@ IHoverService
private
readonly
:
,
@ IUserDataSyncEnablementService
private
readonly
:
,
)
{
super
(
)
;
this
.
_register
(
.
filter
(
this
.
.
,
=>
.
affectsConfiguration
(
'settingsSync.ignoredExtensions'
)
)
(
(
)
=>
this
.
render
(
)
)
)
;
this
.
_register
(
.
onDidChangeEnablement
(
(
)
=>
this
.
update
(
)
)
)
;
this
.
render
(
)
;
}
render
(
)
:
void
{
this
.
.
clear
(
)
;
this
.
.
=
''
;
if
(
this
.
&&
this
.
.
===
.
&&
this
.
.
isEnabled
(
)
&&
this
.
.
isExtensionIgnoredToSync
(
this
.
)
)
{
const
=
append
(
this
.
,
$
(
'span.extension-sync-ignored'
+
.
asCSSSelector
(
)
)
)
;
this
.
.
add
(
this
.
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
,
localize
(
'syncingore.label'
,
"This extension is ignored during sync."
)
)
)
;
.
.
add
(
...
.
asClassNameArray
(
)
)
;
}
}
}
export
class
ExtensionRestartRequiredWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
DisposableStore
(
)
)
;
constructor
(
private
readonly
:
,
@ IHoverService
private
readonly
:
,
)
{
super
(
)
;
}
render
(
)
:
void
{
this
.
.
clear
(
)
;
this
.
.
=
''
;
const
=
this
.
?.
;
const
=
typeof
?.
===
'string'
?
.
:
''
;
if
(
&&
/ restart| reload / i
.
test
(
)
)
{
const
=
append
(
this
.
,
$
(
'span.extension-restart-required'
+
.
asCSSSelector
(
)
)
)
;
append
(
this
.
,
$
(
'span.extension-restart-required-label'
,
undefined
,
localize
(
'restart required'
,
"Restart Required"
)
)
)
;
this
.
.
add
(
this
.
.
setupManagedHover
(
getDefaultHoverDelegate
(
'mouse'
)
,
,
)
)
;
}
}
}
export
class
ExtensionRuntimeStatusWidget
extends
ExtensionWidget
{
constructor
(
private
readonly
:
,
private
readonly
:
,
@ IExtensionService
:
,
@ IExtensionFeaturesManagementService
private
readonly
:
,
@ IExtensionsWorkbenchService
private
readonly
:
,
)
{
super
(
)
;
this
.
_register
(
.
onDidChangeExtensionsStatus
(
=>
{
if
(
this
.
&&
.
some
(
=>
areSameExtensions
(
{
:
.
}
,
this
.
!
.
)
)
)
{
this
.
update
(
)
;
}
}
)
)
;
this
.
_register
(
.
onDidChangeAccessData
(
=>
{
if
(
this
.
&&
.
equals
(
this
.
.
.
,
.
)
)
{
this
.
update
(
)
;
}
}
)
)
;
}
render
(
)
:
void
{
this
.
.
=
''
;
if
(
!
this
.
)
{
return
;
}
if
(
this
.
.
.
&&
this
.
.
===
.
)
{
const
=
this
.
.
getAllAccessDataForExtension
(
new
ExtensionIdentifier
(
this
.
.
.
)
)
.
get
(
this
.
.
.
)
;
const
=
.
as < IExtensionFeaturesRegistry>
(
.
)
.
getExtensionFeature
(
this
.
.
.
)
;
if
(
?.
&&
)
{
const
=
append
(
this
.
,
$
(
'span.activationTime'
)
)
;
.
=
localize
(
'feature access label'
,
"{0} reqs"
,
.
.
)
;
const
=
append
(
this
.
,
$
(
'span'
+
.
asCSSSelector
(
.
)
)
)
;
.
.
=
'4px'
;
return
;
}
}
const
=
this
.
.
getExtensionRuntimeStatus
(
this
.
)
;
if
(
?.
)
{
const
=
.
.
+
.
.
;
append
(
this
.
,
$
(
'span'
+
.
asCSSSelector
(
)
)
)
;
const
=
append
(
this
.
,
$
(
'span.activationTime'
)
)
;
.
=
` ${ activationTime} ms `
;
}
}
}
export
type
ExtensionHoverOptions
=
{
position
:
(
)
=>
;
readonly
:
;
}
;
export
class
ExtensionHoverWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
MutableDisposable< IDisposable>
(
)
)
;
constructor
(
private
readonly
:
,
private
readonly
:
,
@ IExtensionsWorkbenchService
private
readonly
:
,
@ IExtensionFeaturesManagementService
private
readonly
:
,
@ IHoverService
private
readonly
:
,
@ IConfigurationService
private
readonly
:
,
@ IExtensionRecommendationsService
private
readonly
:
,
@ IThemeService
private
readonly
:
,
@ IWorkspaceContextService
private
readonly
:
,
)
{
super
(
)
;
}
render
(
)
:
void
{
this
.
.
=
undefined
;
if
(
this
.
)
{
this
.
.
=
this
.
.
setupManagedHover
(
{
:
this
.
.
getValue < number >
(
'workbench.hover.delay'
)
,
showHover
:
(
,
)
=>
{
return
this
.
.
showInstantHover
(
{
...
,
:
[
'extension-hover'
]
,
:
{
:
this
.
.
position
(
)
,
:
true
,
}
,
:
{
:
true
,
}
}
,
)
;
}
,
:
'element'
}
,
this
.
.
,
{
markdown
:
async
(
)
=>
{
try
{
await
this
.
.
recomputeStatus
(
)
;
}
catch
(
)
{
}
return
this
.
getHoverMarkdown
(
)
;
}
,
:
undefined
}
,
{
:
{
:
true
}
}
)
;
}
}
private
getHoverMarkdown
(
)
:
|
undefined
{
if
(
!
this
.
)
{
return
undefined
;
}
const
=
new
MarkdownString
(
''
,
{
:
true
,
:
true
}
)
;
.
appendMarkdown
(
` ** `
)
.
appendText
(
this
.
.
)
.
appendMarkdown
(
` ** `
)
;
if
(
.
valid
(
this
.
.
)
)
{
.
appendMarkdown
(
` <span style="background-color:#8080802B;">** _v ${ this . extension. version} ${ ( this . extension. isPreReleaseVersion ? ' (pre-release)' : '' ) } _** </span> `
)
;
}
.
appendText
(
` \n `
)
;
let
=
false
;
if
(
this
.
.
)
{
.
appendMarkdown
(
` $( ${ privateExtensionIcon. id} ) ${ localize ( 'privateExtension' , "Private Extension" ) } `
)
;
=
true
;
}
if
(
this
.
.
===
.
)
{
const
=
.
getInstallLabel
(
this
.
,
true
)
;
if
(
)
{
if
(
)
{
.
appendText
(
` | `
)
;
}
.
appendMarkdown
(
` $( ${ installCountIcon. id} ) ${ installLabel} `
)
;
=
true
;
}
if
(
this
.
.
)
{
if
(
)
{
.
appendText
(
` | `
)
;
}
const
=
.
round
(
this
.
.
*
2
)
/
2
;
.
appendMarkdown
(
` $( ${ starFullIcon. id} ) [ ${ rating} ]( ${ this . extension. url} &ssr=false#review-details) `
)
;
=
true
;
}
if
(
this
.
.
)
{
if
(
)
{
.
appendText
(
` | `
)
;
}
.
appendMarkdown
(
` $( ${ sponsorIcon. id} ) [ ${ localize ( 'sponsor' , "Sponsor" ) } ]( ${ this . extension. publisherSponsorLink} ) `
)
;
=
true
;
}
}
if
(
)
{
.
appendText
(
` \n `
)
;
}
const
=
this
.
.
?.
??
(
this
.
.
?.
===
'resource'
?
this
.
.
?.
:
undefined
)
;
if
(
)
{
if
(
this
.
.
&&
this
.
.
isInsideWorkspace
(
)
)
{
.
appendMarkdown
(
localize
(
'workspace extension'
,
"Workspace Extension"
)
)
;
}
else
{
.
appendMarkdown
(
localize
(
'local extension'
,
"Local Extension"
)
)
;
}
.
appendText
(
` \n `
)
;
}
if
(
this
.
.
)
{
.
appendText
(
this
.
.
)
;
.
appendText
(
` \n `
)
;
}
if
(
this
.
.
?.
)
{
const
=
this
.
.
getColorTheme
(
)
.
getColor
(
)
;
const
=
localize
(
'publisher verified tooltip'
,
"This publisher has verified ownership of {0}"
,
` [ ${ URI . parse ( this . extension. publisherDomain. link) . authority} ]( ${ this . extension. publisherDomain. link} ) `
)
;
.
appendMarkdown
(
` <span style="color: ${ bgColor ? Color. Format. CSS . formatHex ( bgColor) : '#ffffff' } ;">$( ${ verifiedPublisherIcon. id} )</span> ${ publisherVerifiedTooltip} `
)
;
.
appendText
(
` \n `
)
;
}
if
(
this
.
.
)
{
.
appendMarkdown
(
localize
(
'updateRequired'
,
"Latest version:"
)
)
;
.
appendMarkdown
(
` <span style="background-color:#8080802B;">** _v ${ this . extension. latestVersion} _** </span> `
)
;
.
appendText
(
` \n `
)
;
}
const
=
.
getPreReleaseMessage
(
this
.
)
;
const
=
this
.
.
getExtensionRuntimeStatus
(
this
.
)
;
const
=
this
.
.
getAllAccessDataForExtension
(
new
ExtensionIdentifier
(
this
.
.
.
)
)
;
const
=
this
.
.
;
const
=
this
.
.
;
const
=
this
.
getRecommendationMessage
(
this
.
)
;
if
(
||
.
||
.
||
||
||
)
{
.
appendMarkdown
(
` --- `
)
;
.
appendText
(
` \n `
)
;
if
(
)
{
if
(
.
)
{
const
=
.
.
+
.
.
;
.
appendMarkdown
(
` ${ localize ( 'activation' , "Activation time" ) } ${ extensionRuntimeStatus. activationTimes. activationReason. startup ? ` ( ${ localize ( 'startup' , "Startup" ) } ) ` : '' } : \` ${ activationTime} ms\` `
)
;
.
appendText
(
` \n `
)
;
}
if
(
.
.
||
.
.
)
{
const
=
.
.
||
.
.
some
(
=>
.
===
.
)
;
const
=
.
.
some
(
=>
.
===
.
)
;
const
=
.
.
?
` [ ${ extensionRuntimeStatus. runtimeErrors. length === 1 ? localize ( 'uncaught error' , '1 uncaught error' ) : localize ( 'uncaught errors' , '{0} uncaught errors' , extensionRuntimeStatus. runtimeErrors. length) } ]( ${ createCommandUri ( 'extension.open' , this . extension. identifier. id, ExtensionEditorTab. Features) } ) `
:
undefined
;
const
=
.
.
?
` [ ${ extensionRuntimeStatus. messages. length === 1 ? localize ( 'message' , '1 message' ) : localize ( 'messages' , '{0} messages' , extensionRuntimeStatus. messages. length) } ]( ${ createCommandUri ( 'extension.open' , this . extension. identifier. id, ExtensionEditorTab. Features) } ) `
:
undefined
;
.
appendMarkdown
(
` $( ${ hasErrors ? errorIcon. id : hasWarnings ? warningIcon. id : infoIcon. id} ) This extension has reported `
)
;
if
(
&&
)
{
.
appendMarkdown
(
` ${ errorsLink} and ${ messageLink} `
)
;
}
else
{
.
appendMarkdown
(
` ${ errorsLink || messageLink} `
)
;
}
.
appendText
(
` \n `
)
;
}
}
if
(
.
)
{
const
=
.
as < IExtensionFeaturesRegistry>
(
.
)
;
for
(
const
[
,
]
of
)
{
if
(
?.
.
)
{
const
=
.
getExtensionFeature
(
)
;
if
(
)
{
.
appendMarkdown
(
localize
(
'feature usage label'
,
"{0} usage"
,
.
)
)
;
.
appendMarkdown
(
` : [ ${ localize ( 'total' , "{0} {1} requests in last 30 days" , accessData. accessTimes. length, feature. accessDataLabel ?? feature. label) } ]( ${ createCommandUri ( 'extension.open' , this . extension. identifier. id, ExtensionEditorTab. Features) } ) `
)
;
.
appendText
(
` \n `
)
;
}
}
}
}
for
(
const
of
)
{
if
(
.
)
{
.
appendMarkdown
(
` $( ${ status. icon. id} ) `
)
;
}
.
appendMarkdown
(
.
.
)
;
.
appendText
(
` \n `
)
;
}
if
(
)
{
.
appendMarkdown
(
` $( ${ infoIcon. id} ) `
)
;
.
appendMarkdown
(
` ${ runtimeState. reason} `
)
;
.
appendText
(
` \n `
)
;
}
if
(
)
{
const
=
this
.
.
getColorTheme
(
)
.
getColor
(
)
;
.
appendMarkdown
(
` <span style="color: ${ extensionPreReleaseIcon ? Color. Format. CSS . formatHex ( extensionPreReleaseIcon) : '#ffffff' } ;">$( ${ preReleaseIcon. id} )</span> ${ preReleaseMessage} `
)
;
.
appendText
(
` \n `
)
;
}
if
(
)
{
.
appendMarkdown
(
)
;
.
appendText
(
` \n `
)
;
}
}
return
;
}
private
getRecommendationMessage
(
:
)
:
string
|
undefined
{
if
(
.
===
.
)
{
return
undefined
;
}
if
(
.
)
{
return
undefined
;
}
const
=
this
.
.
getAllRecommendationsWithReason
(
)
[
.
.
.
toLowerCase
(
)
]
;
if
(
!
?.
)
{
return
undefined
;
}
const
=
this
.
.
getColorTheme
(
)
.
getColor
(
)
;
return
` <span style="color: ${ bgColor ? Color. Format. CSS . formatHex ( bgColor) : '#ffffff' } ;">$( ${ starEmptyIcon. id} )</span> ${ recommendation. reasonText} `
;
}
static
getPreReleaseMessage
(
:
)
:
string
|
undefined
{
if
(
!
.
)
{
return
undefined
;
}
if
(
.
)
{
return
undefined
;
}
if
(
.
)
{
return
undefined
;
}
if
(
.
)
{
return
undefined
;
}
const
=
` [ ${ localize ( 'Show prerelease version' , "Pre-Release version" ) } ]( ${ createCommandUri ( 'workbench.extensions.action.showPreReleaseVersion' , extension. identifier. id) } ) `
;
return
localize
(
'has prerelease'
,
"This extension has a {0} available"
,
)
;
}
}
export
class
ExtensionStatusWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
MutableDisposable
(
)
)
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
constructor
(
private
readonly
:
,
private
readonly
:
,
@ IMarkdownRendererService
private
readonly
:
,
)
{
super
(
)
;
this
.
render
(
)
;
this
.
_register
(
.
onDidChangeStatus
(
(
)
=>
this
.
render
(
)
)
)
;
}
render
(
)
:
void
{
reset
(
this
.
)
;
this
.
.
=
undefined
;
const
=
new
DisposableStore
(
)
;
this
.
.
=
;
const
=
this
.
.
;
if
(
.
)
{
const
=
new
MarkdownString
(
''
,
{
:
true
,
:
true
}
)
;
for
(
let
=
0
;
<
.
;
++
)
{
const
=
[
]
;
if
(
.
)
{
.
appendMarkdown
(
` $( ${ status. icon. id} ) `
)
;
}
.
appendMarkdown
(
.
.
)
;
if
(
<
.
-
1
)
{
.
appendText
(
` \n `
)
;
}
}
const
=
.
add
(
this
.
.
render
(
)
)
;
append
(
this
.
,
.
)
;
}
this
.
.
fire
(
)
;
}
}
export
class
ExtensionRecommendationWidget
extends
ExtensionWidget
{
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
constructor
(
private
readonly
:
,
@ IExtensionRecommendationsService
private
readonly
:
,
@ IExtensionIgnoredRecommendationsService
private
readonly
:
,
)
{
super
(
)
;
this
.
render
(
)
;
this
.
_register
(
this
.
.
onDidChangeRecommendations
(
(
)
=>
this
.
render
(
)
)
)
;
}
render
(
)
:
void
{
reset
(
this
.
)
;
const
=
this
.
getRecommendationStatus
(
)
;
if
(
)
{
if
(
.
)
{
append
(
this
.
,
$
(
` div ${ ThemeIcon. asCSSSelector ( recommendationStatus. icon) } `
)
)
;
}
append
(
this
.
,
$
(
` div.recommendation-text `
,
undefined
,
.
)
)
;
}
this
.
.
fire
(
)
;
}
private
getRecommendationStatus
(
)
:
{
:
|
undefined
;
:
string
}
|
undefined
{
if
(
!
this
.
||
this
.
.
||
this
.
.
===
.
)
{
return
undefined
;
}
const
=
this
.
.
getAllRecommendationsWithReason
(
)
;
if
(
[
this
.
.
.
.
toLowerCase
(
)
]
)
{
const
=
[
this
.
.
.
.
toLowerCase
(
)
]
.
;
if
(
)
{
return
{
:
,
:
}
;
}
}
else
if
(
this
.
.
.
indexOf
(
this
.
.
.
.
toLowerCase
(
)
)
!==
-
1
)
{
return
{
:
undefined
,
:
localize
(
'recommendationHasBeenIgnored'
,
"You have chosen not to receive recommendations for this extension."
)
}
;
}
return
undefined
;
}
}
export
const
=
registerColor
(
'extensionIcon.starForeground'
,
{
:
'#DF6100'
,
:
'#FF8E00'
,
:
'#FF8E00'
,
:
}
,
localize
(
'extensionIconStarForeground'
,
"The icon color for extension ratings."
)
,
false
)
;
export
const
=
registerColor
(
'extensionIcon.preReleaseForeground'
,
{
:
'#1d9271'
,
:
'#1d9271'
,
:
'#1d9271'
,
:
}
,
localize
(
'extensionPreReleaseForeground'
,
"The icon color for pre-release extension."
)
,
false
)
;
export
const
=
registerColor
(
'extensionIcon.sponsorForeground'
,
{
:
'#B51E78'
,
:
'#D758B3'
,
:
null
,
:
'#B51E78'
}
,
localize
(
'extensionIcon.sponsorForeground'
,
"The icon color for extension sponsor."
)
,
false
)
;
export
const
=
registerColor
(
'extensionIcon.privateForeground'
,
{
:
'#ffffff60'
,
:
'#00000060'
,
:
'#ffffff60'
,
:
'#00000060'
}
,
localize
(
'extensionIcon.private'
,
"The icon color for private extensions."
)
)
;
registerThemingParticipant
(
(
,
)
=>
{
const
=
.
getColor
(
)
;
if
(
)
{
.
addRule
(
` .extension-ratings .codicon-extensions-star-full, .extension-ratings .codicon-extensions-star-half { color: ${ extensionRatingIcon} ; } `
)
;
.
addRule
(
` .monaco-hover.extension-hover .markdown-hover .hover-contents ${ ThemeIcon. asCSSSelector ( starFullIcon) } { color: ${ extensionRatingIcon} ; } `
)
;
}
const
=
.
getColor
(
)
;
if
(
)
{
.
addRule
(
` ${ ThemeIcon. asCSSSelector ( verifiedPublisherIcon) } { color: ${ extensionVerifiedPublisherIcon} ; } `
)
;
}
.
addRule
(
` .monaco-hover.extension-hover .markdown-hover .hover-contents ${ ThemeIcon. asCSSSelector ( sponsorIcon) } { color: var(--vscode-extensionIcon-sponsorForeground); } `
)
;
.
addRule
(
` .extension-editor > .header > .details > .subtitle .sponsor ${ ThemeIcon. asCSSSelector ( sponsorIcon) } { color: var(--vscode-extensionIcon-sponsorForeground); } `
)
;
const
=
.
getColor
(
)
;
if
(
)
{
.
addRule
(
` .extension-private-badge { color: ${ privateBadgeBackground} ; } `
)
;
}
}
)
;