View
270
Download
0
Category
Tags:
Preview:
DESCRIPTION
These slides present SnipMatch, an extensible snippet search and snippet completion engine for Eclipse.
Citation preview
Crowdsourcing, Code Snippets, and more
What Eclipse Code Recommenders has been up to for Luna
@MarcelBruch +MarcelBruch
ONCE UPON A TIME…„Based on a true story…“
3
That guy had a smart idea how to make Eclipse even better…
Thanks to Eike Stepper for permission to reuse his portraits :-)
…he created an extension point…
4
How can I read all extensions known to the
system?
5
6
Hey, this was done so many times before. It should be easy to find an example…
7
7
7
7
8
9
I GIVE UP!
But indeed there is an example…
10
IExtensionRegistry registry = Platform.getExtensionRegistry();IExtensionPoint point = registry.getExtensionPoint(EXT_POINT_ID);!for (IExtension ext : point.getExtensions()) { for (IConfigurationElement elem : ext.getConfigurationElements()) { MyProvider provider = elem.createExecutableExtension(CLASS_ATTR); res.add(provider); }}return res;
SNIPMATCH„An (extensible) code snippet completion and search engine for Eclipse“
Live Demo
12
Searching for snippets inside the Snipmatch view
Live Demo
13
Searching for snippet in lightweight snippet search window
Live Demo
14
Inserting snippets with links, new var names, …
Live Demo
15
Create snippet from text selection
Live Demo
16
Xtext editor with syntax highlighting…
17
Hmm, if creating own snippets is so simple, why not
share them with others?
Snippets arrayadd
arraymerge ...
Awesome New
Snippet
Snippets arrayadd
arraymerge ...
Snippets arrayadd
arraymerge ...
Snippets arrayadd
arraymerge ...
Crowdsourcing code snippets?
18
Snippets arrayadd
arraymerge ...
Awesome New
Snippet
Snippets arrayadd
arraymerge ...
Snippets arrayadd
arraymerge ...
Snippets arrayadd
arraymerge ...
Crowdsourcing code snippets?
18
Snippet Repository
Snippets arrayadd
arraymerge ...
Awesome new
Snippet
Snippets arrayadd
arraymerge ...
Snippets arrayadd
arraymerge ...
Snippets arrayadd
arraymerge ...
Crowdsourcing code snippets!
19
Live Demo
20
Sharing snippets via Gerrit Review System…
21
Cool stuff!What’s planned for 2.2?
Snipmatch 2.2 Roadmap for SR1• Class-path dependent snippet proposals:
• No SWT on your class-path? => No SWT snippets.
• Xtext based snippet editor: • with syntax highlighting, code completion,error detection.
(preview demo’ed)
• Multiple repositories: • Gerrit, git, file, db, …
• General snippet goodness: • Create snippets from text selection. • Voting and commenting on snippets (SR2 maybe).
• Many more (crowdsourced and mined) snippets!22
Get ready for Eclipse Luna!
23
Get it from Luna update site!
24
Grab it from the Marketplace…
25
Credits• Credits for the emotion-portraits go to Eike Stepper.
• Thanks for permission to use themhere at the Eclipse Democamp Zürich.
26
Crowdsourcing, Code-Snippets, and more
What Eclipse Code Recommenders has been up to for Luna
@recommenders +code recommenders
ANYTHING ELSE?
Mylyn Integration
29
Completion Tips
30
More frameworks
31
0
950
1900
2850
3800
Kepler Luna (M3) Luna (M7) Luna
More frameworks
31
Luna
Crowdsourcing code completion?
32
Codetrails Connect Community Edition, Install from http://www.codetrails.com/connect
!void ctor() {! List l = new A…}
Crowdsourcing constructor completion
33
What is the mostly likely completion a developer looks for in this particular situation ?
!void ctor() {! List l = new A…}
Use (costly) subtype checks
34
Codetrails Completion Tweaks for Eclipse, Install from http://download.codetrails.com/updates/connect/
But you may also crowdsource this...
35
It learns from you. From the very 1st moment.
Codetrails Connect Community Edition, Install from http://download.codetrails.com/updates/connect/
!void quickfix() {! List l = new A}
How about fixing quick-fix?
36Not fixed yet. But could be easily - when you start sharing your knowledge…
Recommended