posit-dev / positron

Positron, a next-generation data science IDE
Other
1.18k stars 32 forks source link

Make R diagnostics less aggressive #2943

Open jennybc opened 2 months ago

jennybc commented 2 months ago

Summarizing a slack discussion.

This screenshot is me in the middle of a "copy/paste/edit" maneuver where I'm creating a new test from an existing one. It's easy for the code to travel through an invalid state while you're finishing what you started. I find the diagnostics that appear so overwhelming that it actually makes it harder for me to get back to the happy state of syntactically valid code.

Screenshot 2024-04-30 at 7 21 36 AM

Three possible angles on this:

DavisVaughan commented 2 months ago

We'd really like to make tree-sitter-r play as nicely as possible with tree-sitter's error recovery, but to do that we need an example of the code that caused the squiggles in the image above. If you can recreate that state or a similar one and provide a reprex for it, we can see if it is the same problem as the ones mentioned in https://github.com/r-lib/tree-sitter-r/issues/90, which would provide even more motivation for putting the work in to fix that

jennybc commented 2 months ago

Yes I definitely think it was an unmatched delimiter. In the test file in the screenshot, if I delete any parenthesis or brace, the entire file immediately lights up with the diagnostic. So yes the same problem as https://github.com/r-lib/tree-sitter-r/issues/90.

lionel- commented 1 month ago

Another case where the whole editor gets linted: insert this somewhere in the file: (a &&)