Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Fix formatting in goMain.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Jan 28, 2020
1 parent 335412a commit 8f00179
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions src/goMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8f00179

Please sign in to comment.