Skip to content

Commit c4e846a

Browse files
committed
gopls/internal/analysis: improve analyzer docs
This change moves MustExtractDoc to a higher (but still internal) directory so that it can be used from gopls, and converts all of gopls' analyzers into the form it expects. It also adds the corresponding pkg.go.dev page to each Analyzer.URL, and shows this link in the generated markdown. Even if ExtractDoc is never published (see golang/go#61315) it is still convenient to use in x/tools. Fixes golang/go#63820 Change-Id: Ib3e047bef591574154d5656db69e1609aaf30a4a Reviewed-on: https://go-review.googlesource.com/c/tools/+/547877 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
1 parent 003c81d commit c4e846a

File tree

32 files changed

+580
-231
lines changed

32 files changed

+580
-231
lines changed

Diff for: go/analysis/passes/internal/analysisutil/util.go

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"go/token"
1414
"go/types"
1515
"os"
16+
17+
"golang.org/x/tools/internal/analysisinternal"
1618
)
1719

1820
// Format returns a string representation of the expression.
@@ -150,3 +152,5 @@ func IsFunctionNamed(f *types.Func, pkgPath string, names ...string) bool {
150152
}
151153
return false
152154
}
155+
156+
var MustExtractDoc = analysisinternal.MustExtractDoc

0 commit comments

Comments
 (0)