More Inner class completion/index/parser-recovery issues
Couldn’t locate an existing issue, apologies if duplicate.
Inner class references show as red after editing class contents above them. (see attachment)
Basic reproduction steps:
- Add inner class at the bottom
- Use it above where it’s defined
- Make edits that leave the code in an invalid state (example below)
- Finish editing to return to valid & deployable code
- Red remains
In this case I believe there was a line where edits when as follows
emailMessage.fileAttachments = new List<Messaging.EmailFileAttachment>();
(start)= new List<Messaging.EmailFileAttachment>();
(removing the variable by backspace or select & typing over, editor complains at this point, autocomplete for the variable side of the assignment is flaky)List<Messaging.EmailFileAttachment> attachments = new List<Messaging.EmailFileAttachment>();
(code is now valid)
Comments (7)
-
repo owner -
reporter - attached Screenshot_2021-08-02_095640.png
I haven't had a chance to look through your step-by-step, but perhaps my problems are an issue with a Short Name cache?
I define my inner classes at the bottom of my files, so often while I'm working in the file above it, the parser ends up invalidating the inner classes (usually blocks coming and going or other parser recovery failures).
Today after completing the changes (i.e. the file in the screenshot is deployable), I'm left with this.
-
repo owner Thanks for the follow-up. The new screenshot shows that it seems to have resolved to another inner class that shouldn't even have been accessible from that location. Or is
bawStaffAllocationTriggerHandler
the outer class shown in that screenshot? Once I know the answer to that question I'll spend some time trying to reproduce this again using the new information. -
reporter Apologies, yes
bawStaffAllocationTriggerHandler
is the outer class.There does appear to be a
Reports.NotificationAction
class which I was not previously aware of, not sure if that’s what it was resolving to (would need to re-trigger the issue to confirm) -
repo owner Gotcha. That should help. It'll be a week or so before I get a chance to return to this I'm about to take my family on a little getaway before school starts back up. I'll ping you here once I've had a chance to dive back in, though.
-
reporter - attached 2021-11-08_10-33-27.mkv
Managed to get a similar instance on video this time in a very small class
-
repo owner - changed status to resolved
Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.
- Log in to comment
Xander, I'm not able to reproduce this...or at least not much of it. The one thing I could reproduce successfully is the "autocomplete for the variable side of the assignment is flaky" where code completions aren't offered properly on the left side of the assignment operator until things are made whole again. But I don't see any leftover errors once things are back in a deployable state.
Here's what I tried:
Phase 1
Phase 2
Phase 3
Phase 4 (correctly shows an error on the assignment operator)
Phase 5 (no completions on the left side of the assignment operator)
Phase 6 (all good again)
Perhaps you're doing something other than that?
Either way I'll look into the lack of completions on the left side of the assignment operator as that should work fine.