]
Victor Rubezhny reassigned ERT-191:
-----------------------------------
Assignee: Victor Rubezhny
ClassCastException from KeywordCompletionProposalComputer &
IdentifierCompletionProposalComputer witn Neon M7 [EBZ#493393]
--------------------------------------------------------------------------------------------------------------------------
Key: ERT-191
URL:
https://issues.jboss.org/browse/ERT-191
Project: Eclipse Release Train
Issue Type: Task
Components: JSDT
Reporter: Friendly Jira Robot
Assignee: Victor Rubezhny
Labels: General, bzira
The Eclipse Neon M7 provides KeywordCompletionProposalComputer &
IdentifierCompletionProposalComputer classes which doesn't use "instanceof"
to check that the given ContentAssistInvocationContext is a
JavaContentAssistInvocationContext:
```
public class IdentifierCompletionProposalComputer implements
IJavaCompletionProposalComputer {
public List computeCompletionProposals(ContentAssistInvocationContext context,
IProgressMonitor monitor) {
JavaContentAssistInvocationContext javaContext = (JavaContentAssistInvocationContext)
context;
```
It's a big problem for typescript.java which is based on JSDT and which defines
TypeScriptContentAssistInvocationContext (see issue at
https://github.com/angelozerr/typescript.java/issues/56)
So with oEclipse Neon M7, when I do completion with my TypeScriptEditor based on JSDT
Edit, I have a popup error with this error
```
java.lang.ClassCastException:
ts.eclipse.ide.jsdt.internal.ui.editor.contentassist.TypeScriptContentAssistInvocationContext
cannot be cast to org.eclipse.wst.jsdt.ui.text.java.JavaContentAssistInvocationContext
at
org.eclipse.wst.jsdt.internal.ui.text.java.KeywordCompletionProposalComputer.computeCompletionProposals(KeywordCompletionProposalComputer.java:45)
```
and
```
java.lang.ClassCastException:
ts.eclipse.ide.jsdt.internal.ui.editor.contentassist.TypeScriptContentAssistInvocationContext
cannot be cast to org.eclipse.wst.jsdt.ui.text.java.JavaContentAssistInvocationContext
at
org.eclipse.wst.jsdt.internal.ui.text.java.IdentifierCompletionProposalComputer.computeCompletionProposals(IdentifierCompletionProposalComputer.java:49)
```
It should b every cool if you could check that ContentAssistInvocationContext is an
instanceof JavaContentAssistInvocationContext:
```
public class IdentifierCompletionProposalComputer implements
IJavaCompletionProposalComputer {
public List computeCompletionProposals(ContentAssistInvocationContext context,
IProgressMonitor monitor) {
if (context instanceof JavaContentAssistInvocationContext) {
JavaContentAssistInvocationContext javaContext = (JavaContentAssistInvocationContext)
context;
```
for :
*
http://git.eclipse.org/c/jsdt/webtools.jsdt.git/tree/bundles/org.eclipse....
*
http://git.eclipse.org/c/jsdt/webtools.jsdt.git/tree/bundles/org.eclipse....
For your infomration, I have created my own TypeScriptContentAssistInvocationContext,
because I need IResource and I don't use IJavaCompilationUnit. If
http://git.eclipse.org/c/jsdt/webtools.jsdt.git/tree/bundles/org.eclipse....
could just define a getter for the Editor, I think I could use directly
JavaContentAssistInvocationContext to retrieve my IResource from the getEditor getter.
Hope this issue will be able to fixed for Neon release, otherwise typescript.java will
not work with Eclipse Neon release -( (we must desactivate the whole JSDT completions to
avoid having those 2 popup errors)
Many thanks for your help!