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

Bug 314143

Summary: Missing code completion proposals
Product: [Modeling] TMF Reporter: Ed Willink <ed>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: helios+
Target Milestone: SR1   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Ed Willink CLA 2010-05-24 13:05:12 EDT
(RC1) In the MDT/OCL Complete OCL Grammar with the following text segment from the RoyalAndLoyal example project.

context ServiceLevel
inv invariant_ServiceLevel17 :
	(OrderedSet{'a', 'b', 'c', 'd'}->subOrderedSet(2, 3)) = OrderedSet{'b', 'c'}

Setting the cursor after "Se" in "context ServiceLevel" gives a very credible set of proposals. This is a Complete OCL construct.

Setting the cursor after "su" in "'d'}->subOrderedSet(2" gives nothing. This is an Essential OCL construct that the Complete OCL grammar refines and extends.

a) no pop-up offering nothing
b) no proposals for which at least subOrderedSet is an option

Since the scope lookup is never invoked I suspect this is an Xtext rather than MDT/OCL problem.

Attempting to debug: ContentAssistContext[] contexts are empty, although parser.getFollowElements(completeInput) did return some candidates.

Setting the cursor after "->" in "'d'}->subOrderedSet(2" does not even seem to find any follow elements.
Comment 1 Sebastian Zarnekow CLA 2010-05-31 02:37:36 EDT
The problems seems to be the required lookahead of 26 (due to backtracking).
I will briefly look into this and if I can spot the something obvious, I'll try to fix it. Otherwise it won't make it into 1.0.
Comment 2 Ed Willink CLA 2010-05-31 04:16:02 EDT
Don't struggle to do this for 1.0.0; we can't expect 1.0.0 to be perfect in every respect. Certainly my editors aren't. Hit the performance issues first; those can be bad on even medium-size models nearly all of the time. A few missing completion proposals have no impact most of the time.
Comment 3 Sebastian Zarnekow CLA 2010-05-31 04:51:38 EDT
The problem is in org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser.followElementFactory.new IFollowElementFactory() {...}.createFollowElement(AbstractElement, int) but there is no straight forward way to fix this now. Will be done in the SR1.
Comment 4 Sebastian Zarnekow CLA 2010-07-12 06:21:48 EDT
Fixed in HEAD.
Comment 5 Karsten Thoms CLA 2017-09-19 15:48:18 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.