followsCodeOnItsLine (tree-sitter-helpers.ts) — whether code comes before `node` on the line it starts on.
(node: Node, src: &str)
| 264 | /// followsCodeOnItsLine (tree-sitter-helpers.ts) — whether code comes before |
| 265 | /// `node` on the line it starts on. |
| 266 | fn 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)] |
| 272 | mod tests { |
no outgoing calls
no test coverage detected