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 = treesitter.CommentBlock
CommentBlock represents an extracted comment and its source position.
func CollectTrivia ¶ added in v0.12.0
func CollectTrivia(root *treesitter.ASTNode) []*CommentBlock
CollectTrivia walks the AST and gathers all attached comment trivia.
func ExtractComments ¶
func ExtractComments(root *treesitter.ASTNode) []CommentBlock
ExtractComments returns all comment blocks attached to an AST in source order.
type DiffResult ¶
DiffResult holds actions produced from diffing comments.
func DiffComments ¶
func DiffComments(srcComments, dstComments []CommentBlock, mappings *engine.Mapping) *DiffResult
DiffComments matches and diffs comments between source and destination files using AST mapping awareness.