MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / follows_code_on_its_line

Function follows_code_on_its_line

codegraph-kernel/src/docstring.rs:266–269  ·  view source on GitHub ↗

followsCodeOnItsLine (tree-sitter-helpers.ts) — whether code comes before `node` on the line it starts on.

(node: Node, src: &str)

Source from the content-addressed store, hash-verified

264/// followsCodeOnItsLine (tree-sitter-helpers.ts) — whether code comes before
265/// `node` on the line it starts on.
266fn follows_code_on_its_line(node: Node, src: &str) -> bool {
267 let before = src[..node.start_byte()].trim_end_matches([' ', '\t']);
268 !before.is_empty() && !before.ends_with(['\n', '\r'])
269}
270
271#[cfg(test)]
272mod tests {

Callers 1

preceding_docstring_withFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected