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

Method visibility_of

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

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

(&self, node: Node)

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected