Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 436694

Summary: "Create snippet from selection" context menu
Product: z_Archived Reporter: Andreas Sewe <sewe>
Component: RecommendersAssignee: Project inbox <recommenders-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: marcel.bruch
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=437687
Whiteboard:

Description Andreas Sewe CLA 2014-06-05 07:51:14 EDT
To make the creation of new snippets for Snipmatch as easy as possible it would be great if one could selection a couple of lines in the Java editor and then select "Create snippet from selection" from the context menu.

Such a menu item would then open the Snippet Editor with a snippet source derived from the selected Java code. For example, variables should be replaced by ${var} and ${var:newName(...)} were appropriate. That way, it would be much easier to get started with the little-known JFace template language.
Comment 1 Marcel Bruch CLA 2014-06-16 16:21:38 EDT
Incomplete prototype (a proof of concept) is in Gerrit.

https://git.eclipse.org/r/#/c/28598/
Comment 2 Marcel Bruch CLA 2014-06-17 11:22:01 EDT
More complete now. See [1] for screenshot. Although it has quite a few limitations I'd be fine to merge this with HEAD until Monday to gather some feedback.



[1] https://twitter.com/MarcelBruch/status/478913378547924992
Comment 3 Marcel Bruch CLA 2014-06-19 07:11:47 EDT
Merged into HEAD. Early access users can install it via [1]. I'm looking for your comments.

[1] http://download.eclipse.org/recommenders/updates/head/
Comment 4 Andreas Sewe CLA 2014-07-28 03:08:13 EDT
This was part of 2.1.1 already.