Tags: mutecipher/sorbet
Tags
add an end-to-end test for RBI generation + typechecking with those R… …BIs (sorbet#5285)
Recover from unclosed block args pipe (sorbet#5284) * Error recovery for case * Add gaps * Remove dead Builder.cc code * Track lineStart in bison locations * wip: Checkpoint * Use indentation when attempting to recover This lets us handle everything in the new 3 and 4 tests, at the cost of not being able to handle some things in 2 anymore. * Add assertions to new tests * Fix failing circular argument reference test This test is telling me that DIAGCHECK is orthogonal to good parses, and we should replace every usage of it we see with a call to `error_node` + let the parse continue. * Fix failing forward_args_invalid tests This just makes the error message identical to what it was.
Error recovery for case (sorbet#5277) * Error recovery for case * Add gaps * Remove dead Builder.cc code
More indentation-aware changes (sorbet#5275) * no-op: Simplify some logic I noticed that there's an overload of this which lets us use less boilerplate. * begin, unless, while, until, lambda do, block do, normal do * Slightly change this error message for if * Do the same thing for while, unless, until * Add test * Add another test with more block forms * Add a test with begin + rescue * Fix semantic conflict in missing_operator test
Upgrade Bazel to 5.0.0 (sorbet#5279) * Upgrade Bazel to 5.0.0 * Format build files
Indentation-aware parser error recovery (sorbet#5000) * no-op: Factor out makeDriver helper We're going to be making multiple drivers. It'll help to have a helper function for that. * Thread line start offset through parser This will let us compute the indentation of the line a token is on. We might want to populate the indentation of the token on construction, but for simplicitly right now I'm just going to ask for the indentation at the points where I ask for it. This might not be the most efficent path forwards, but it might be the sort of thing that we can just elide/not populate except once we know there's a syntax error, and we can afford to be a little slower than usual. Also, this bloats the size of a `token` by one `size_t`. * Add compare_indent_level helper * Thread `indendationAware` boolean through driver * Add rewind_if_dedented helper This uses the new indentationAware boolean and the compare_indent_level helper to make a decision about whether to reduce normally or whether to emit an error that the `end` keyword indentation was mismatched, and rewind the lexer to re-lex the `end` keyword if so. * Existing test improves * Rename a test * Show behavior before this PR * Show behavior after this PR * Also update newline_s after line comment * Add new completion tests * Remove TODO * Add another test * whoops, recorded this test wrong * Turns out there's an overload * Use addErrorNote to explain the message a bit * Report error recovery errors as separate code ... so that we can write a section for them in the error docs. * Prefix with `Hint:` * Delete ErrorToError, just use functions This change looks better ignoring whitespace. * Always report original errors This way we can make the messaging around the hint errors more clear ("they're just hints, might be wrong") * Add one more line of context to the error * Fix wording in error-reference * whoops double loc * Suggested refactoring * reorder if/else * Remove errorToError * Fix comment * Add cli test showing error lines * Change error message and location * Add a Timer for the withIndentationAware phase Here's hoping that this always takes so little time that it never shows up in the log.
Improve missing arg to operator error handling (sorbet#5280) * Add test showing master behavior * Improve one test case, worsen the other * Remove test (not useful anymore) * Completion test passes now * Some other tests improve
Add proper type for `Proc.new` (sorbet#5276) * Add proper type for Proc.new * Add a test
Add error recovery cases for binop and unop expressions (sorbet#5272) * Add test case * Add grammar cases for unop/binop with error nodes * Fix logicalAnd and logicalOr rules * Replace parse-tree with desugar-tree * Add some valid cases to the test, for easy comparison to the parses of the invalid ones * Don't duplicate the DIAGCHECK in the tMATCH rule * Add a test that documents what completion currently does, and what we'd like it to do * Tweak test case for tilde op to actually parse as the operator, not a literal * Hopefully fix the .rec file for incremental-lsp-changes
Raise errors when keyword args are given to T combinators (sorbet#5260) * Add a test * Eagerly report unexpected keyword args with T combinators * Better autocorrect * Add a cli test for the autocorrect
PreviousNext