Skip to content

Commit 2aaa7c5

Browse files
committed
Quote tree-sitter call before calling diagnostic function
1 parent e5b1a4a commit 2aaa7c5

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

crates/ark/src/lsp/diagnostics.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use std::time::Duration;
1313
use anyhow::anyhow;
1414
use anyhow::bail;
1515
use anyhow::Result;
16+
use harp::call::r_expr_quote;
1617
use harp::exec::RFunction;
1718
use harp::exec::RFunctionExt;
1819
use harp::external_ptr::ExternalPointer;
@@ -711,16 +712,10 @@ fn recurse_call_arguments_default(
711712

712713
struct TreeSitterCall<'a> {
713714
// A call of the form <fun>(list(0L, <ptr>), foo = list(1L, <ptr>))
714-
call: RObject,
715+
pub call: RObject,
715716
node_phantom: PhantomData<&'a Node<'a>>,
716717
}
717718

718-
impl<'a> From<&TreeSitterCall<'a>> for RObject {
719-
fn from(value: &TreeSitterCall<'a>) -> Self {
720-
value.call.clone()
721-
}
722-
}
723-
724719
impl<'a> TreeSitterCall<'a> {
725720
pub unsafe fn new(
726721
node: Node<'a>,
@@ -800,7 +795,7 @@ fn recurse_call_arguments_custom(
800795
let call = TreeSitterCall::new(node, function, context)?;
801796

802797
let custom_diagnostics = RFunction::from(diagnostic_function)
803-
.add(&call)
798+
.add(r_expr_quote(call.call))
804799
.add(ExternalPointer::new(context.contents))
805800
.call()?;
806801

0 commit comments

Comments
 (0)