function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
danwattdanwatt 

Force.com IDE Bug : Content Assist String Index of of range

When I start typing the name of a class, and then hit "ctr-space" to bring up content assist, I am getting an error "Content Assist" did not complete normally.  Please see the log for more information.

 

The stacktrace is :

 

java.lang.StringIndexOutOfBoundsException: String index out of range: -1at java.lang.String.substring(Unknown Source)at com.salesforce.ide.ui.editors.apex.assistance.proposals.ClassIntfEnumProposal.construct(ClassIntfEnumProposal.java:83)at com.salesforce.ide.ui.editors.apex.assistance.proposals.ProposalAggregator.construct(ProposalAggregator.java:171)at com.salesforce.ide.ui.editors.apex.assistance.proposals.ApexCompletionProposalDelegate.construct(ApexCompletionProposalDelegate.java:88)at com.salesforce.ide.ui.editors.apex.assistance.ApexCompletionProcessor.computeCompletionProposals(ApexCompletionProcessor.java:93)at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1832)at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:488)at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)

sjacobssjacobs

getting the same issue. on Eclipse Helios

 

Version: Helios Service Release 2
Build id: 20110218-0911

 

Any solution to this? Very annoying to develop without being able to use content assist.

sjacobssjacobs

I found a temporary work around. If you create a new workspace and redownload all classes, objects, visualforce pages, etc ... the problem will go away.

 

I also noticed (though I have not confirmed if this correlation is causation) that once I upgraded my original workspace from version 22.0 to 23.0 I started to receive this index out of range exception. If you look at that stacktrace... It appears to be failing to parse a string (via substr() ) call somewhere... maybe this String is in the workspace somewhere? Nonetheless, it works now... though was annoying to troubleshoot. 

Reppin__505Reppin__505

I tried this workaround, but it did not work for me...

 

Created new workspace.

Imported project from old workspace. 

Attempted to use content assist but got the same error...

sjacobssjacobs

right don't import  the old project (corrupted?) you must redownload all your objects, classes, etc... from the server again. So when you create a new workspace reinput your login/password/security token.

Reppin__505Reppin__505

Did as you said and still getting the same content assist error :0(

 

There are projects where the content assist has worked, but that fact that it is inconsistent is frustrating and i'm really just trying to finally get to the bottom of this issue..

sjacobssjacobs

Try this, instead of using the eclipse plugin try downloading the force.com IDE stand alone and again enter your login/pass/security token. See if you still get the error then.

 

http://wiki.developerforce.com/page/Force.com_IDE_Installation

 

 

Reppin__505Reppin__505

I think i just need to roll back my Force.com IDE from the Winter 12 release to the one prior. This Winter 12 release has proven to be real buggy and i've wasting enough time on these kind of issues.

 

Do you know how i can roll it back by chance?

sjacobssjacobs

I think I came to the same conclusion at some point with regards to wasting time on this... I tried to look into rolling back couldn't figure it out either. Now i'm just rolling with Force.com IDE + Winter '12 as it is the most stable way to develop to date for me. I really don't need to be in eclipse to do SF dev. Sorry couldn't help any more.

Reppin__505Reppin__505

You have helped. Honestly i didn't know there was a standalone app for Force.com development. I will have to give this a shot.

 

Thanks.

Reppin__505Reppin__505

Well i set out to find the reason why this issue seems to occur so infrequently, causing so much grief when it does occur. After spending the afternoon on this I think i found a consistent pattern and a simple fix around the issue.

 

After trying the above options to no avail i found that there were some projects in my eclipse ide where content assist (CA) was working correctly. The projects where CA was working were mature projects with many different types of components whithin them. 

 

The new project which i just created today only had the new trigger i just started writing. In this project CA was not working. So after a few hours i made the connection that the mature projects were working correctly as a result of the components within them. 

 

Skip to Solution:

I added a class to the project which only had the trigger and WHA LA!! content assist started working for both the new class and the trigger. 

 

I will report this bug tomorrow.

 

Hope this helps others.