From affa17134599f1af58134ddde94b38a402dc7757 Mon Sep 17 00:00:00 2001 From: Murad Korejo Date: Tue, 20 Feb 2018 00:57:24 -0600 Subject: [PATCH] Notify user in console when gopkgs returns no packages (#1528) * Notify user in console when gopkgs returns no packages. Fixes #1471 * Revert "Notify user in console when gopkgs returns no packages. Fixes #1471" This reverts commit 801ac6fed61ab9ea5a98e9ebe7cb1e17d707d6e3. * Notify user in console when gopkgs returns no packages. Fixes #1471 --- src/goPackages.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/goPackages.ts b/src/goPackages.ts index 297c4c093..c8c302032 100644 --- a/src/goPackages.ts +++ b/src/goPackages.ts @@ -9,6 +9,7 @@ type GopkgsDone = (res: Map) => void; let allPkgsCache: Map; let allPkgsLastHit: number; let gopkgsRunning: boolean = false; +let gopkgsNotified: boolean = false; let gopkgsSubscriptions: GopkgsDone[] = []; let cacheTimeout: number = 5000; @@ -102,6 +103,10 @@ export function getAllPackages(): Promise> { return getAllPackagesNoCache().then((pkgs) => { if (!pkgs || pkgs.size === 0) { console.log('Could not find packages. Ensure `gopkgs -format {{.Name}};{{.ImportPath}}` runs successfully.'); + if (!gopkgsNotified) { + vscode.window.showInformationMessage('Could not find packages. Ensure `gopkgs -format {{.Name}};{{.ImportPath}}` runs successfully.'); + gopkgsNotified = true; + } } allPkgsLastHit = new Date().getTime(); return allPkgsCache = pkgs;