Extract the module name from an @import `builtin_function` node. Looks for the string child inside the arguments: `@import("std")` -> `"std"`.
(state: &ExtractionState, builtin_node: TsNode<'_>)
| 307 | /// |
| 308 | /// Looks for the string child inside the arguments: `@import("std")` -> `"std"`. |
| 309 | fn extract_import_module(state: &ExtractionState, builtin_node: TsNode<'_>) -> Option<String> { |
| 310 | // arguments -> string -> string_content |
| 311 | let args = find_direct_child_by_kind(builtin_node, "arguments")?; |
| 312 | let string_node = find_direct_child_by_kind(args, "string")?; |
| 313 | let content = find_direct_child_by_kind(string_node, "string_content")?; |
| 314 | let text = state.node_text(content); |
| 315 | if text.is_empty() { |
| 316 | None |
| 317 | } else { |
| 318 | Some(text) |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | // ---------------------------------- |
| 323 | // Struct |
nothing calls this directly
no test coverage detected