diff --git a/docs/intentions_inspections_quickfixes.md b/docs/intentions_inspections_quickfixes.md index 4746013c035..ef54574bacc 100644 --- a/docs/intentions_inspections_quickfixes.md +++ b/docs/intentions_inspections_quickfixes.md @@ -35,6 +35,10 @@ requires multiple resolve calls in a row. - Prefer `resolveToDescriptorIfAny()` over `resolveToDesciptor()` because of exceptions that are thrown from latter function when descriptor is absent. +- Any checks about code state and resolve that were made during reporting an inspection problem an registering a quick fix might be +invalidated by the moment of the actual quick fix execution. Avoid the code that can throw exceptions because of that. Re-checks with early +exit from the quick fix can be used to workaround it. + - There shouldn't be PSI elements stored in QuickFix classes (`val psi: PsiElement`) as such elements might be invalidated and can lead to memory leaks. Smart pointer (check `SmartPsiElementPointer` class and `createSmartPointer()` function) can be used when such storage is absolutely necessary.