@@ -98,7 +98,7 @@ function isValidContributedKeyBinding(keyBinding: ContributedKeyBinding, rejects
98
98
return true ;
99
99
}
100
100
101
- let keybindingType : IJSONSchema = {
101
+ const keybindingType : IJSONSchema = {
102
102
type : 'object' ,
103
103
default : { command : '' , key : '' } ,
104
104
properties : {
@@ -205,7 +205,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
205
205
206
206
let dispatchConfig = getDispatchConfig ( configurationService ) ;
207
207
configurationService . onDidChangeConfiguration ( ( e ) => {
208
- let newDispatchConfig = getDispatchConfig ( configurationService ) ;
208
+ const newDispatchConfig = getDispatchConfig ( configurationService ) ;
209
209
if ( dispatchConfig === newDispatchConfig ) {
210
210
return ;
211
211
}
@@ -239,8 +239,8 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
239
239
240
240
keybindingsExtPoint . setHandler ( ( extensions ) => {
241
241
242
- let keybindings : IKeybindingRule2 [ ] = [ ] ;
243
- for ( let extension of extensions ) {
242
+ const keybindings : IKeybindingRule2 [ ] = [ ] ;
243
+ for ( const extension of extensions ) {
244
244
this . _handleKeybindingsExtensionPointUser ( extension . description . identifier , extension . description . isBuiltin , extension . value , extension . collector , keybindings ) ;
245
245
}
246
246
@@ -275,7 +275,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
275
275
this . isComposingGlobalContextKey . set ( false ) ;
276
276
} ) ) ;
277
277
278
- let data = this . keyboardLayoutService . getCurrentKeyboardLayout ( ) ;
278
+ const data = this . keyboardLayoutService . getCurrentKeyboardLayout ( ) ;
279
279
/* __GDPR__FRAGMENT__
280
280
"IKeyboardLayoutInfo" : {
281
281
"name" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
@@ -379,7 +379,8 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
379
379
}
380
380
381
381
private _resolveKeybindingItems ( items : IKeybindingItem [ ] , isDefault : boolean ) : ResolvedKeybindingItem [ ] {
382
- let result : ResolvedKeybindingItem [ ] = [ ] , resultLen = 0 ;
382
+ const result : ResolvedKeybindingItem [ ] = [ ] ;
383
+ let resultLen = 0 ;
383
384
for ( const item of items ) {
384
385
const when = item . when || undefined ;
385
386
const keybinding = item . keybinding ;
@@ -403,7 +404,8 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
403
404
}
404
405
405
406
private _resolveUserKeybindingItems ( items : IUserKeybindingItem [ ] , isDefault : boolean ) : ResolvedKeybindingItem [ ] {
406
- let result : ResolvedKeybindingItem [ ] = [ ] , resultLen = 0 ;
407
+ const result : ResolvedKeybindingItem [ ] = [ ] ;
408
+ let resultLen = 0 ;
407
409
for ( const item of items ) {
408
410
const when = item . when || undefined ;
409
411
const parts = item . parts ;
@@ -430,7 +432,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
430
432
return false ;
431
433
}
432
434
433
- for ( let part of kb . parts ) {
435
+ for ( const part of kb . parts ) {
434
436
if ( ! part . metaKey && ! part . altKey && ! part . ctrlKey && ! part . shiftKey ) {
435
437
continue ;
436
438
}
@@ -517,10 +519,10 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
517
519
518
520
private _handleKeybinding ( extensionId : ExtensionIdentifier , isBuiltin : boolean , idx : number , keybindings : ContributedKeyBinding , collector : ExtensionMessageCollector , result : IKeybindingRule2 [ ] ) : void {
519
521
520
- let rejects : string [ ] = [ ] ;
522
+ const rejects : string [ ] = [ ] ;
521
523
522
524
if ( isValidContributedKeyBinding ( keybindings , rejects ) ) {
523
- let rule = this . _asCommandRule ( extensionId , isBuiltin , idx ++ , keybindings ) ;
525
+ const rule = this . _asCommandRule ( extensionId , isBuiltin , idx ++ , keybindings ) ;
524
526
if ( rule ) {
525
527
result . push ( rule ) ;
526
528
}
@@ -538,7 +540,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
538
540
539
541
private _asCommandRule ( extensionId : ExtensionIdentifier , isBuiltin : boolean , idx : number , binding : ContributedKeyBinding ) : IKeybindingRule2 | undefined {
540
542
541
- let { command, args, when, key, mac, linux, win } = binding ;
543
+ const { command, args, when, key, mac, linux, win } = binding ;
542
544
543
545
let weight : number ;
544
546
if ( isBuiltin ) {
@@ -547,8 +549,8 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
547
549
weight = KeybindingWeight . ExternalExtension + idx ;
548
550
}
549
551
550
- let commandAction = MenuRegistry . getCommand ( command ) ;
551
- let precondition = commandAction && commandAction . precondition ;
552
+ const commandAction = MenuRegistry . getCommand ( command ) ;
553
+ const precondition = commandAction && commandAction . precondition ;
552
554
let fullWhen : ContextKeyExpression | undefined ;
553
555
if ( when && precondition ) {
554
556
fullWhen = ContextKeyExpr . and ( precondition , ContextKeyExpr . deserialize ( when ) ) ;
@@ -558,7 +560,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
558
560
fullWhen = precondition ;
559
561
}
560
562
561
- let desc : IKeybindingRule2 = {
563
+ const desc : IKeybindingRule2 = {
562
564
id : command ,
563
565
args,
564
566
when : fullWhen ,
@@ -590,10 +592,10 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
590
592
}
591
593
592
594
private static _getDefaultKeybindings ( defaultKeybindings : readonly ResolvedKeybindingItem [ ] ) : string {
593
- let out = new OutputBuilder ( ) ;
595
+ const out = new OutputBuilder ( ) ;
594
596
out . writeLine ( '[' ) ;
595
597
596
- let lastIndex = defaultKeybindings . length - 1 ;
598
+ const lastIndex = defaultKeybindings . length - 1 ;
597
599
defaultKeybindings . forEach ( ( k , index ) => {
598
600
KeybindingIO . writeKeybindingItem ( out , k ) ;
599
601
if ( index !== lastIndex ) {
@@ -608,7 +610,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
608
610
609
611
private static _getAllCommandsAsComment ( boundCommands : Map < string , boolean > ) : string {
610
612
const unboundCommands = getAllUnboundCommands ( boundCommands ) ;
611
- let pretty = unboundCommands . sort ( ) . join ( '\n// - ' ) ;
613
+ const pretty = unboundCommands . sort ( ) . join ( '\n// - ' ) ;
612
614
return '// ' + nls . localize ( 'unboundCommands' , "Here are other available commands: " ) + '\n// - ' + pretty ;
613
615
}
614
616
@@ -707,11 +709,11 @@ class UserKeybindings extends Disposable {
707
709
}
708
710
}
709
711
710
- let schemaId = 'vscode://schemas/keybindings' ;
711
- let commandsSchemas : IJSONSchema [ ] = [ ] ;
712
- let commandsEnum : string [ ] = [ ] ;
713
- let commandsEnumDescriptions : ( string | undefined ) [ ] = [ ] ;
714
- let schema : IJSONSchema = {
712
+ const schemaId = 'vscode://schemas/keybindings' ;
713
+ const commandsSchemas : IJSONSchema [ ] = [ ] ;
714
+ const commandsEnum : string [ ] = [ ] ;
715
+ const commandsEnumDescriptions : ( string | undefined ) [ ] = [ ] ;
716
+ const schema : IJSONSchema = {
715
717
id : schemaId ,
716
718
type : 'array' ,
717
719
title : nls . localize ( 'keybindings.json.title' , "Keybindings configuration" ) ,
@@ -769,7 +771,7 @@ let schema: IJSONSchema = {
769
771
}
770
772
} ;
771
773
772
- let schemaRegistry = Registry . as < IJSONContributionRegistry > ( Extensions . JSONContribution ) ;
774
+ const schemaRegistry = Registry . as < IJSONContributionRegistry > ( Extensions . JSONContribution ) ;
773
775
schemaRegistry . registerSchema ( schemaId , schema ) ;
774
776
775
777
function updateSchema ( additionalContributions : readonly IJSONSchema [ ] ) {
0 commit comments