1
0
mirror of https://github.com/golang/go synced 2024-11-19 00:44:40 -07:00
go/internal/lsp/testdata/links/links.go
litleleprikon 8308f91286 internal/lsp: add links search in comments and string literals
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>
2019-07-12 18:53:41 +00:00

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
}