Skip to main content

luaur_analysis/methods/
autocomplete_node_finder_visit_ast_query_alt_d.rs

1use crate::records::autocomplete_node_finder::AutocompleteNodeFinder;
2use luaur_ast::records::ast_node::AstNode;
3use luaur_ast::records::ast_type_error::AstTypeError;
4
5impl AutocompleteNodeFinder {
6    pub fn visit_ast_type_error(&mut self, type_: *mut AstTypeError) -> bool {
7        // For a missing type, match the whole range including the start position
8        let type_ref = unsafe { &*type_ };
9        if type_ref.is_missing && type_ref.base.base.location.containsClosed(self.pos) {
10            self.ancestry.push(type_ as *mut AstNode);
11            return true;
12        }
13        false
14    }
15}