Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347397 - Subwords completion proposals generalization
Summary: Subwords completion proposals generalization
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Marcel Bruch CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 02:42 EDT by Paul-Emmanuel Faidherbe CLA
Modified: 2019-07-24 14:36 EDT (History)
1 user (show)

See Also:


Attachments
new generic requestor (2.54 KB, patch)
2011-05-27 12:46 EDT, Paul-Emmanuel Faidherbe CLA
no flags Details | Diff
Newly created decorator (2.25 KB, patch)
2011-05-27 12:47 EDT, Paul-Emmanuel Faidherbe CLA
no flags Details | Diff
Modified to match jdt architecture (1.56 KB, patch)
2011-05-27 12:48 EDT, Paul-Emmanuel Faidherbe CLA
no flags Details | Diff
Proposal for fields (1.38 KB, patch)
2011-05-27 12:49 EDT, Paul-Emmanuel Faidherbe CLA
no flags Details | Diff
review comments in patch format (13.41 KB, patch)
2011-05-28 08:29 EDT, Marcel Bruch CLA
no flags Details | Diff
Patch generated by Gitk (29.46 KB, patch)
2011-05-30 13:46 EDT, Paul-Emmanuel Faidherbe CLA
no flags Details | Diff
Patch Generated by Tortoise (62.01 KB, patch)
2011-05-30 13:46 EDT, Paul-Emmanuel Faidherbe CLA
no flags Details | Diff
Patch from clean branch (63.91 KB, patch)
2011-05-30 17:11 EDT, Paul-Emmanuel Faidherbe CLA
no flags Details | Diff
Clean code patch (21.33 KB, patch)
2011-05-31 15:59 EDT, Paul-Emmanuel Faidherbe CLA
marcel.bruch: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul-Emmanuel Faidherbe CLA 2011-05-27 02:42:40 EDT
Build Identifier: 

Completion should be able to propose hints for classes, static members, attributes and so on...

Reproducible: Always
Comment 1 Paul-Emmanuel Faidherbe CLA 2011-05-27 12:46:00 EDT
Created attachment 196783 [details]
new generic requestor

Modified to use JDT proposal collector and subword decorator
Comment 2 Paul-Emmanuel Faidherbe CLA 2011-05-27 12:47:12 EDT
Created attachment 196784 [details]
Newly created decorator

Decorates jdt proposals with new prefix check
Comment 3 Paul-Emmanuel Faidherbe CLA 2011-05-27 12:48:53 EDT
Created attachment 196785 [details]
Modified to match jdt architecture

isPrefix made protected
Comment 4 Paul-Emmanuel Faidherbe CLA 2011-05-27 12:49:58 EDT
Created attachment 196786 [details]
Proposal for fields

Created to manage proposals for static members, attributes...
Comment 5 Paul-Emmanuel Faidherbe CLA 2011-05-27 12:51:57 EDT
May not entirely compile because not all "subwords proposals" are provided (overrides proposals, casted types...). Comment missing one for testing purposes
Comment 6 Marcel Bruch CLA 2011-05-28 08:29:15 EDT
Created attachment 196829 [details]
review comments in patch format

I created a patch from your individual changes using 'git format-patch -M master --stdout > review-comments.patch'

To apply this patch use 'git apply'. Please read http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/ before doing so. Be sure that you don't overwrite your uncommitted local changes made before :)


The patch looks quite good - and best of all: it works :)
I added some review comments to methods and classes. Please check them and modify the sources to reflect the comments where appropriate.

Next steps:
Create a new complete patch following the guidelines described here http://wiki.eclipse.org/Recommenders/Contributor_Guide#Contributing_Patches and attach them to this bug again for review.

Also, please add EPL license headers to all newly created files as described in the contributor guide above.

Thanks a lot! I'm looking forward to your next patch! :)

Marcel
Comment 7 Paul-Emmanuel Faidherbe CLA 2011-05-30 13:46:06 EDT
Created attachment 196921 [details]
Patch generated by Gitk

Try for Patch generated by Gitk
Comment 8 Paul-Emmanuel Faidherbe CLA 2011-05-30 13:46:42 EDT
Created attachment 196922 [details]
Patch Generated by Tortoise

Try for Patch Generated by Tortoise
Comment 9 Marcel Bruch CLA 2011-05-30 16:29:24 EDT
Hi Pef,

unfortunately, I've some trouble applying your patches. The Tortoise-patch worked best - however failed with the error messages below. Did you update to the latest version? If not, please consider rebasing to the latest head and recreating your patch afterwards. Make sure you have a backup copy of repository before doing this!


If you get into trouble with this let's go for the simplest solution:

# create a new clone of the code recommenders repository using 

> git clone --branch subwords-patch http://git.eclipse.org/gitroot/recommenders/org.eclipse.recommenders.git

Now, you have a clean and latest version of code recommenders and just create a local feature branch called "subwords-patch"

# Next, reapply your changes on the files contained in this feature branch/current working directory

> edit...

# Commit your changes:

> git commit -a -m "my changes..."

You may double-check with Tortoise that everything seems correct

# Then create your patch (I'm assuming that you did just one commit):

> git format-patch origin/master --stdout >  [description]-[issue-number].patch

# Finally attach this patch to this bug report.



You may find this resource helpful for creating patches:

