@@ -193,9 +193,9 @@ export class ExtensionCommandsFeature implements IFeature {
193
193
return ;
194
194
}
195
195
196
- var editor = vscode . window . activeTextEditor ;
197
- var start = editor . selection . start ;
198
- var end = editor . selection . end ;
196
+ let editor = vscode . window . activeTextEditor ;
197
+ let start = editor . selection . start ;
198
+ let end = editor . selection . end ;
199
199
if ( editor . selection . isEmpty ) {
200
200
start = new vscode . Position ( start . line , 0 )
201
201
}
@@ -303,7 +303,7 @@ export class ExtensionCommandsFeature implements IFeature {
303
303
return ;
304
304
}
305
305
306
- var quickPickItems =
306
+ let quickPickItems =
307
307
this . extensionCommands . map < ExtensionCommandQuickPickItem > ( command => {
308
308
return {
309
309
label : command . displayName ,
@@ -332,7 +332,7 @@ export class ExtensionCommandsFeature implements IFeature {
332
332
}
333
333
334
334
private insertText ( details : InsertTextRequestArguments ) : EditorOperationResponse {
335
- var edit = new vscode . WorkspaceEdit ( ) ;
335
+ let edit = new vscode . WorkspaceEdit ( ) ;
336
336
337
337
edit . set (
338
338
vscode . Uri . parse ( details . filePath ) ,
@@ -374,7 +374,7 @@ export class ExtensionCommandsFeature implements IFeature {
374
374
375
375
filePath = this . normalizeFilePath ( filePath ) ;
376
376
377
- var promise =
377
+ let promise =
378
378
vscode . workspace . openTextDocument ( filePath )
379
379
. then ( doc => vscode . window . showTextDocument ( doc ) )
380
380
. then ( _ => EditorOperationResponse . Completed ) ;
@@ -384,7 +384,7 @@ export class ExtensionCommandsFeature implements IFeature {
384
384
385
385
private closeFile ( filePath : string ) : Thenable < EditorOperationResponse > {
386
386
387
- var promise : Thenable < EditorOperationResponse > ;
387
+ let promise : Thenable < EditorOperationResponse > ;
388
388
if ( this . findTextDocument ( this . normalizeFilePath ( filePath ) ) )
389
389
{
390
390
promise =
@@ -403,12 +403,12 @@ export class ExtensionCommandsFeature implements IFeature {
403
403
404
404
private saveFile ( filePath : string ) : Thenable < EditorOperationResponse > {
405
405
406
- var promise : Thenable < EditorOperationResponse > ;
406
+ let promise : Thenable < EditorOperationResponse > ;
407
407
if ( this . findTextDocument ( this . normalizeFilePath ( filePath ) ) )
408
408
{
409
409
promise =
410
410
vscode . workspace . openTextDocument ( filePath )
411
- . then ( doc => {
411
+ . then ( ( doc ) => {
412
412
if ( doc . isDirty ) {
413
413
doc . save ( ) ;
414
414
}
@@ -424,7 +424,7 @@ export class ExtensionCommandsFeature implements IFeature {
424
424
}
425
425
426
426
private normalizeFilePath ( filePath : string ) : string {
427
- var platform = os . platform ( ) ;
427
+ let platform = os . platform ( ) ;
428
428
if ( platform == "win32" ) {
429
429
// Make sure the file path is absolute
430
430
if ( ! path . win32 . isAbsolute ( filePath ) )
@@ -456,15 +456,15 @@ export class ExtensionCommandsFeature implements IFeature {
456
456
457
457
private findTextDocument ( filePath : string ) : boolean {
458
458
// since Windows and macOS are case-insensitive, we need to normalize them differently
459
- var canFind = vscode . workspace . textDocuments . find ( doc => {
460
- var docPath , platform = os . platform ( ) ;
459
+ let canFind = vscode . workspace . textDocuments . find ( doc => {
460
+ let docPath , platform = os . platform ( ) ;
461
461
if ( platform == "win32" || platform == "darwin" ) {
462
462
// for Windows and macOS paths, they are normalized to be lowercase
463
463
docPath = doc . fileName . toLowerCase ( ) ;
464
464
} else {
465
465
docPath = doc . fileName ;
466
466
}
467
- return docPath == filePath ;
467
+ return docPath === filePath ;
468
468
} ) ;
469
469
470
470
return canFind != null ;
0 commit comments