(language: TsLanguageKind, node: Node, source: &str)
| 329 | |
| 330 | #[cfg(feature = "tree-sitter-ast")] |
| 331 | fn visibility_text(language: TsLanguageKind, node: Node, source: &str) -> String { |
| 332 | if let Some(vis) = node.child_by_field_name("visibility") { |
| 333 | return node_text(vis, source); |
| 334 | } |
| 335 | match language { |
| 336 | TsLanguageKind::Go => { |
| 337 | if let Some(name) = node.child_by_field_name("name") { |
| 338 | let text = node_text(name, source); |
| 339 | if text.chars().next().map(|c| c.is_uppercase()).unwrap_or(false) { |
| 340 | "export".to_string() |
| 341 | } else { |
| 342 | "private".to_string() |
| 343 | } |
| 344 | } else { |
| 345 | String::new() |
| 346 | } |
| 347 | } |
| 348 | _ => String::new(), |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | #[cfg(feature = "tree-sitter-ast")] |
| 353 | fn parameters_text(language: TsLanguageKind, node: Node, source: &str) -> String { |
no test coverage detected