New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: support detecting URLs in comments and string literals for documentLink #32339
Comments
If development team find this valuable I can work on it |
@litleleprikon: Absolutely, feel free to send us a contribution! |
@stamblerre: Probably label "Documentation" should be removed from this issue. Also For example: // Foo check example.com/foo @link(re`".*"`,"example.com/foo") Fails with following error:
Can you suggest how to make |
Unfortunately gopherbot adds the "Documentation" label to any issue containing the word "document". The regular expression matcher in your example case is looking for double quotes (as in the import lines in the other test cases). You may want to try changing that to |
Hi @stamblerre! Thank you for your advice but unfortunately it seems that I am doing something wrong. I stuck with adopting tests for the new functionality of searching links in comments. As I have test file with following content 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 check https://example.com/comment //@link("https://example.com/comment", "http://example.com/comment")
func Foo() string {
url := "https://example.com/string_literal" //@link(re`".*"`,`https://example.com/string_literal`)
return url
} I have the tests failing with following errors(pasting log only for GOPATH, for modules errors are similar)
Can you please point me where I can check how |
Hi @stamblerre @ianthehat ! Can you please advice me how can I fix the issues I described in previous comment? |
|
Thank you @stamblerre your comment is very helpful for me! |
Change https://golang.org/cl/185219 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Opened .go file in VSCode
What did you expect to see?
Expect to see URLs detected in comments, docstrings and string literals
What did you see instead?
URLs only detected in imports
The text was updated successfully, but these errors were encountered: