| Summary: | [xtend] Show escaped methods in content assist. | ||
|---|---|---|---|
| Product: | [Tools] Xtend | Reporter: | McKinley <mckinley1411> |
| Component: | Core | Assignee: | Project Inbox <xtend-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | anton, jan, moritz.eysholdt, sebastian.zarnekow, sven.efftinge |
| Version: | 2.2.0 | Flags: | sven.efftinge:
kepler+
|
| Target Milestone: | M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
McKinley
Did you try quoting it with a '^' in the Xtend code? That works, but 'as' is not show in code completion. It should be shown and if possible, the '^' inserted if 'as' is selected from content assist. Also, '^' does not have a very high-profile placement in the documentation. I did not know about it until you suggested it. Now I see it is mentioned here: http://www.eclipse.org/Xtext/documentation/2_1_0/02-Xtend_Classes_Functions.php#imports Thanks for your help with the escaping. (In reply to comment #1) > Did you try quoting it with a '^' in the Xtend code? ContentAssist should show the escaped version if there is no alternative, e.g. Object#getClass should not be shortened to ^class in CA (event though it's valid) while Something#extension() can only be proposed as ^extension The missing proposal is probably caused by java.lang.ClassCastException: org.eclipse.xtext.xbase.impl.XBlockExpressionImpl cannot be cast to org.eclipse.xtext.xtend2.xtend2.XtendClass at org.eclipse.xtext.xtend2.ui.contentassist.Xtend2ProposalProvider.completeClass_Members(Xtend2ProposalProvider.java:151) 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.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291) at org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider.invokeMethod(AbstractJavaBasedContentProposalProvider.java:271) at org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider.completeAssignment(AbstractJavaBasedContentProposalProvider.java:185) at org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider$DefaultContentAssistProcessorSwitch.caseAssignment(AbstractContentProposalProvider.java:66) at org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider$DefaultContentAssistProcessorSwitch.caseAssignment(AbstractContentProposalProvider.java:1) at org.eclipse.xtext.util.XtextSwitch.doSwitch(XtextSwitch.java:164) at org.eclipse.xtext.util.XtextSwitch.doSwitch(XtextSwitch.java:70) at org.eclipse.xtext.util.XtextSwitch.doSwitch(XtextSwitch.java:58) at org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider$DefaultContentAssistProcessorSwitch.accept(AbstractContentProposalProvider.java:71) at org.eclipse.xtext.ui.editor.contentassist.AbstractContentProposalProvider.createProposals(AbstractContentProposalProvider.java:108) at org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider.createProposals(AbstractJavaBasedContentProposalProvider.java:246) at org.eclipse.xtext.ui.editor.contentassist.CompletionProposalComputer.exec(CompletionProposalComputer.java:51) at org.eclipse.xtext.ui.editor.contentassist.CompletionProposalComputer.exec(CompletionProposalComputer.java:1) at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32) at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:78) at org.eclipse.xtext.ui.editor.contentassist.XtextContentAssistProcessor.computeCompletionProposals(XtextContentAssistProcessor.java:68) at org.eclipse.xtext.ui.editor.contentassist.RepeatedContentAssistProcessor.computeCompletionProposals(RepeatedContentAssistProcessor.java:73) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1830) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553) Turns out that the exception is not the causer of the problem. *** Bug 381983 has been marked as a duplicate of this bug. *** I checked in 2.4 and did not see .^as in content assist. I think this is important because it will turn into an infamous FAQ if it does not. Also, I think 1) .^as should show alphabetically with other .a properties, not at the top 2) .^as should show in content assist even if you start to type .a and not .^a Thanks See gerrit https://git.eclipse.org/r/#/c/10572/ approved and submitted. Thanks, Anton This is improved in 2.4.0.v201303050101, but it has a problem still. It behaves like this now: obj.[aaa, as, bbb] obj.^[as] obj.a[aaa] The last item should behave: obj.a[aaa, as] If it doesn't behave this way, many people will type obj.a[...] and not see 'as' in the content assist. They may assume that Xtend does not support existing Java APIs. They should be spared the confusion. Pushed to master Requested via bug 522520. -M. |