Skip to content

Commit cc04b7d

Browse files
address Keith's feedback
1 parent a65f946 commit cc04b7d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/features/ExtensionCommands.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ export class ExtensionCommandsFeature implements IFeature {
193193
return;
194194
}
195195

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;
199199
if (editor.selection.isEmpty) {
200200
start = new vscode.Position(start.line, 0)
201201
}
@@ -303,7 +303,7 @@ export class ExtensionCommandsFeature implements IFeature {
303303
return;
304304
}
305305

306-
var quickPickItems =
306+
let quickPickItems =
307307
this.extensionCommands.map<ExtensionCommandQuickPickItem>(command => {
308308
return {
309309
label: command.displayName,
@@ -332,7 +332,7 @@ export class ExtensionCommandsFeature implements IFeature {
332332
}
333333

334334
private insertText(details: InsertTextRequestArguments): EditorOperationResponse {
335-
var edit = new vscode.WorkspaceEdit();
335+
let edit = new vscode.WorkspaceEdit();
336336

337337
edit.set(
338338
vscode.Uri.parse(details.filePath),
@@ -374,7 +374,7 @@ export class ExtensionCommandsFeature implements IFeature {
374374

375375
filePath = this.normalizeFilePath(filePath);
376376

377-
var promise =
377+
let promise =
378378
vscode.workspace.openTextDocument(filePath)
379379
.then(doc => vscode.window.showTextDocument(doc))
380380
.then(_ => EditorOperationResponse.Completed);
@@ -384,7 +384,7 @@ export class ExtensionCommandsFeature implements IFeature {
384384

385385
private closeFile(filePath: string): Thenable<EditorOperationResponse> {
386386

387-
var promise: Thenable<EditorOperationResponse>;
387+
let promise: Thenable<EditorOperationResponse>;
388388
if (this.findTextDocument(this.normalizeFilePath(filePath)))
389389
{
390390
promise =
@@ -403,12 +403,12 @@ export class ExtensionCommandsFeature implements IFeature {
403403

404404
private saveFile(filePath: string): Thenable<EditorOperationResponse> {
405405

406-
var promise: Thenable<EditorOperationResponse>;
406+
let promise: Thenable<EditorOperationResponse>;
407407
if (this.findTextDocument(this.normalizeFilePath(filePath)))
408408
{
409409
promise =
410410
vscode.workspace.openTextDocument(filePath)
411-
.then(doc => {
411+
.then((doc) => {
412412
if (doc.isDirty) {
413413
doc.save();
414414
}
@@ -424,7 +424,7 @@ export class ExtensionCommandsFeature implements IFeature {
424424
}
425425

426426
private normalizeFilePath(filePath: string): string {
427-
var platform = os.platform();
427+
let platform = os.platform();
428428
if (platform == "win32") {
429429
// Make sure the file path is absolute
430430
if (!path.win32.isAbsolute(filePath))
@@ -456,15 +456,15 @@ export class ExtensionCommandsFeature implements IFeature {
456456

457457
private findTextDocument(filePath: string): boolean {
458458
// 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();
461461
if (platform == "win32" || platform == "darwin") {
462462
// for Windows and macOS paths, they are normalized to be lowercase
463463
docPath = doc.fileName.toLowerCase();
464464
} else {
465465
docPath = doc.fileName;
466466
}
467-
return docPath == filePath;
467+
return docPath === filePath;
468468
});
469469

470470
return canFind != null;

0 commit comments

Comments
 (0)