Bug 57515 - [search] java search participant for launch configs
Summary: [search] java search participant for launch configs
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2004-04-05 17:25 EDT by Darin Wright CLA
Modified: 2007-10-22 11:50 EDT (History)
4 users (show)

See Also:


Attachments
Proposed solution. (16.42 KB, patch)
2007-09-14 22:03 EDT, Peter Nehrer CLA
no flags Details | Diff
Patch for the JDT Debug UI plug-in. (19.16 KB, patch)
2007-09-24 22:10 EDT, Peter Nehrer CLA
no flags Details | Diff
Patch recreated against HEAD. (19.13 KB, patch)
2007-10-09 23:34 EDT, Peter Nehrer CLA
no flags Details | Diff
polished patch (12.58 KB, patch)
2007-10-16 13:21 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2004-04-05 17:25:24 EDT
We should contribute a search participant for launch configs (references to 
types).
Comment 1 Darin Wright CLA 2004-05-05 11:18:38 EDT
Deferred
Comment 2 Peter Nehrer CLA 2007-09-14 22:03:31 EDT
Created attachment 78490 [details]
Proposed solution.
Comment 3 Peter Nehrer CLA 2007-09-14 22:04:29 EDT
If anyone's interested in resurrecting this ghost of the past, I attached my attempt. It finds class references in launch configurations as well as launches (displayed in the Debug View). Double-clicking a launch configuration opens up a launch dialog; double-clicking a launch selects it in the Debug View.

One thing it doesn't do is resolve any string substitution variables that might have been used. Also, some of the context menu options don't make much sense, but that's a broader problem with query participants.

I look forward to any feedback.
Comment 4 Michael Rennie CLA 2007-09-24 17:43:44 EDT
All of the code in the patch is in jdt.ui, ideally your contribution should be made part of JDT debug or maybe even JDT launching if you want debug to consider it. Otherwise I can reassign it to jdt.ui and have them review it if you want it contributed there.
Comment 5 Peter Nehrer CLA 2007-09-24 21:25:58 EDT
I think I can move it to org.eclipse.jdt.debug.ui. JDT Launching and JDT UI don't see the queryParticipants extension point defined in JDT UI. How's that?
Comment 6 Peter Nehrer CLA 2007-09-24 21:30:05 EDT
The above should have read "JDT Launching and JDT Debug" can't contribute queryParticipants. Sorry.
Comment 7 Peter Nehrer CLA 2007-09-24 22:10:31 EDT
Created attachment 79106 [details]
Patch for the JDT Debug UI plug-in.

Moved to JDT Debug UI plug-in. Added string variable substitution to boot.
Comment 8 Michael Rennie CLA 2007-10-09 11:32:39 EDT
could not get the patch to apply to code from HEAD (as of 09/10/2007). 

Could you recreate a new patch against HEAD?
Comment 9 Peter Nehrer CLA 2007-10-09 23:34:46 EDT
Created attachment 80018 [details]
Patch recreated against HEAD.
Comment 10 Michael Rennie CLA 2007-10-10 17:17:14 EDT
Thanks Peter, I will look at it tomorrow.
Comment 11 Michael Rennie CLA 2007-10-12 10:32:28 EDT
I had a chance to inspect the patch, following are my comments (take them for what they are worth :) ).

1. (nit-picky) there must be comments for the class and methods

2. there must be curly braces on all control statements (if, for, etc)

3. in the showMatch(..) method of the UIParticipant you iterate over all launch modes in the workspace to find one the is usable by the configuration you want to show in the LCD. It would be better if you only iterated over the modes that the configuration supports using the call 
config.getType().getSupportedModeCombinations().

4. searching for launches is not a big win in our books, it could probably be removed

5. you should not assume progress monitors passed in from outside your class are not null (I have been stung with this one before)

6. you could just use a WorkbenchLabelProvider for your UIParticipant instead of creating a the DebugModelDecorator

7. when 'touching' launch configurations you should trap but do nothing with the exceptions, this is because an invalid config could throw an exception (meaning it would get left out of the search results, but should not disrupt the search process). You could probably remove all of the multistatus code

8. If a monitor is canceled you should return from the method and not throw an exception

Overall the code is good and works as advertised...just needs a little polishing :)
Comment 12 Michael Rennie CLA 2007-10-16 13:21:05 EDT
Created attachment 80481 [details]
polished patch

polished patch and fix for regex matching where '$' were not escaped properly, and a fix to not care about the project attribute - as configurations can be created/launched without a project attribute.
Comment 13 Michael Rennie CLA 2007-10-16 13:23:37 EDT
committed fix to HEAD.
Comment 14 Michael Rennie CLA 2007-10-16 13:24:31 EDT
please verify Curtis W, and thanks for the patch Peter
Comment 15 Curtis Windatt CLA 2007-10-16 13:59:19 EDT
Verified
Comment 16 Peter Nehrer CLA 2007-10-17 16:57:34 EDT
Excellent, thanks guys!
Comment 17 Chris Aniszczyk CLA 2007-10-22 10:56:21 EDT
is this a bugday success story :)?
Comment 18 Michael Rennie CLA 2007-10-22 11:50:41 EDT
no, sorry chris :(