Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow newlines directly after function and \ #145

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

DavisVaughan
Copy link
Member

Fixes an issue accidentally introduced by #134 where I guess we were consuming these newlines automatically previously (which I think was actually a mistake on our part, we should indeed have had an explicit repeat($._newline) here)

@DavisVaughan DavisVaughan merged commit f0679b9 into r-lib:main Sep 17, 2024
11 checks passed
@DavisVaughan DavisVaughan deleted the fix/newline-after-function branch September 17, 2024 15:22
DavisVaughan added a commit to posit-dev/ark that referenced this pull request Sep 17, 2024
DavisVaughan added a commit to posit-dev/ark that referenced this pull request Sep 23, 2024
DavisVaughan added a commit to posit-dev/ark that referenced this pull request Sep 23, 2024
* 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
lionel- pushed a commit to posit-dev/air that referenced this pull request Nov 12, 2024
* 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
lionel- pushed a commit to posit-dev/air that referenced this pull request Nov 26, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant