-
-
Notifications
You must be signed in to change notification settings - Fork 72
Parser: add public API method extract_ruby_with_semicolons_to_herb #675
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
base: main
Are you sure you want to change the base?
Parser: add public API method extract_ruby_with_semicolons_to_herb #675
Conversation
…r module Co-authored-by: Felipe Felix <[email protected]> Co-authored-by: Everton <[email protected]>
…icolons_to_Herb_module
marcoroth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Lusqinha, thanks for opening this pull request!
I'm happy to expose this functionality, but I'm really curious what the use case for this pull request is, do you have a specific need for this? 😅
Regarding the design, I'm wondering if we instead should expose this with some options on the existing extract_ruby method. Something like:
Herb.extract_ruby(source, semicolons: true)|
@marcoroth thanks for the feedback! We are planning to use this in Steep/RBS, more specifically in this PR: soutaro/steep#1836. It's because we need the Ruby code with semicolons to display the static typing errors correctly. I think this functionality could also be used in others projects like Sorbet and Packwerk. Sorry for the lack of information in the description of this PR, we are going to update this soon. About the design, I agree to use existing |
|
|
||
| require_relative "../test_helper" | ||
|
|
||
| module Extractor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically copied these C tests https://github.com/marcoroth/herb/blob/main/test/c/test_extract.c
|
Hello @marcoroth, Sorry for the long time to update this PR. We made the changes to use the optional argument, I think could be better the |
We are planning to use the extract Ruby code with semicolons in Steep/RBS, more specifically in this PR: soutaro/steep#1836. It's because we need the Ruby code with semicolons to display the static typing errors correctly. I think this functionality could also be used in others projects like Sorbet and Packwerk.