⁠
joe: Include much more detail in inspection descriptions
- <!--
- Minecraft Development for IntelliJ
-
- https://mcdev.io/
-
- Copyright (C) 2026 minecraft-dev
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation, version 3.0 only.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
- -->
-
- <html>
- <body>
- Usage of <code>LocalCapture.CAPTURE_FAILEXCEPTION</code> is usually a mistake and should be replaced with
- <code>LocalCapture.CAPTURE_FAILHARD</code>. <code>CAPTURE_FAILEXCEPTION</code> generates code which throws an
- exception when the callback is reached, if the locals do not match. If this is really what you want, you can
- suppress this warning.
- </body>
- </html>
- <!--
- Minecraft Development for IntelliJ
-
- https://mcdev.io/
-
- Copyright (C) 2026 minecraft-dev
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation, version 3.0 only.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
- -->
-
- <html>
- <body>
- <p>
- Reports usages of <code>LocalCapture.CAPTURE_FAILEXCEPTION</code>.
- </p>
- <!-- tooltip end -->
- <p>
- If the captured locals don't match the target method, <code>CAPTURE_FAILEXCEPTION</code> generates code which throws an
- exception when the callback is reached, instead of failing when the mixin is applied. This hides the problem until that code
- runs, so it is usually a mistake.
- </p>
- <pre><code>
- @Inject(method = "foo", at = @At("TAIL"), locals = LocalCapture.CAPTURE_FAILEXCEPTION) // bad
- @Inject(method = "foo", at = @At("TAIL"), locals = LocalCapture.CAPTURE_FAILHARD) // good
- </code></pre>
- </body>
- </html>