Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Shared: Nicer panic message if node kind is missing
Still panics, just with a better message
  • Loading branch information
asgerf committed May 8, 2026
commit 638dc9380c596ed0bdbd66b78495678b68d2c40a
11 changes: 6 additions & 5 deletions shared/tree-sitter-extractor/src/extractor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,14 @@ impl<'a> Visitor<'a> {
let (id, _, child_nodes) = self.stack.pop().expect("Vistor: empty stack");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR

let loc = location_for(self, self.file_label, node);
let loc_label = location_label(self.trap_writer, loc);
let type_name = TypeName {
kind: node.kind().to_owned(),
named: node.is_named(),
};
let table = self
.schema
.get(&TypeName {
kind: node.kind().to_owned(),
named: node.is_named(),
})
.unwrap();
.get(&type_name)
.unwrap_or_else(|| panic!("missing extractor schema entry for {:?}", type_name));
let mut valid = true;
let parent_info = match self.stack.last_mut() {
Some(p) if !node.is_extra() => {
Expand Down
Loading