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

Bug 358805

Summary: ClassCastException in XbaseProposalProvider
Product: [Modeling] TMF Reporter: Kai Kreuzer <kai>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: Holger.Schill, sebastian.zarnekow
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Kai Kreuzer CLA 2011-09-24 16:11:25 EDT
Build Identifier: Xtext v2.0.1

I have defined a grammar that uses Xbase.
When using the generated editor and the proposal feature at a place where an Xbase expression is expected, I get the following ClassCastException:


java.lang.ClassCastException: my.package.MyScopeProvider cannot be cast to org.eclipse.xtext.xbase.scoping.XbaseScopeProvider
	at org.eclipse.xtext.xbase.ui.contentassist.XbaseProposalProvider.getScopeProvider(XbaseProposalProvider.java:214)

This is true, because the generated MyScopeProvider extends AbstractDeclarativeScopeProvider but not XbaseProposalProvider.



Reproducible: Always

Steps to Reproduce:
1. create a grammar using xbase
2. use the proposal feature of the generated editor
Comment 1 Kai Kreuzer CLA 2011-09-24 16:13:05 EDT
Sorry, the last sentence of course should have read "[...] but not XbaseScopeProvider".
Comment 2 Holger Schill CLA 2011-09-29 03:12:07 EDT
The ScopeProvider of your language should extend XbaseProposalProvider.
After integrating Xbase this step could not be done automatically because your ScopeProvider is a generate ones artefact.
Comment 3 Kai Kreuzer CLA 2011-09-29 15:15:42 EDT
When extending XbaseScopeProvider myself, I get a discouraged access warning (as the according package is only exported to a list of defined friends). Would it be possible to remove this export restriction?
Comment 4 Sebastian Zarnekow CLA 2011-09-29 16:43:39 EDT
The packages are exported as internal since the APIs are not yet carved in stone (changes are possible). We will make them public as soon as we are satisfied with the solution.
Comment 5 Kai Kreuzer CLA 2011-09-29 16:48:13 EDT
Ok, thanks for the clarification!
Comment 6 Karsten Thoms CLA 2017-09-19 17:42:43 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 7 Karsten Thoms CLA 2017-09-19 17:53:50 EDT
Closing all bugs that were set to RESOLVED before Neon.0