Skip to content

Commit dbb0867

Browse files
committed
The re-improvement in the snapshot test error messages is due to r-lib/tree-sitter-r#179, where the inlining of `_string_or_identifier` really seems to improve tree-sitter's error recovery. What a mess that this matters so much!
1 parent d198ffb commit dbb0867

6 files changed

+9
-9
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
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 = "bc8b4771bc4ac6c012f79877dbf44ba7cf87634f" }
50+
tree-sitter-r = { git = "https://github.com/r-lib/tree-sitter-r", rev = "95aff097aa927a66bb357f715b58cde821be8867" }
5151
uuid = "1.3.0"
5252
url = "2.4.1"
5353
walkdir = "2"

crates/ark/src/lsp/diagnostics_syntax.rs

Lines changed: 3 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, 10));
338+
assert_eq!(diagnostic.range.end, Position::new(0, 6));
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, 8));
345+
assert_eq!(diagnostic.range.end, Position::new(0, 4));
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, 9));
352+
assert_eq!(diagnostic.range.end, Position::new(0, 5));
353353
insta::assert_snapshot!(diagnostic.message);
354354
}
355355

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-
Syntax error
5+
Unmatched opening delimiter. Missing a closing ']'.

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-
Syntax error
5+
Unmatched opening delimiter. Missing a closing ']]'.

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-
Syntax error
5+
Unmatched opening delimiter. Missing a closing ')'.

0 commit comments

Comments
 (0)