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

Method visibility_of

codegraph-kernel/src/tsjs/mod.rs:776–792  ·  view source on GitHub ↗

typescriptExtractor.getVisibility (TS only — JS has no hook).

(&self, node: Node)

Source from the content-addressed store, hash-verified

774
775 /// typescriptExtractor.getVisibility (TS only — JS has no hook).
776 fn visibility_of(&self, node: Node) -> Option<u8> {
777 if !self.variant.is_ts() {
778 return None;
779 }
780 for i in 0..node.child_count() {
781 let child = node.child(i)?;
782 if child.kind() == "accessibility_modifier" {
783 return match self.text(child) {
784 "public" => Some(1),
785 "private" => Some(2),
786 "protected" => Some(3),
787 _ => None,
788 };
789 }
790 }
791 None
792 }
793
794 /// isExported: walk the parent chain for an export_statement.
795 fn is_exported(&self, node: Node) -> bool {

Callers 5

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

Calls 2

is_tsMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected