Skip to content

Commit 714ebe5

Browse files
committed
1 parent 1132450 commit 714ebe5

6 files changed

+23
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ark/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ stdext = { path = "../stdext" }
4747
tokio = { version = "1.26.0", features = ["full"] }
4848
tower-lsp = "0.19.0"
4949
tree-sitter = "0.23.0"
50-
tree-sitter-r = { git = "https://github.com/r-lib/tree-sitter-r", rev = "cbfa8fbce269d6e1c46bddc5c4fcc4cdee6c3e9f" }
50+
tree-sitter-r = { git = "https://github.com/r-lib/tree-sitter-r", rev = "7c316f8d0c08313c7bb5372bdd99016e479fdbb4" }
5151
uuid = "1.3.0"
5252
url = "2.4.1"
5353
walkdir = "2"

crates/ark/src/lsp/diagnostics_syntax.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,21 +335,21 @@ mod tests {
335335
assert_eq!(diagnostics.len(), 1);
336336
let diagnostic = diagnostics.get(0).unwrap();
337337
assert_eq!(diagnostic.range.start, Position::new(0, 5));
338-
assert_eq!(diagnostic.range.end, Position::new(0, 6));
338+
assert_eq!(diagnostic.range.end, Position::new(0, 10));
339339
insta::assert_snapshot!(diagnostic.message);
340340

341341
let diagnostics = text_diagnostics("foo[a, b");
342342
assert_eq!(diagnostics.len(), 1);
343343
let diagnostic = diagnostics.get(0).unwrap();
344344
assert_eq!(diagnostic.range.start, Position::new(0, 3));
345-
assert_eq!(diagnostic.range.end, Position::new(0, 4));
345+
assert_eq!(diagnostic.range.end, Position::new(0, 8));
346346
insta::assert_snapshot!(diagnostic.message);
347347

348348
let diagnostics = text_diagnostics("foo[[a, b");
349349
assert_eq!(diagnostics.len(), 1);
350350
let diagnostic = diagnostics.get(0).unwrap();
351351
assert_eq!(diagnostic.range.start, Position::new(0, 3));
352-
assert_eq!(diagnostic.range.end, Position::new(0, 5));
352+
assert_eq!(diagnostic.range.end, Position::new(0, 9));
353353
insta::assert_snapshot!(diagnostic.message);
354354
}
355355

@@ -518,4 +518,19 @@ function(x {
518518
assert_eq!(diagnostic.range.start, Position::new(0, 9));
519519
assert_eq!(diagnostic.range.end, Position::new(0, 10));
520520
}
521+
522+
#[test]
523+
fn test_no_syntax_diagnostic_on_dots_and_dot_dot_i() {
524+
let text = "x$...";
525+
let diagnostics = text_diagnostics(text);
526+
assert!(diagnostics.is_empty());
527+
528+
let text = "x$..1";
529+
let diagnostics = text_diagnostics(text);
530+
assert!(diagnostics.is_empty());
531+
532+
let text = "x::...";
533+
let diagnostics = text_diagnostics(text);
534+
assert!(diagnostics.is_empty());
535+
}
521536
}

crates/ark/src/lsp/snapshots/ark__lsp__diagnostics_syntax__tests__unmatched_call_delimiter-2.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: crates/ark/src/lsp/diagnostics_syntax.rs
33
expression: diagnostic.message
44
---
5-
Unmatched opening delimiter. Missing a closing ']'.
5+
Syntax error

crates/ark/src/lsp/snapshots/ark__lsp__diagnostics_syntax__tests__unmatched_call_delimiter-3.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: crates/ark/src/lsp/diagnostics_syntax.rs
33
expression: diagnostic.message
44
---
5-
Unmatched opening delimiter. Missing a closing ']]'.
5+
Syntax error

crates/ark/src/lsp/snapshots/ark__lsp__diagnostics_syntax__tests__unmatched_call_delimiter.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: crates/ark/src/lsp/diagnostics_syntax.rs
33
expression: diagnostic.message
44
---
5-
Unmatched opening delimiter. Missing a closing ')'.
5+
Syntax error

0 commit comments

Comments
 (0)