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

Method extract_interface

codegraph-kernel/src/tsjs/extractors.rs:187–206  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

185 // --- extractInterface / extractEnum / members -----------------------------------
186
187 pub(super) fn extract_interface(&mut self, node: Node<'t>) {
188 let name = self.extract_name(node);
189 let extra = Extra {
190 docstring: crate::docstring::preceding_docstring(node, self.src),
191 is_exported: Some(self.is_exported(node)),
192 ..Extra::default()
193 };
194 let Some(row) = self.create_node("interface", &name, node, extra) else {
195 return;
196 };
197 self.extract_inheritance(node, row);
198 self.stack.push(Scope { row, kind: "interface", name });
199 let body = body_of(node).unwrap_or(node);
200 for i in 0..body.named_child_count() {
201 if let Some(c) = body.named_child(i) {
202 self.visit_node(c);
203 }
204 }
205 self.stack.pop();
206 }
207
208 pub(super) fn extract_enum(&mut self, node: Node<'t>) {
209 let Some(body) = body_of(node) else { return };

Callers 2

visit_nodeMethod · 0.45

Calls 7

preceding_docstringFunction · 0.85
body_ofFunction · 0.85
extract_nameMethod · 0.45
is_exportedMethod · 0.45
create_nodeMethod · 0.45
extract_inheritanceMethod · 0.45
visit_nodeMethod · 0.45

Tested by

no test coverage detected