Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 392073

Summary: [ContentAssist] Allow content assist to replace prefix
Product: [ECD] Orion Reporter: Thomas Schindl <tom.schindl>
Component: EditorAssignee: Project Inbox <orion.editor-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: andrew.eisenberg, Holger.Schill, john.arthorne, Silenio_Quarti
Version: unspecified   
Target Milestone: 4.0 M2   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Thomas Schindl CLA 2012-10-16 10:09:18 EDT
Currently the values from a content assist can only get appended to the current prefix which has some problems (e.g. in Java):
a) Imaging you want to use a.Bla and b.Bla and you started typing B to bring up 
   content assist you can not insert the FQN of the class anymore because you 
   only allow appending 
b) Imaging you type b.sett and the proposal tells you it is setText() you can not 
   fixing the typo you have in b.sett

I propose to allow the proposal to switch the content assist into a replace mode where it replaces the prefix instead of only appending.

I've already implement the feature in my forked github repo. You can see the commit here: https://github.com/tomsontom/orion.client/commit/368ecc215c159aa5513cd89adcdb9331bd74086e
Comment 1 Andrew Eisenberg CLA 2012-11-16 13:38:46 EST
I must say that I never liked the way that the Orion content assist api didn't allow for replacing the prefix, but I never got around to looking into a fix myself.  So, I'll take a look at this right now.
Comment 2 John Arthorne CLA 2012-11-16 13:56:16 EST
Makes sense. I think we knew this case would come up but never did it because we didn't have a concrete case yet. Thanks for taking a look Andrew.
Comment 3 Andrew Eisenberg CLA 2012-11-16 15:13:55 EST
This looks good to me.  I tried it out and all existing tests pass.  I also wrote a test case for regression tests.

Thanks for the work here.  I'll take a look at your icons patch next.

Next time, it would be helpful if you worked on each bug in a separate branch of your cloned repo.  It makes things easier to merge and ensures that my testing is not polluted by other changes.

Once you add a comment as described in step 4, here:
http://wiki.eclipse.org/Development_Resources/Handling_Git_Contributions#Git

I will merge your work into master.
Comment 4 John Arthorne CLA 2012-11-16 15:20:15 EST
The iplog flag is not needed.. the only thing we need to do is ensure the Author of the commit is Tom.
Comment 5 John Arthorne CLA 2012-11-16 15:21:26 EST
(the author header in the commit record.. if you did a cherry-pick it should be fine, otherwise you can adjust from the status page)
Comment 6 Silenio Quarti CLA 2013-09-11 13:48:15 EDT
This is fixed in latest. The proposal flag is "overwrite" instead of "replace".