diff --git a/internal/lsp/debug/info.1.11.go b/internal/lsp/debug/info.1.11.go index b29a1570..68932d7b 100644 --- a/internal/lsp/debug/info.1.11.go +++ b/internal/lsp/debug/info.1.11.go @@ -12,5 +12,5 @@ import ( ) func printBuildInfo(w io.Writer, verbose bool, mode PrintMode) { - fmt.Fprintf(w, "no module information, gopls not built with go 1.11 or earlier\n") + fmt.Fprintf(w, "version %s, built in $GOPATH mode", Version) } diff --git a/internal/lsp/debug/info.1.12.go b/internal/lsp/debug/info.1.12.go index 70856f6c..f857f1be 100644 --- a/internal/lsp/debug/info.1.12.go +++ b/internal/lsp/debug/info.1.12.go @@ -14,7 +14,7 @@ import ( func printBuildInfo(w io.Writer, verbose bool, mode PrintMode) { if info, ok := debug.ReadBuildInfo(); ok { - fmt.Fprintf(w, "%v\n", info.Path) + fmt.Fprintf(w, "%v %v\n", info.Path, Version) printModuleInfo(w, &info.Main, mode) if verbose { for _, dep := range info.Deps { @@ -22,7 +22,7 @@ func printBuildInfo(w io.Writer, verbose bool, mode PrintMode) { } } } else { - fmt.Fprintf(w, "no module information, gopls not built in module mode\n") + fmt.Fprintf(w, "version %s, built in $GOPATH mode", Version) } } diff --git a/internal/lsp/debug/info.go b/internal/lsp/debug/info.go index 4173a91c..8f2bf7d2 100644 --- a/internal/lsp/debug/info.go +++ b/internal/lsp/debug/info.go @@ -19,6 +19,9 @@ const ( HTML ) +// Version is a manually-updated mechanism for tracking versions. +const Version = "v0.0.1-20190607+alpha" + // This writes the version and environment information to a writer. func PrintVersionInfo(w io.Writer, verbose bool, mode PrintMode) { if !verbose {