(&mut self, node: Node<'t>)
| 1063 | } |
| 1064 | |
| 1065 | fn extract_variable(&mut self, node: Node<'t>) { |
| 1066 | // extractVariable's generic fallback: direct identifier / |
| 1067 | // variable_declarator children only — C# nests declarators inside |
| 1068 | // variable_declaration, so this NEVER fires (`var x = F();` at top |
| 1069 | // level produces no node, no calls ref, no instantiates — preserve). |
| 1070 | let kind: &'static str = if self.is_const(node) { "constant" } else { "variable" }; |
| 1071 | let docstring = preceding_docstring(node, self.src); |
| 1072 | for child in node.named_children(&mut node.walk()) { |
| 1073 | let name = match child.kind() { |
| 1074 | "identifier" => self.text(child).to_string(), |
| 1075 | "variable_declarator" => self.extract_name(child), |
| 1076 | _ => continue, |
| 1077 | }; |
| 1078 | if name.is_empty() || name == "<anonymous>" { |
| 1079 | continue; |
| 1080 | } |
| 1081 | self.create_node( |
| 1082 | kind, |
| 1083 | &name, |
| 1084 | child, |
| 1085 | Extra { docstring: docstring.clone(), ..Extra::default() }, |
| 1086 | ); |
| 1087 | } |
| 1088 | } |
| 1089 | |
| 1090 | /// extractImport via csharpExtractor.extractImport: moduleName = first |
| 1091 | /// qualified_name child's text, else first identifier's — with the alias |
no test coverage detected