Skip to content

Commit cb5dc85

Browse files
findleyrstamblerre
authored andcommitted
internal/lsp/cache: add a scheme for types error code links
Links in the new LSP diagnostic CodeDescription for go/types errors are missing a scheme (unclear why they work in some clients). Fix this by delegating to the existing source.BuildLink helper (this also adds the utm_source query parameter for pkg.go.dev). Fixes golang/go#44360 Change-Id: Ife8969f32bb11840c0fdd31765b6051b3d997a93 Reviewed-on: https://go-review.googlesource.com/c/tools/+/293509 Trust: Rebecca Stambler <[email protected]> Trust: Robert Findley <[email protected]> Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
1 parent 799b682 commit cb5dc85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/lsp/cache/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func onlyDeletions(fixes []source.SuggestedFix) bool {
244244

245245
func typesCodeHref(snapshot *snapshot, code typesinternal.ErrorCode) string {
246246
target := snapshot.View().Options().LinkTarget
247-
return fmt.Sprintf("https://%s/golang.org/x/tools/internal/typesinternal#%s", target, code.String())
247+
return source.BuildLink(target, "golang.org/x/tools/internal/typesinternal", code.String())
248248
}
249249

250250
func suggestedAnalysisFixes(snapshot *snapshot, pkg *pkg, diag *analysis.Diagnostic, kinds []protocol.CodeActionKind) ([]source.SuggestedFix, error) {

0 commit comments

Comments
 (0)