Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370955 - [ContentAssist] Unexpected proposals
Summary: [ContentAssist] Unexpected proposals
Status: VERIFIED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: v2.7
Keywords:
Depends on:
Blocks: 409580
  Show dependency tree
 
Reported: 2012-02-08 09:27 EST by Sebastian Zarnekow CLA
Modified: 2014-08-21 08:15 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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