Bug 496814 - "Create Snippet..." should use sensible preset for "Location"
Summary: "Create Snippet..." should use sensible preset for "Location"
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2016-06-27 05:09 EDT by Andreas Sewe CLA
Modified: 2019-07-24 14:35 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.