Skip to content

Commit

Permalink
refactor: change function call arg value from position to range
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust committed Apr 25, 2024
1 parent ba90b13 commit 201c0bf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions crates/core/src/ast/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<'_> {
Expand Down

0 comments on commit 201c0bf

Please sign in to comment.