Community
Participate
Working Groups
Hi, in the Eclipse 3.1 M2 JDT, the CodeAssist (Ctrl+Space) does not propose "instanceof" as a keyword for completion, only the whole instanceof statement. This was different in Eclipse 3.0 and is annoyin, beacuse when you type if (anyObject inst And press Ctrl+Space, it will automatically generate if (anyObject if (name instanceof type) { type new_name = (type) name; }) bye
Keywords are proposed by Core. Moving...
I'm running N20050303-0010, which, in the context described above, correctly proposes both: instanceof - dynamic type test and cast instanceof (keyword) However, when selecting the 'dynamic type test and cast' option, it redundantly blurts out the entire associated code snippet inside the existing 'if', as shown above. It seems to me that this assist should recognize it is already in an 'if' condition and complete it appropriately. For example: if (anyObject inst would complete to: if (anyObject instanceof type) { type new_name = (type) anyObject; }
I could not reproduce the bug in I20050426-1700 For the second problem: 'dynamic type test and cast' is not a java completion but a template completion and template completion only look the current token. Close.
(In reply to comment #3) > For the second problem: 'dynamic type test and cast' is not a java completion > but a template completion and template completion only look the current token. > > Close. Okay, so that's the technical explanation of why it's doing the wrong thing, but it's still doing the wrong thing... Should I open a separate issue for it?
The template completion is not a 'contextual' completion. The template completion replace a textual shortcut with a defined template (you can define your own template inside "Preferences>java>Editor>Templates"). But if you think that's would be better to be more contextual sensitive, you should enter a feature request against JDT/UI.