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

Mode to export an "externs" file instead of replacing constants? #172

Open
dorner opened this issue Jul 24, 2023 · 0 comments
Open

Mode to export an "externs" file instead of replacing constants? #172

dorner opened this issue Jul 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@dorner
Copy link
Contributor

dorner commented Jul 24, 2023

Is your feature request related to a problem? Please describe.
The PRs I've put in so far have mostly been related to Sord being able to read external files in order to avoid the "Constant not found" errors. I'm wondering what benefit we actually get from this feature. The output of sord (either RBI or RBS) are going to be fed into a type checker, which can then complain about constants that aren't found. Tapioca itself, when it reads gems, outputs a todo file that lists the constants it couldn't find rather than change the output to force you to make changes.

Describe the solution you'd like
A --replace-extern mode where when Sord finds a constant it doesn't know about, it exports it to an externs file and leaves it as is in the RBI/RBS output. This way Sord doesn't even need to read in any dependencies, because it can assume that the user has those dependencies where their type checker can find them.

Does this sound like a good idea? It should be relatively easy to implement. @AaronC81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant