MCPcopy Create free account
hub / github.com/microsoft/typescript-go / writeComments

Method writeComments

internal/ls/hover.go:1013–1024  ·  view source on GitHub ↗
(b *strings.Builder, c *checker.Checker, comments []*ast.Node, isMarkdown bool)

Source from the content-addressed store, hash-verified

1011}
1012
1013func (l *LanguageService) writeComments(b *strings.Builder, c *checker.Checker, comments []*ast.Node, isMarkdown bool) {
1014 for _, comment := range comments {
1015 switch comment.Kind {
1016 case ast.KindJSDocText:
1017 b.WriteString(comment.Text())
1018 case ast.KindJSDocLink, ast.KindJSDocLinkPlain:
1019 l.writeJSDocLink(b, c, comment, false /*quote*/, isMarkdown)
1020 case ast.KindJSDocLinkCode:
1021 l.writeJSDocLink(b, c, comment, true /*quote*/, isMarkdown)
1022 }
1023 }
1024}
1025
1026func (l *LanguageService) writeJSDocLink(b *strings.Builder, c *checker.Checker, link *ast.Node, quote bool, isMarkdown bool) {
1027 name := link.Name()

Callers 1

Calls 2

writeJSDocLinkMethod · 0.95
TextMethod · 0.65

Tested by

no test coverage detected