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

Method visibility_of

codegraph-kernel/src/kotlin.rs:546–566  ·  view source on GitHub ↗

getVisibility: modifiers text includes public/private/protected/ internal in that order; default PUBLIC. Text-includes semantics — annotation text inside modifiers can flip it (bug-for-bug).

(&self, node: Node)

Source from the content-addressed store, hash-verified

544 /// internal in that order; default PUBLIC. Text-includes semantics —
545 /// annotation text inside modifiers can flip it (bug-for-bug).
546 fn visibility_of(&self, node: Node) -> u8 {
547 for i in 0..node.child_count() {
548 let Some(child) = node.child(i) else { continue };
549 if child.kind() == "modifiers" {
550 let text = self.text(child);
551 if text.contains("public") {
552 return 1;
553 }
554 if text.contains("private") {
555 return 2;
556 }
557 if text.contains("protected") {
558 return 3;
559 }
560 if text.contains("internal") {
561 return 4;
562 }
563 }
564 }
565 1 // Kotlin defaults to public
566 }
567
568 /// isAsync: modifiers text includes 'suspend' (text-includes false
569 /// positive on `@suspendMarker` annotations — preserve).

Callers 5

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

Calls 1

textMethod · 0.65

Tested by

no test coverage detected