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:274–277  ·  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

272/// followsCodeOnItsLine (tree-sitter-helpers.ts) — whether code comes before
273/// `node` on the line it starts on.
274fn follows_code_on_its_line(node: Node, src: &str) -> bool {
275 let before = src[..node.start_byte()].trim_end_matches([' ', '\t']);
276 !before.is_empty() && !before.ends_with(['\n', '\r'])
277}
278
279#[cfg(test)]
280mod tests {

Callers 1

preceding_docstring_withFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected