Conversation
| spec.add_dependency("ast") | ||
| spec.add_dependency("parser", ">= 3.0.0") | ||
| spec.add_dependency("sorbet-runtime", ">= 0.5.9204") | ||
| spec.add_dependency("unparser", ">= 0.5.6") |
There was a problem hiding this comment.
Since YARP releases may contain breaking changes while still under develpment, should be put an upper limit on this?
There was a problem hiding this comment.
This may help us find and fix these bugs faster
| begin_line: yarp_location.start_line, | ||
| end_line: yarp_location.end_line, | ||
| begin_column: yarp_location.start_column, | ||
| end_column: yarp_location.end_column + 1, # TODO: Why is this off by one? |
There was a problem hiding this comment.
Known issue, I'm verifying Kevin's suggestion for a fix here.
There was a problem hiding this comment.
Great! I'm going to merge and update this once fixed 👍
|
I bumped YARP to 0.0.10 and tested the changes on core 👍 |
andyw8
left a comment
There was a problem hiding this comment.
I haven't read through every line of the lib/rbi/parser.rb changes, but I'm trusting the tests are sufficiently covering it.
| assert_equal("unexpected token $end", e.message) | ||
| assert_equal("test_parse_real_file_with_error.rbi:2:0-2:0", e.location.to_s) | ||
| assert_equal("Expected to be able to parse an expression. Expected `end` to close `class` statement.", e.message) | ||
| # assert_equal("test_parse_real_file_with_error.rbi:1:10-1:10", e.location.to_s) |
There was a problem hiding this comment.
Yeah good idea. I commented it until we figure the weird locations returned by YARP but I can keep the wrong location in the assert instead
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
I've been experimenting with different parser backends to benchmark RBI parsing.
Here are the time required to parse all the 11801 RBI files in on big project:
This PR migrates RBI parsing to YARP and removes the dependecy to Whitequark and
unparser.Running
tapioca check-shimsbefore (usingparsergem):Running
tapioca check-shimsafter (using YARP):