Community
Participate
Working Groups
I20110428-0200 - In Java editor, enter the name of a type that does not exist. - Hit Ctrl+Shift+M or Source > Add Import On the status line it says, "$missing$ could not be found or is not visible. Obviously this should say the name of the type.
Created attachment 194977 [details] Screen shot
Marking as potential polish item.
John, I cannot reproduce this in 3.7 M7, 4.1 M7 and I20110505-0800. Can you provide more detailed steps that reproduce it for you?
It probably depends on your exact code and location/selection. Moving to JDT Core where the string (org.eclipse.jdt.internal.compiler.parser.RecoveryScanner.FAKE_IDENTIFIER) is defined. Maybe they can say more.
I can reproduce in HEAD and in 3.6.2 with this CU: public class Try { private void startHelpSystem() { Blort } } - caret after "Blort" - Ctrl+Shift+M Statement Recovery turns the method into an Assignment node with LHS "Blort" and RHS "$missing$". The invented name comes from bug 127395. A better recovery would be just a SimpleName instead of the Assignment. I wouldn't touch this for 3.7.
>- caret after "Blort" This is the important part. I probably had the caret before 'B', inside "Blort" or a selection in which case the problem doesn't show up.
(In reply to comment #5) > A better recovery would be just a SimpleName instead of the Assignment. That can't be. A simple name followed by a ';' is not a valid statement. Is it possible to skip recovered nodes from the UI?
Created attachment 195262 [details] Proposed fix I would propose the following patch in the UI. Other locations might need the same patch.
> > A better recovery would be just a SimpleName instead of the Assignment. > That can't be. A simple name followed by a ';' is not a valid statement. Recovered nodes don't have to be grammatically correct. E.g. here, I already get the recovery I would also expect without the ';' after the name: public class Try { private void startHelpSystem() { Blort; } } > Is it possible to skip recovered nodes from the UI? It would be possible, but a better recovery would help all clients. An advantage of the better recovery would e.g. be that "Add Import" would actually work in that situation (if Blort is a valid type name).
-1 for a UI only fix.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.