> http://drupal.org/node/1054616



Thanks,
Marcel



0233:org.eclipse.recommenders Marcel$ git apply pef-subwords-completion-generalization_Tortoise.patch.txt 
pef-subwords-completion-generalization_Tortoise.patch.txt:64: trailing whitespace.
	
pef-subwords-completion-generalization_Tortoise.patch.txt:81: trailing whitespace.
/**
pef-subwords-completion-generalization_Tortoise.patch.txt:82: trailing whitespace.
 * Copyright (c) 2010 Darmstadt University of Technology.
pef-subwords-completion-generalization_Tortoise.patch.txt:83: trailing whitespace.
 * All rights reserved. This program and the accompanying materials
pef-subwords-completion-generalization_Tortoise.patch.txt:84: trailing whitespace.
 * are made available under the terms of the Eclipse Public License v1.0
error: patch failed: org.eclipse.recommenders.rcp.codecompletion.subwords/src/org/eclipse/recommenders/rcp/codecompletion/subwords/SubwordsJavaMethodCompletionProposal.java:1
error: org.eclipse.recommenders.rcp.codecompletion.subwords/src/org/eclipse/recommenders/rcp/codecompletion/subwords/SubwordsJavaMethodCompletionProposal.java: patch does not apply
error: patch failed: org.eclipse.recommenders.tests.rcp.codecompletion.subwords/src/org/eclipse/recommenders/tests/rcp/codecompletion/subwords/RegexMatcherTest.java:1
error: org.eclipse.recommenders.tests.rcp.codecompletion.subwords/src/org/eclipse/recommenders/tests/rcp/codecompletion/subwords/RegexMatcherTest.java: patch does not apply
error: patch failed: org.eclipse.recommenders.tests.rcp.codecompletion.subwords/src/org/eclipse/recommenders/tests/rcp/codecompletion/subwords/SubwordsCompletionProposalComputerTest.java:1
error: org.eclipse.recommenders.tests.rcp.codecompletion.subwords/src/org/eclipse/recommenders/tests/rcp/codecompletion/subwords/SubwordsCompletionProposalComputerTest.java: patch does not apply
s0233:org.eclipse.recommenders Marcel$
Comment 10 Paul-Emmanuel Faidherbe CLA 2011-05-30 17:11:43 EDT
Created attachment 196929 [details]
Patch from clean branch

This time your cmd worked fine I think... It gave same output as Tortoise. I hope it is a well formed patch!
Comment 11 Marcel Bruch CLA 2011-05-30 17:40:37 EDT
It worked. Thanks.

Johannes, could you review the patch and add your comments if you find major things that may need revision?

Thanks,
Marcel
Comment 12 Johannes Lerch CLA 2011-05-31 09:08:17 EDT
Patch looks good to me.
Just two answers to your questions:
1) SubwordsCompletionProposalFactory:
Throws.throwUnreachable can be found in the bundle org.eclipse.recommenders.commons.utils. To use it you will have to add that bundle as dependency first.
2) SubwordsCompletionRequestor:
The null check can be removed as the factory is not returning null, right? You also may want to catch the CoreException in the factory already. Handling of that exception could be to just wrap it in a RuntimeException so you do not need to handle it the whole way up.
Comment 13 Johannes Lerch CLA 2011-05-31 09:12:29 EDT
Ah, forgot one important point: Nice you have inserted the license header to new classes. Badly, you forgot to change the name ;-) You're not Marcel.
Comment 14 Paul-Emmanuel Faidherbe CLA 2011-05-31 13:53:40 EDT
(In reply to comment #12)
> Patch looks good to me.
> Just two answers to your questions:
> 1) SubwordsCompletionProposalFactory:
> Throws.throwUnreachable can be found in the bundle
> org.eclipse.recommenders.commons.utils. To use it you will have to add that
> bundle as dependency first.
> 2) SubwordsCompletionRequestor:
> The null check can be removed as the factory is not returning null, right? You
> also may want to catch the CoreException in the factory already. Handling of
> that exception could be to just wrap it in a RuntimeException so you do not
> need to handle it the whole way up.

How do you create dependencies? Using pom.xml or simply adding project to build path?
Thank you
Comment 15 Johannes Lerch CLA 2011-05-31 14:18:46 EDT
Dependencies are managed the eclipse way: by osgi. Just open the META-INF/MANIFEST.MF file and add another required bundle in the dependency tab.
Comment 16 Paul-Emmanuel Faidherbe CLA 2011-05-31 15:59:01 EDT
Created attachment 197040 [details]
Clean code patch

Clean code patch
Comment 17 Marcel Bruch CLA 2011-05-31 16:33:26 EDT
Hi Pef.

Just for the records: I filed a CQ (contribution request) to the Eclipse IP Team. I've no idea how long it will take to review this patch - especially because of the upcoming Indigo release. Let's hope that someone of the IP team can spent a few minutes on this soon :)

Thanks,
Marcel
Comment 18 Paul-Emmanuel Faidherbe CLA 2011-06-22 09:06:01 EDT
I authored 100% of the content I am contributing
I have the rights to contribute the content
I'm contributing the content under the EPL
Comment 19 Marcel Bruch CLA 2011-07-24 01:44:11 EDT
This contribution has been merged into HEAD. Thanks!