mirror of
https://github.com/golang/go
synced 2024-11-19 10:24:43 -07:00
8308f91286
Add to "textDocument/documentLink" request handler ability to search URLs in string literals and comments. Fixes golang/go#32339 Change-Id: Ic67ad7bd94feba0bb67ab090a8903e30b2dff996 Reviewed-on: https://go-review.googlesource.com/c/tools/+/185219 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
20 lines
514 B
Go
20 lines
514 B
Go
package links
|
|
|
|
import (
|
|
"fmt" //@link(re`".*"`,"https://godoc.org/fmt")
|
|
|
|
"golang.org/x/tools/internal/lsp/foo" //@link(re`".*"`,`https://godoc.org/golang.org/x/tools/internal/lsp/foo`)
|
|
)
|
|
|
|
var (
|
|
_ fmt.Formatter
|
|
_ foo.StructFoo
|
|
)
|
|
|
|
// 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
|
|
}
|