Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump tree-sitter-r 4 - Syntax vs Semantic Diagnostics (#523)
* Fix invalid R code in `indent.R` causing issues * Embrace `{ }` illegal if/else statements in `indent.R` * Bump tree-sitter-r * Remove `UnmatchedDelimiter` node * First pass at diagnostics update * Bump tree-sitter-r again To get a combination of fixes that work nicely together * Split syntax and semantic diagnostics * Tweak some message formatting * Allow semantic diagnostics on subtrees with no errors * Add customized syntax error for unmatched closing token * Don't need a mutable context * More on not needing a mutable context * Add syntax error range truncation to avoid overwhelming the user Can often occur when you have unmatched string delimiters, which there isn't much else we can do about * Ha, use a package that will always be installed Otherwise we get a diagnostic about dplyr not being installed * Simplify `node_find_string()` a little * Remove `build_` prefix * Tweak message * Bump to latest tree-sitter-r, includes tree-sitter 0.23.0 * Adapt to new tree-sitter `LANGUAGE` conventions * Update to `LANGUAGE` in tests too * Add test for previous `(0, 0)` `program` node issue * Fix more invalid R syntax in `indent.R` Otherwise example 34 now indents out one level * Custom panic message in `statement_range_test()` * Bump tree-sitter-r one more time for r-lib/tree-sitter-r#145 * Fix tests related to `(0, 0)` `program` node issue * Adapt diagnostics tests to tree-sitter-r grammar changes * Bump tree-sitter-r once again * Rename syntactic -> syntax * Remove TODOs in `indent.R` * Token -> Delimiter * Switch to snapshot testing for diagnostics * Use simpler recursion scheme for only reporting terminal `ERROR`s
- Loading branch information