1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:24:41 -07:00
go/internal/lsp/testdata/links/links.go
Rebecca Stambler 7b8e75db28 internal/lsp: create links for golang/go#1234-style strings
This change treats text of the format golang/go#1234 as a link to the Go
issue tracker. This will improve the readability of TODOs that include a
link to an issue, since it doesn't have to be an actual link.

Change-Id: I27606ceb9cbb15bc6bfb1d7aa660d3f4fdd08739
Reviewed-on: https://go-review.googlesource.com/c/tools/+/212518
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2019-12-27 05:39:25 +00:00

29 lines
1005 B
Go

package links
import (
"fmt" //@link(`fmt`,"https://pkg.go.dev/fmt")
"golang.org/x/tools/internal/lsp/foo" //@link(`golang.org/x/tools/internal/lsp/foo`,`https://pkg.go.dev/golang.org/x/tools/internal/lsp/foo`)
_ "database/sql" //@link(`database/sql`, `https://pkg.go.dev/database/sql`)
errors "golang.org/x/xerrors" //@link(`golang.org/x/xerrors`, `https://pkg.go.dev/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
// TODO(golang/go#1234): Link the relevant issue. //@link("golang/go#1234", "https://github.com/golang/go/issues/1234")
// TODO(microsoft/vscode-go#12): Another issue. //@link("microsoft/vscode-go#12", "https://github.com/microsoft/vscode-go/issues/12")
}