| Summary: | [content assist] Ctrl+Shift+Space does not use proposal kinds settings | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Mik Kersten <mik.kersten> | ||||
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P4 | CC: | daniel_megert, mlists | ||||
| Version: | 3.2 | Keywords: | helpwanted | ||||
| Target Milestone: | 3.4 M1 | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 129080 | ||||||
| Attachments: |
|
||||||
|
Description
Mik Kersten
Tom, please investigate. ContentAssistant currently does not issue content assist session events when context information is requested (doesn't make sense, as there is no such thing as incremental context information or as-you-type filtering). org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor only does the "enabled/disabled/cycling" category dance when it receives content assist events. I believe the right thing to do is to collect context information for any categories that are either in the default group or enabled as separate category, but not the ones that are disabled. That sounds right, and just to be clear what I see happening now is the disabled ones showing up as well. So I assume this won't make it for 3.3? I can make a FAQ entry. I've only heard one Mylar user complain about this so assume Ctrl+Shift+Space is not that popular, but if more people add proposal computers it could lead to more unexpected behavior of this sort. Yes, we won't have time for this. Daniel: could you consider this for 3.4? Without it Mylyn does not have a way of addressing the duplicate entries (bug 129080). Let me know if we should try to gather additional votes on the priority of this, since beyond the comments on bug 129080 I have no idea how commonly used Ctrl+Shift+Space is. Sorry but I'm not sure whether we will have time for this. A patch would gladly be accepted. Daniel, can you please give some hints where to look at this and what is the related code that could be used? Hi Eugene, this should be pretty simple to achieve: the code in org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeContextInformation(ITextViewer, int) needs to be adjusted. The simplest patch simply ignores those from the disabled processors. You can use org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ITextViewer, int) as a template. NOTE: computeContextInformation(...) should also contain all the saftey code that's in computeCompletionProposals but we obviously forgot that. To make your patch perfect you could add that code as well ;-) Thanks Daniel, I can take a look at computeContextInformation(), but I am not really familiar with the required safety code. Can you please elaborate on that or point me to some examples? It's the code that's already in computeCompletionProposals i.e. - warn if a processor takes too long - warn if a processor fails Are you referring to the stuff that can be enabled with DEBUG? If not, I guess it isn't really obvious to me... both proposal and context collectors set fErrorMessage field similarly down to CompletionProposalComputerDescriptor. Sorry Eugene, it was too hot here yesterday - sigh! The stuff I mentioned is just the entry point and too far away from where the fix would have to be put in place. There's a general problem here though: while we have full support for code assist (Ctrl+Space) configuration we don't have anything similar for Ctrl+Shift+Space, e.g. you can't toggle through the categories by hitting another Ctrl+Shift+Space like it can be done with Ctrl+Space. Since I led you into the wrong direction I thought it's fair to fix this myself. For now I disable the categories that are neither checked in the default nor the cycling list. Please try out the attached patch whether it works for you guys. Fixed in HEAD. Available in builds >= I20070717-0800. Wau! Thanks Daniel. I'll try the integration build. PS: by the way, did you actually meant to attach patch to the bug report? Created attachment 73945 [details]
Fix
|