Skip to content

Commit

Permalink
Add some logging to DocumentContext::new() (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan authored Apr 9, 2024
1 parent 63b211e commit b1c738b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/ark/src/lsp/document_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ impl<'a> DocumentContext<'a> {
let ast = &document.ast;

// find node at point
let node = ast.root_node().find_closest_node_to_point(point).unwrap();
let Some(node) = ast.root_node().find_closest_node_to_point(point) else {
// TODO: We really want to track this down and figure out what's happening
// and fix it in `find_closest_node_to_point()`.
let contents = document.contents.to_string();
panic!("Failed to find closest node to point: {point} with contents '{contents}'");
};

// build document context
DocumentContext {
Expand Down

0 comments on commit b1c738b

Please sign in to comment.