src/goMain.ts: call listeners for active text editor on init

The listeners registered using vscode.window.onDidChangeActiveTextEditor
are called when a user changes the text editor. This means that they are
not activated on the initial active text editor when a user starts vscode.

Call these listeners on the current active window during initilization
in order to make any updates related to the active text editor.

Change-Id: Ia171093cb337f9836301f8b6612e632c070c7ecd
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/258259
Trust: Suzy Mueller <suzmue@golang.org>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
diff --git a/src/goMain.ts b/src/goMain.ts
index 9889ed3..7c94d91 100644
--- a/src/goMain.ts
+++ b/src/goMain.ts
@@ -556,8 +556,13 @@
 }
 
 function addOnChangeActiveTextEditorListeners(ctx: vscode.ExtensionContext) {
-	vscode.window.onDidChangeActiveTextEditor(showHideStatus, null, ctx.subscriptions);
-	vscode.window.onDidChangeActiveTextEditor(applyCodeCoverage, null, ctx.subscriptions);
+	[showHideStatus, applyCodeCoverage].forEach((listener) => {
+		// Call the listeners on initilization for current active text editor
+		if (!!vscode.window.activeTextEditor) {
+			listener(vscode.window.activeTextEditor);
+		}
+		vscode.window.onDidChangeActiveTextEditor(listener, null, ctx.subscriptions);
+	});
 }
 
 function checkToolExists(tool: string) {