luaur_analysis/methods/
usage_finder_visit_fragment_autocomplete.rs1use crate::records::usage_finder::UsageFinder;
2use luaur_ast::records::ast_expr_constant_string::AstExprConstantString;
3
4impl UsageFinder {
5 pub fn visit_ast_expr_constant_string(&mut self, expr: *mut AstExprConstantString) -> bool {
6 let expr_ref = unsafe { &*expr };
7 let value_slice = unsafe {
8 core::slice::from_raw_parts(
9 expr_ref.value.data as *const u8,
10 expr_ref.value.size as usize,
11 )
12 };
13 let name = core::str::from_utf8(value_slice).unwrap_or("");
14 self.referenced_bindings.push(name.into());
15 true
16 }
17}