luaur_analysis/methods/
autocomplete_node_finder_visit_ast_query.rs1use crate::records::autocomplete_node_finder::AutocompleteNodeFinder;
2use luaur_ast::records::ast_expr::AstExpr;
3use luaur_ast::records::location::Location;
4use luaur_ast::records::position::Position;
5
6impl AutocompleteNodeFinder {
7 pub fn visit_ast_expr(&mut self, expr: *mut AstExpr) -> bool {
8 let expr_ref = unsafe { &*expr };
9 let location = expr_ref.base.location;
10 if location.begin <= self.pos && self.pos <= location.end && location.begin != location.end
11 {
12 self.ancestry
13 .push(expr as *mut AstExpr as *mut luaur_ast::records::ast_node::AstNode);
14 true
15 } else {
16 false
17 }
18 }
19}