From 98291f7fbdcdc80a50f7d437cff512a66efc1c05 Mon Sep 17 00:00:00 2001 From: Nick Fode Date: Tue, 11 Apr 2017 00:08:18 +0200 Subject: [PATCH] clean up --- src/extension.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index d556c80..97280d5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -11,11 +11,10 @@ export class LaTexFormatter { public formatDocument(document: vscode.TextDocument): Thenable { return new Promise((resolve, reject) => { let formatter = 'latexindent'; - let filename = document.fileName; - var edit = null; + cp.exec(formatter + filename, (err, stdout, stderr) => { - edit = [vscode.TextEdit.replace(fullRange(document), stdout)]; + var edit = [vscode.TextEdit.replace(fullRange(document), stdout)]; return resolve(edit); });