|
|
|
|
|
|
|
|
Re: Fulltext autocompletion proposal [message #670925 is a reply to message #670903] |
Mon, 16 May 2011 08:40 |
|
Just to merge this thread with the blog post I wrote yesterday (see http://code-recommenders.blogspot.com/2011/05/subword-matchi ng-completion-engine-for.html). Lars and Maxime have posted that they would like to have such kind of completion engine too. I found a paper on (almost) exactly this topic. Could you check out these screencasts?
* http://vimeo.com/11664433
* http://vimeo.com/19369928
It's what you would like to see, right? Maybe it's even more than you/we actually would like to see
However, I think that's pretty cool stuff and having a similar completion engine for Eclipse could be very, very cool... I'll study the paper and will come up with more thoughts on this.
There is currently one issue with the completion engine. Applying the proposals does not work properly since JDT makes some nasty prefix checks before applying the proposal. And unfortunately applying "hashCode" on a prefix "cd" doesn't match and thus no code is inserted. I need to overcome this somehow. I guess it will take me a few hours to figure out a workaround.
[Updated on: Mon, 16 May 2011 08:41] Report message to a moderator
|
|
|
|
Re: Fulltext autocompletion proposal [message #671088 is a reply to message #671049] |
Mon, 16 May 2011 18:12 |
|
I just made the completion engine available on the HEAD update site. I dubbed it the "naive subwords completion engine" - please come up with a better name if you have one.
Just a few words on the implementation. It's a very simple one that helps you on completing method names only - it does not compute proposals for types, variable names etc. yet. There is no particular reason for this but I haven't found a perfect place to make this code work for every kind of completion yet. Also it's an untested monday afternoon hack...
To install this completion engine just add
http://download.eclipse.org/recommenders/updates/head/
to your list of update sites and install the
Code Recommenders: Naive Subwords Completion (Incubator)
from Sandbox category as depicted below.
You may configure where/when Eclipse makes these proposals. Study the screenshot below for details.
In a nutshell, it takes your prefix entered and creates a regular expression from it. For example, when entering button.stx|<^Space&> the engine only presents those proposals that match this regular expression .*s.*t.*x.* which finally may match "setText(text)". This is roughly what Maxime proposed in his comment below. Currently, it does not reduce the proposal score as recommended by another comment - but we may do that if you find this more useful. Just drop a comment below...
Please note, this is a quick shot to understand your requirements. Please
- send all your comments (positive and negative) to this forum,
- inform us about issues with the current implementation,
- if you want it to change in some way - tell us about it, and finally
- for the adventurous: the source is free (EPL) and contains just 2 small classes + a plugin.xml declaring a standard IJavaCompletionProposalComputer. Feel invited to checkout the subwords feature from repository and improve it. It has no dependencies to Code Recommenders. Thus it should work standalone from inside your IDE and should be very easy to extend. We'll be glad to support you on your extensions - and it won't get easier to contribute to an open source project than now
The sources are available in git here: http://goo.gl/V9q14
The commit log is here: http://goo.gl/gLV9r
[Updated on: Mon, 16 May 2011 20:18] Report message to a moderator
|
|
|
Re: Fulltext autocompletion proposal [message #671141 is a reply to message #671088] |
Mon, 16 May 2011 21:14 |
|
If I type in super.Start+Cntr+Space it does not find the onStart() method. I believe it would be nice if it could.
It also would be nice if it would work to override methods in a class. E.g. I want to override onStart() in a class, JDT supports writing onS+Cntr+Space to select, would be cool if I could Start+Cntr+Space to create the method body.
|
|
|
Re: Fulltext autocompletion proposal [message #671144 is a reply to message #671141] |
Mon, 16 May 2011 21:39 |
|
Right. I assumed that the prefix token is always in lower cases.
What is your expected behavior if a user enters a capital letter like 'S' in 'Start'? Should it match '(s|S)' or just 'S'? Just a bit like the CamelCase matcher.
Regarding completion on overrides.
I need to dig a little bit deeper how to implement it bit smarter to reduce the amount of glue code needed. I'll have look on this later this week.
|
|
|
Re: Fulltext autocompletion proposal [message #671307 is a reply to message #671144] |
Tue, 17 May 2011 12:56 |
|
An update:
The latest version now respects upper case letters as suggested by Deepak and used by Lars. For example button.sT<^Space> now evaluates to '.*s.*T.*' whereas button.st would evaluate to .*s.*[tT].*. The underlying assumption is, that a developer who takes the additional effort to type an upper case letter has a clear vision what she is looking for.
We are currently thinking about some more advanced ranking concepts - we'll share them when ready...
[Updated on: Tue, 17 May 2011 22:55] Report message to a moderator
|
|
|
|
Re: Fulltext autocompletion proposal [message #671487 is a reply to message #671453] |
Wed, 18 May 2011 05:42 |
|
Yes. I think it makes sense for fields, variables, overrides etc.
The reason why it's not implemented is that JDT's proposals were not designed to be extended from outside. Currently, I end up with copying most of the JDT code - I'm seeking for a smarter solution. But I think I'll spent some time on it end of the week.
|
|
|
|
Powered by
FUDForum. Page generated in 0.06199 seconds