From 201c0bf65b9cc05d19a9b3dcfbca08b6f9c64794 Mon Sep 17 00:00:00 2001 From: SpontanCombust <61706594+SpontanCombust@users.noreply.github.com> Date: Thu, 25 Apr 2024 03:26:13 +0200 Subject: [PATCH] refactor: change function call arg value from position to range --- crates/core/src/ast/expressions.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/core/src/ast/expressions.rs b/crates/core/src/ast/expressions.rs index 530dd105..2b80259e 100644 --- a/crates/core/src/ast/expressions.rs +++ b/crates/core/src/ast/expressions.rs @@ -285,11 +285,7 @@ impl<'script> FunctionCallArgumentsNode<'script> { previous_was_comma = false; } else { if previous_was_comma { - let range = n.range(); - args.push(FunctionCallArgument::Omitted(lsp_types::Position { - line: range.start.line, - character: range.start.character - 1 // -1 because the arg would be before the comma - })); + args.push(FunctionCallArgument::Omitted(n.range())); } previous_was_comma = true; } @@ -332,7 +328,7 @@ impl SyntaxNodeTraversal for FunctionCallArgumentsNode<'_> { #[derive(Clone)] pub enum FunctionCallArgument<'script> { Some(ExpressionNode<'script>), - Omitted(lsp_types::Position) //TODO range instead of Position + Omitted(lsp_types::Range) } impl Debug for FunctionCallArgument<'_> {