MCPcopy Index your code
hub / github.com/coder/guts / syntheticComments

Function syntheticComments

comments.go:151–166  ·  view source on GitHub ↗
(leading bool, grp *ast.CommentGroup)

Source from the content-addressed store, hash-verified

149}
150
151func syntheticComments(leading bool, grp *ast.CommentGroup) []bindings.SyntheticComment {
152 cmts := []bindings.SyntheticComment{}
153 if grp == nil {
154 return cmts
155 }
156 for _, c := range grp.List {
157 normalizedText := normalizeCommentText(c.Text)
158 cmts = append(cmts, bindings.SyntheticComment{
159 Leading: leading,
160 SingleLine: !strings.Contains(normalizedText, "\n"),
161 Text: normalizedText,
162 TrailingNewLine: true,
163 })
164 }
165 return cmts
166}
167
168func normalizeCommentText(text string) string {
169 // TODO: Is there a better way to get just the text of the comment?

Callers 2

CommentForObjectFunction · 0.85
commentForFieldListFunction · 0.85

Calls 1

normalizeCommentTextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…