MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / module_scope

Function module_scope

atomic-semantic/src/source.rs:250–265  ·  view source on GitHub ↗
(mut node: Node<'_>, source: &str)

Source from the content-addressed store, hash-verified

248}
249
250fn module_scope(mut node: Node<'_>, source: &str) -> Vec<String> {
251 let mut parts = Vec::new();
252 while let Some(parent) = node.parent() {
253 if matches!(
254 parent.kind(),
255 "mod_item" | "namespace_definition" | "internal_module"
256 ) {
257 if let Some(name) = parent.child_by_field_name("name") {
258 parts.push(text(name, source).into());
259 }
260 }
261 node = parent;
262 }
263 parts.reverse();
264 parts
265}
266
267fn span(node: Node<'_>, path: &str) -> SourceSpan {
268 SourceSpan {

Callers 1

from_treeMethod · 0.85

Calls 4

parentMethod · 0.80
textFunction · 0.70
pushMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected