Did you ever type something like text.lay<^Space> and wished Eclipse would complete it to text.setLayoutData()? If you do that with Eclipse as it is today you will get all proposals that start with lay* as shown below:
No surprise yet. Eclipse has a strict prefix matching that ensures that every completion proposal matches the prefix entered by the user. This limitation is somewhat relaxed by allowing CamelCase matches. For instance if you trigger code completion on container.sLD<^Space> you get all completions that match the upper-case letter as shown here:
CamelCase is excellent. However, most of the time when using CamelCase matchers we have to carefully think about what CamelCase shortcut would match the proposal we want to see. But given the benefit that I only have to type 3 letters instead of 11 to make the match unique (or by typing setl+↓) CamelCase is a real relief.
Yet, quite some people aren't happy enough with the way CamelCase abbreviations work. They would like to have a subword matching rather than a strict prefix or CamelCase matching (see [1], [2], [3] for recent discussions on this).
Subwords is coming to rescue those. A few weeks ago we had been asked to provide such a completion engine. It didn't seem very complex (at first). Thus I spent a few hours on implementing a first prototype and announced it via twitter and Code Recommenders' newsgroup. I got a lot of feedback and helpful discussions on what expectations users have how such a completion engine should work. Thanks to Maxime Jeanmart, Lars Vogel, Deepak Azad, Sascha Vogt, Sebastian Proksch, Gary Fritz, Michael Kutschke and quite a few others for their comments on this prototype.
Today, we are happy to announce the first "official" "drop" of this subwords completion engine!
Below you find a few screenshots showing the subwords completion engine in action.
Completion proposals if triggered at container.lay<^Space> |
Proposal when triggering completion at text.<^Space> and then typing lay with open completion window |
Subwords completion matching on variable names |
You will experience a few more features as you go.
I would like to thank Paul-Emmanuel Faidherbe who implemented large parts of this system and contributed it to Code Recommenders!
What's coming next?
Subwords is experimental and needs your feedback. If you like the completion let us (Code Recommenders and the JDT team) know by adding yourself to CC list at https://bugs.eclipse.org/bugs/show_bug.cgi?id=350000 and by adding comments and new feature requests to this bug report.
And of course: If you experience strange behavior, let us know by sending a post to the code recommenders forum or by creating a bug report at Eclipse Bugzilla.
If you'd like to support subwords: all ideas and issues are tracked by bug 350000 and wait for your help. If you would like to add a feature (such as completion on type names for instance), just let us know!
Best,
Marcel
Great news! And thank you for the mention. I will be able to continue contributions soon, keep you in touch. Bye.
ReplyDeleteI'm looking forward to it!
ReplyDeleteGreat! But the "subword" proposal doesn't work in the function parameter context.
ReplyDeleteHi Sefler, could you please open a bug report on this to track that issue?
ReplyDeletehttps://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;classification=Technology;product=Recommenders