-
Notifications
You must be signed in to change notification settings - Fork 41
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
Detect override def run: ZIO[_, _, ZIO[_, _, _]]
#443
Comments
Actually, we already have an inspection that detects discarded effect (due to Unit discarding). We can expand it to trigger when ZIO effect is treated as |
Thanks for the suggestion! I admit I haven't yet got the chance to play with zio-direct, but I know that the library ships with some IntelliJ support to help with the type inference for its macros. Maybe @deusaquilus could elaborate on whether this is possible to detect via the |
Ah right, I now remember why we didn't put it in the plugin - whitebox macros don't have extension points from IntelliJ plugins - they are installed and instantiated via a different mechanism. I'll have to explore whether it's possible to hack the "library extension provider" Alex was kind enough to document it. https://zio.dev/zio-direct/intellij-support/ |
(mostly a note-to-self) Lastly, I forgot about this, but @unkarjedy was able to load the extension with reflection (promising to make the method to do this public ;)). So there might be a way to hack support for this in the plugin. I'll look into it soon. |
@hmemcpy |
@jamesward I think ZIO-Direct should produce a warning in this situation. I'm pretty sure it does so in Metals. Need to look into what I'm doing in the ZIO-Direct IntelliJ plugin. |
Would it be possible to detect a
run
that has a ZIO which has a ZIO in theA
? I sometimes do this with ZIO Direct:Which doesn't work because I need to actually run my printLine in the defer. Or maybe ZIO Direct should produce a warning? Not sure the right place to catch me from doing something silly.
The text was updated successfully, but these errors were encountered: