MCPcopy Create free account
hub / github.com/douglance/devsql / visibility_text

Function visibility_text

crates/devsql/src/providers/symbols.rs:331–350  ·  view source on GitHub ↗
(language: TsLanguageKind, node: Node, source: &str)

Source from the content-addressed store, hash-verified

329
330#[cfg(feature = "tree-sitter-ast")]
331fn 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")]
353fn parameters_text(language: TsLanguageKind, node: Node, source: &str) -> String {

Callers 1

Calls 1

node_textFunction · 0.70

Tested by

no test coverage detected