Documentation
¶
Overview ¶
Package comments extracts and diffs comments across source files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentBlock ¶
type CommentBlock struct {
Type string
Text string
StartByte uint32
EndByte uint32
StartRow int // 0-indexed
StartCol int
EndRow int // 0-indexed
EndCol int
ScopeKey string
ParentType string
ParentStart uint32
ParentEnd uint32
ParentRow int
ParentEndRow int
}
CommentBlock represents an extracted comment and its source position.
func ExtractComments ¶
func ExtractComments(root *gotreesitter.Node, src []byte, lang *gotreesitter.Language, r *rules.Rules) []CommentBlock
ExtractComments walks the AST and returns all comment blocks.
type DiffResult ¶
DiffResult holds actions produced from diffing comments.
func DiffComments ¶
func DiffComments(srcComments, dstComments []CommentBlock) *DiffResult
DiffComments matches and diffs comments between source and destination files.