From 8f00179e1bb67dd81b639c82308454c5ae8fa6fe Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Tue, 28 Jan 2020 14:26:48 -0800 Subject: [PATCH] Fix formatting in goMain.ts file --- src/goMain.ts | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/goMain.ts b/src/goMain.ts index 29a225b87..eb6a69f8c 100644 --- a/src/goMain.ts +++ b/src/goMain.ts @@ -465,24 +465,31 @@ export function activate(ctx: vscode.ExtensionContext): void { ctx.subscriptions.push(vscode.commands.registerCommand('go.install.package', installCurrentPackage)); - ctx.subscriptions.push(vscode.commands.registerCommand('go.apply.coverprofile', () => { - if (!vscode.window.activeTextEditor || !vscode.window.activeTextEditor.document.fileName.endsWith('.go')) { - vscode.window.showErrorMessage('Cannot apply coverage profile when no Go file is open.'); - return; - } - vscode.window.showInputBox({ - prompt: 'Enter the path to the coverage profile for current package' - }).then((coverProfilePath) => { - if (!coverProfilePath) { - return; - } - if (!fileExists(coverProfilePath)) { - vscode.window.showErrorMessage(`Cannot find the file ${coverProfilePath}`); + ctx.subscriptions.push( + vscode.commands.registerCommand('go.apply.coverprofile', () => { + if (!vscode.window.activeTextEditor || !vscode.window.activeTextEditor.document.fileName.endsWith('.go')) { + vscode.window.showErrorMessage('Cannot apply coverage profile when no Go file is open.'); return; } - applyCodeCoverageToAllEditors(coverProfilePath, path.dirname(vscode.window.activeTextEditor.document.fileName)); - }); - })); + vscode.window + .showInputBox({ + prompt: 'Enter the path to the coverage profile for current package' + }) + .then((coverProfilePath) => { + if (!coverProfilePath) { + return; + } + if (!fileExists(coverProfilePath)) { + vscode.window.showErrorMessage(`Cannot find the file ${coverProfilePath}`); + return; + } + applyCodeCoverageToAllEditors( + coverProfilePath, + path.dirname(vscode.window.activeTextEditor.document.fileName) + ); + }); + }) + ); vscode.languages.setLanguageConfiguration(GO_MODE.language, { wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g