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

Method visibility_of

codegraph-kernel/src/dart.rs:487–505  ·  view source on GitHub ↗

getVisibility (dart.ts:209-222) — `_` prefix = private; every constructor is public (the unwrap misses ctor signatures / the name FIELD is the class identifier).

(&self, node: Node<'t>)

Source from the content-addressed store, hash-verified

485 /// constructor is public (the unwrap misses ctor signatures / the name
486 /// FIELD is the class identifier).
487 fn visibility_of(&self, node: Node<'t>) -> u8 {
488 let name_node = if node.kind() == "method_signature" {
489 let mut cursor = node.walk();
490 let inner = node.named_children(&mut cursor).find(|c| {
491 matches!(c.kind(), "function_signature" | "getter_signature" | "setter_signature")
492 });
493 inner.and_then(|i| {
494 let mut ic = i.walk();
495 let found = i.named_children(&mut ic).find(|c| c.kind() == "identifier");
496 found
497 })
498 } else {
499 node.child_by_field_name("name")
500 };
501 match name_node {
502 Some(n) if self.text(n).starts_with('_') => 2,
503 _ => 1,
504 }
505 }
506
507 /// isAsync (dart.ts:223-233) — the `async` anon child of the SIBLING
508 /// function_body; `async*`/`sync*` are different token types → false.

Callers 4

extract_functionMethod · 0.45
extract_methodMethod · 0.45
extract_classMethod · 0.45
extract_enumMethod · 0.45

Calls 1

textMethod · 0.45

Tested by

no test coverage detected