Bug 496814

Summary: "Create Snippet..." should use sensible preset for "Location"
Product: z_Archived Reporter: Andreas Sewe <sewe>
Component: RecommendersAssignee: Project inbox <recommenders-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: yasett.giselle
Version: unspecifiedKeywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Andreas Sewe CLA 2016-06-27 05:09:17 EDT
If I use the "Create Snippet..." menu item, a new snippet is opened in an editor with "Location" *not* being set.

As I definitely am in a Java file for the "Create Snippet..." menu to be visible, at least a preset "Location" of "Java File" would be great; this would save me one extra manual step.

If the selection is more specific, we could even provide a better preset. For the selections marked with '$', I would ideally like to see the following:

  class Example {
    $int field;$ // this selection should preset "Java type members"

    /**
     * $@return$ this selecion should preset "Javadoc"
     */
    void m() {
      $int local;$ // this selection should preset "Java statements"
    }
  }
Comment 1 Andreas Sewe CLA 2016-06-27 05:10:07 EDT
@Yasett: Are you still interested in working on Snipmatch? If so, this would be a great enhancement.
Comment 2 Yasett Acurana CLA 2016-07-05 18:43:33 EDT
(In reply to Andreas Sewe from comment #1)
> @Yasett: Are you still interested in working on Snipmatch? If so, this would
> be a great enhancement.

Yes, I am. I have been tremendously busy lately, but will give it a look.

Thanks for letting me know.
Comment 3 Andreas Sewe CLA 2016-07-06 03:28:05 EDT
(In reply to Yasett Acurana from comment #2)
> (In reply to Andreas Sewe from comment #1)
> > @Yasett: Are you still interested in working on Snipmatch? If so, this would
> > be a great enhancement.
> 
> Yes, I am. I have been tremendously busy lately, but will give it a look.

No rush.

Anyway, I'm looking forward to your change in Gerrit. Maybe we can develop this one in a test-first fashion (first push failing tests to Gerrit, before starting with the actual implementation)? Have a look at SnippetCodeBuilderTest in project org.eclipse.recommenders.jdt.tests on how to set up small example projects with a portion of Java code selected as test inputs.