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
jon-wujon-wu 

@RemoteAction annotations break Eclipse code assist

I've noticed that code assist isn't working at all for me in Eclipse but after looking through the logs I've realized that it's breaking because it doesn't like the @RemoteAction annotation for JS remoting that I happen to be using almost everywhere. Once I remove all those annotations the code assist and auto complete works fine.

 

This is horribly inconvenient yet seems like it would be easy to fix.

 

Any ways to fix this or workarounds?

 

Here's an example of the error in the IDE log:

 

 

 WARN [2011-07-05 16:14:09,900] (ApexCodeEditor.java:getStatementNear:789) - An error occured while parsing the AST, the last cached version of the AST is being used

apex.parser.ApexParseException: Unknown annotation: RemoteAction

at apex.parser.ApexParser.parseClass(ApexParser.java:61)

at com.salesforce.ide.ui.editors.apex.ast.IdeApexClzParser.parseClass(IdeApexClzParser.java:53)

at com.salesforce.ide.ui.editors.apex.ast.IdeApexClzParser.parse(IdeApexClzParser.java:30)

at com.salesforce.ide.ui.editors.apex.ApexCodeEditor.getStatementNear(ApexCodeEditor.java:786)

at com.salesforce.ide.ui.editors.apex.ApexCodeEditor.getSourceElementAt(ApexCodeEditor.java:745)

at com.salesforce.ide.ui.editors.apex.ApexCodeEditor.computeHighlightRangeSourceReference(ApexCodeEditor.java:741)

at com.salesforce.ide.ui.editors.apex.ApexCodeEditor.selectionChanged(ApexCodeEditor.java:605)

at com.salesforce.ide.ui.editors.apex.ApexCodeEditor$EditorSelectionChangedListener.selectionChanged(ApexCodeEditor.java:598)

at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2745)

at org.eclipse.jface.text.TextViewer.firePostSelectionChanged(TextViewer.java:2693)

at org.eclipse.jface.text.TextViewer$5.run(TextViewer.java:2672)

at org.eclipse.swt.widgets.Display.runTimers(Display.java:3761)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3275)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)

at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)

at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)

at org.eclipse.equinox.launcher.Main.run(Main.java:1408)

Caused by: apex.ast.Modifiers$ModifierStateException: Unknown annotation: RemoteAction

at apex.ast.Modifiers.setAnnotation(Modifiers.java:83)

at apex.parser.gen.ApexParser.annotation(ApexParser.java:2818)

at apex.parser.gen.ApexParser.modifier(ApexParser.java:2629)

at apex.parser.gen.ApexParser.modifiers(ApexParser.java:2504)

at apex.parser.gen.ApexParser.classBodyDeclaration(ApexParser.java:1152)

at apex.parser.gen.ApexParser.classDeclaration(ApexParser.java:540)

at apex.parser.gen.ApexParser.typeDeclaration(ApexParser.java:376)

at apex.parser.ApexParser.parseClass(ApexParser.java:59)

Best Answer chosen by Admin (Salesforce Developers) 
jon-wujon-wu

They said this is not yet supported and they hope to release a new version of the IDE before Dreamforce.

All Answers

Ankit AroraAnkit Arora

First make sure that class version in eclipse should be 22. If it is then I hope you need to get the latest version of eclipse. And not sure if eclipse have the version which supports @RemoteAction.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

jon-wujon-wu

I was on version 21 and tried switching to 22. It doesn't seem to matter. It looks like the underlying code behind the Force.com IDE breaks with the "unsupported" annotation.

 

This makes some sense since it looks like the Force.com IDE hasn't been updated since Winter '11 when that annotation didn't exist - http://wiki.developerforce.com/index.php/Force.com_IDE

 

However, @RemoteAnnotation has existed for a while now so it doesn't make sense that the main development tool wouldn't support it.

Ankit AroraAnkit Arora

Seems this might be a problem, eclipse is not supported for summer 11 features yet. Hope it will be updated soon.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

jon-wujon-wu

Yea it's a bummer there doesn't seem to be much we can do about it since we don't have the source for the IDE unless maybe we can hack it or somebody has some way to fool it into thinking the annotation is valid so it can recognize the rest of the code.

Ankit AroraAnkit Arora

On this note I would like to suggest you if you can log a case getting salesforce.com experts' comment on it.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

jon-wujon-wu

Good idea. I've logged a case!

Ankit AroraAnkit Arora

Great! Please do share what you hear from them. And please close the thread by marking any post as solution.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

jon-wujon-wu

They said this is not yet supported and they hope to release a new version of the IDE before Dreamforce.

This was selected as the best answer