diff --git a/gopls/internal/golang/assembly.go b/gopls/internal/golang/assembly.go index cbb951288..ca9f61cef 100644 --- a/gopls/internal/golang/assembly.go +++ b/gopls/internal/golang/assembly.go @@ -30,7 +30,7 @@ import ( // TODO(adonovan): // - display a "Compiling..." message as a cold build can be slow. // - cross-link jumps and block labels, like github.com/aclements/objbrowse. -func AssemblyHTML(ctx context.Context, snapshot *cache.Snapshot, pkg *cache.Package, symbol string, posURL PosURLFunc) ([]byte, error) { +func AssemblyHTML(ctx context.Context, snapshot *cache.Snapshot, pkg *cache.Package, symbol string, web Web) ([]byte, error) { // Compile the package with -S, and capture its stderr stream. inv, cleanupInvocation, err := snapshot.GoCommandInvocation(false, &gocommand.Invocation{ Verb: "build", @@ -145,7 +145,7 @@ function httpGET(url) { if file, linenum, ok := cutLast(parts[2], ":"); ok && !strings.HasPrefix(file, "<") { if linenum, err := strconv.Atoi(linenum); err == nil { text := fmt.Sprintf("L%04d", linenum) - link = sourceLink(text, posURL(file, linenum, 1)) + link = sourceLink(text, web.OpenURL(file, linenum, 1)) } } fmt.Fprintf(&buf, "%s\t%s\t%s", escape(parts[1]), link, escape(parts[3])) diff --git a/gopls/internal/golang/freesymbols.go b/gopls/internal/golang/freesymbols.go index 4333a8505..0bf0d9c2e 100644 --- a/gopls/internal/golang/freesymbols.go +++ b/gopls/internal/golang/freesymbols.go @@ -27,7 +27,7 @@ import ( // FreeSymbolsHTML returns an HTML document containing the report of // free symbols referenced by the selection. -func FreeSymbolsHTML(pkg *cache.Package, pgf *parsego.File, start, end token.Pos, posURL PosURLFunc, pkgURL PkgURLFunc) []byte { +func FreeSymbolsHTML(viewID string, pkg *cache.Package, pgf *parsego.File, start, end token.Pos, web Web) []byte { // Compute free references. refs := freeRefs(pkg.Types(), pkg.TypesInfo(), pgf.File, start, end) @@ -210,7 +210,7 @@ function httpGET(url) { fmt.Fprintf(&buf, "