mirror of
https://github.com/golang/go
synced 2024-11-19 03:44:40 -07:00
a764947cb5
Instead of using the entire import node as the range for the link, use only the link text in the path node itself. This looks better when using a _ or named import, as well as constraining the link to inside the quotes. Fixes golang/go#35565 Change-Id: Ie93d9df993fbd8e0106ca6c3b40e0885355be66b Reviewed-on: https://go-review.googlesource.com/c/tools/+/207137 Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com>
26 lines
744 B
Go
26 lines
744 B
Go
package links
|
|
|
|
import (
|
|
"fmt" //@link(`fmt`,"https://godoc.org/fmt")
|
|
|
|
"golang.org/x/tools/internal/lsp/foo" //@link(`golang.org/x/tools/internal/lsp/foo`,`https://godoc.org/golang.org/x/tools/internal/lsp/foo`)
|
|
|
|
_ "database/sql" //@link(`database/sql`, `https://godoc.org/database/sql`)
|
|
|
|
errors "golang.org/x/xerrors" //@link(`golang.org/x/xerrors`, `https://godoc.org/golang.org/x/xerrors`)
|
|
)
|
|
|
|
var (
|
|
_ fmt.Formatter
|
|
_ foo.StructFoo
|
|
_ errors.Formatter
|
|
)
|
|
|
|
// Foo function
|
|
func Foo() string {
|
|
/*https://example.com/comment */ //@link("https://example.com/comment","https://example.com/comment")
|
|
|
|
url := "https://example.com/string_literal" //@link("https://example.com/string_literal","https://example.com/string_literal")
|
|
return url
|
|
}
|