-
Notifications
You must be signed in to change notification settings - Fork 154
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
Handle Sorbet levels to prevent some feature duplication #2322
Conversation
🤔 Will any of the signature changes here impact addons? |
It shouldn't, we weren't passing |
df911f3
to
6a96430
Compare
I dug a little deeper and there were a few other scenarios I hadn't realized. For example, Sorbet can provide constant completion even if a file has no The PR should be good for another round of reviews. |
Motivation
This PR is a step towards #2294
We added a bunch of new features recently, but we weren't super careful about checking which parts overlapped with Sorbet's behaviour and under which scenarios. This resulted in a bit of duplicate behaviour and we can improve that.
Note that full removal of any kind of duplication is going to require deep integration with the type checker and is a much more involved effort.
Implementation
Essentially, requests have to know the level of Sorbet type checking available for a file to make decisions about what to provide.
Instead of trying to use a blanket statement like
typechecker_enabled?
, I switched to passing the Sorbet level of type checking to the relevant requests.I left some comments on the PR to help understand the decisions.
Automated Tests
Added tests.