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

Bug 370955

Summary: [ContentAssist] Unexpected proposals
Product: [Tools] Xtend Reporter: Sebastian Zarnekow <sebastian.zarnekow>
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: btickets, Holger.Schill, moritz.eysholdt, st.oehme, sven.efftinge
Version: 2.3.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: v2.7
Bug Depends on:    
Bug Blocks: 409580    

Description Sebastian Zarnekow CLA 2012-02-08 09:27:14 EST
Input file:

class X {
	def method() {
		val CharSequence c = null
		c.toString // first
		expectString(c.toString) // second
		if (true) {
			expectString(c.toString) // third
		}
	}	
	def expectString(String s) {}
}

Invoke CA in annotated lines right after c.toString

First example works as expected
Second yields 'Override Object.toString()' which is not right
Third offers Object.toString() in addition to CharSequence.toString which is not what one would expect (assumed receiver seems to be 'this' since X.toString is suggested if toString is specialized in X
Comment 1 Holger Schill CLA 2014-04-29 09:12:10 EDT
For the second scenario there is a context computed where the currentModel is a XtendClass - that causes the override stuff.

org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.StatefulFactory.computeCurrentModel(EObject, INode, Collection<AbstractElement>)
Comment 2 Sebastian Zarnekow CLA 2014-06-25 11:23:49 EDT
Pushed to review