MCPcopy Index your code
hub / github.com/microsoft/typescript-go / shouldWriteComment

Method shouldWriteComment

internal/printer/printer.go:745–749  ·  view source on GitHub ↗
(comment ast.CommentRange)

Source from the content-addressed store, hash-verified

743}
744
745func (p *Printer) shouldWriteComment(comment ast.CommentRange) bool {
746 return !p.Options.OnlyPrintJSDocStyle ||
747 p.currentSourceFile != nil && isJSDocLikeText(p.currentSourceFile.Text(), comment) ||
748 p.currentSourceFile != nil && IsPinnedComment(p.currentSourceFile.Text(), comment)
749}
750
751func (p *Printer) shouldEmitIndented(node *ast.Node) bool {
752 return p.emitContext.EmitFlags(node)&EFIndented != 0

Callers 4

emitLeadingCommentsMethod · 0.95
emitTrailingCommentsMethod · 0.95
emitDetachedCommentsMethod · 0.95

Calls 3

IsPinnedCommentFunction · 0.85
isJSDocLikeTextFunction · 0.70
TextMethod · 0.65

Tested by

no test coverage detected