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

Method visibility_of

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

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

(&self, node: Node)

Source from the content-addressed store, hash-verified

1062
1063 /// typescriptExtractor.getVisibility (TS only — JS has no hook).
1064 fn visibility_of(&self, node: Node) -> Option<u8> {
1065 if !self.variant.is_ts() {
1066 return None;
1067 }
1068 for i in 0..node.child_count() {
1069 let child = node.child(i)?;
1070 if child.kind() == "accessibility_modifier" {
1071 return match self.text(child) {
1072 "public" => Some(1),
1073 "private" => Some(2),
1074 "protected" => Some(3),
1075 _ => None,
1076 };
1077 }
1078 }
1079 None
1080 }
1081
1082 /// isExported: walk the parent chain for an export_statement, then ask
1083 /// whether a `declare module '…'` / `declare global` body exports it.

Callers 6

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