Bug 202628 - [content assist] code complete on instanceof selects the instanceof template over the instanceof keyword
Summary: [content assist] code complete on instanceof selects the instanceof template ...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.4 M4   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 202467
Blocks:
  Show dependency tree
 
Reported: 2007-09-07 09:34 EDT by Maxime Daniel CLA
Modified: 2007-11-06 09:32 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxime Daniel CLA 2007-09-07 09:34:21 EDT
Build id: I20070904-0800

When completing upon if(o ins, you get the instanceof template as the first proposal, resulting (at least for me) into the unwanted insertion of a complete template whereas I only meant to save the typing of the 'tanceof ' part. I noticed that the proposal of the keyword is contextual (that is, it is not proposed outside of a boolean expression - or whatever criterion that more or less matches that), but when it is available, I'd rather see it come in first position.
(I know that I can exclude the templates from the first series of proposals, but this is not the default, hence I must do it for each new workspace, and I also believe that a new user would suffer a bit before getting rid of it.)
Comment 1 Dani Megert CLA 2007-09-07 09:44:11 EDT
Sorry but experience has shown that templates are more important than keywords. Since we have no clue what the 'instanceof' template will do we can't assume it's less important in your given scenario.

You can do this:
1. enable 'Insert common prefixes automatically'
2. you can then type inst + code assist
==> inserts instanceof
3. press 'Space'
4 voilà!
Comment 2 Dani Megert CLA 2007-09-07 09:50:42 EDT
We could be smarter once we have more context.
Comment 3 Markus Keller CLA 2007-11-02 07:09:31 EDT
I usually rename the 'instanceof' template to something like 'ifInstanceof'.
Comment 4 Dani Megert CLA 2007-11-06 03:44:36 EST
>I usually rename the 'instanceof' template to something like 'ifInstanceof'.
If we would change this it would burn long time Eclipse users that are used to the current behavior. We really need more context to do the right thing here.
Comment 5 Dani Megert CLA 2007-11-06 09:32:43 EST
OK, I've now fixed this in HEAD. We already have a hack in place to detect some sort of context using JDT Core's keyword proposals. Using this hack I can prevent that the template is boosted in the reported scenario. I cannot hide it though.