var errNoCommentReference … // DocCommentToMarkdown converts the text of a [doc comment] to Markdown. // // TODO(adonovan): provide a package (or file imports) as context for // proper rendering of doc links; see [newDocCommentParser] and golang/go#61677. // // [doc comment]: https://go.dev/doc/comment func DocCommentToMarkdown(text string, options *settings.Options) string { … } // docLinkDefinition finds the definition of the doc link in comments at pos. // If there is no reference at pos, returns errNoCommentReference. func docLinkDefinition(ctx context.Context, snapshot *cache.Snapshot, pkg *cache.Package, pgf *parsego.File, pos token.Pos) ([]protocol.Location, error) { … } // parseDocLink parses a doc link in a comment such as [fmt.Println] // and returns the symbol at pos, along with the link's start position. func parseDocLink(pkg *cache.Package, pgf *parsego.File, pos token.Pos) (types.Object, protocol.Range, error) { … } // lookupDocLinkSymbol returns the symbol denoted by a doc link such // as "fmt.Println" or "bytes.Buffer.Write" in the specified file. func lookupDocLinkSymbol(pkg *cache.Package, pgf *parsego.File, name string) types.Object { … } // newDocCommentParser returns a function that parses [doc comments], // with context for Doc Links supplied by the specified package. // // Imported symbols are rendered using the import mapping for the file // that encloses fileNode. // // The resulting function is not concurrency safe. // // See issue #61677 for how this might be generalized to support // correct contextual parsing of doc comments in Hover too. // // [doc comment]: https://go.dev/doc/comment func newDocCommentParser(pkg *cache.Package) func(fileNode ast.Node, text string) *comment.Doc { … }