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

Method visibility_of

codegraph-kernel/src/kotlin.rs:547–567  ·  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

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