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

Bug 500241

Summary: JS editor cannot parser ionic js frmework in js editor(neon version), error is org.eclipse.wst.jsdt.internal.core.dom.binding.FunctionBinding cannot be cast to org.eclipse.wst.jsdt.core.dom.IVariableBinding
Product: [WebTools] JSDT Reporter: gongping gongping <chengongping>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: RESOLVED DUPLICATE QA Contact: Victor Rubezhny <vrubezhny>
Severity: critical    
Priority: P3    
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description gongping gongping CLA 2016-08-24 23:12:32 EDT

    
Comment 1 gongping gongping CLA 2016-08-24 23:16:08 EDT
JS editor can not parser follow JS file:(ionic.js)
https://github.com/driftyco/ionic/releases
Comment 2 gongping gongping CLA 2016-08-24 23:17:16 EDT
!MESSAGE An internal error occurred during: "Requesting JavaScript AST from selection".
!STACK 0
java.lang.ClassCastException: org.eclipse.wst.jsdt.internal.core.dom.binding.FunctionBinding cannot be cast to org.eclipse.wst.jsdt.core.dom.IVariableBinding
	at org.eclipse.wst.jsdt.core.dom.BindingResolverDom.resolveVariable(BindingResolverDom.java:245)
	at org.eclipse.wst.jsdt.core.dom.VariableDeclaration.resolveBinding(VariableDeclaration.java:198)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:228)
	at org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:224)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement.accept0(VariableDeclarationStatement.java:320)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.Block.accept0(Block.java:136)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.ForStatement.accept0(ForStatement.java:231)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.Block.accept0(Block.java:136)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionDeclaration.accept0(FunctionDeclaration.java:542)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionExpression.accept0(FunctionExpression.java:143)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.ObjectLiteralField.accept0(ObjectLiteralField.java:206)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.ObjectLiteral.accept0(ObjectLiteral.java:125)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.ObjectLiteralField.accept0(ObjectLiteralField.java:206)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.ObjectLiteral.accept0(ObjectLiteral.java:125)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:217)
	at org.eclipse.wst.jsdt.core.dom.Assignment.accept0(Assignment.java:306)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:146)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.Block.accept0(Block.java:136)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionDeclaration.accept0(FunctionDeclaration.java:542)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionExpression.accept0(FunctionExpression.java:143)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:228)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement.accept0(VariableDeclarationStatement.java:320)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.Block.accept0(Block.java:136)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionDeclaration.accept0(FunctionDeclaration.java:542)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionExpression.accept0(FunctionExpression.java:143)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionInvocation.accept0(FunctionInvocation.java:243)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:146)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.Block.accept0(Block.java:136)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionDeclaration.accept0(FunctionDeclaration.java:542)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionExpression.accept0(FunctionExpression.java:143)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.FunctionInvocation.accept0(FunctionInvocation.java:243)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2473)
	at org.eclipse.wst.jsdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:146)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2499)
	at org.eclipse.wst.jsdt.core.dom.JavaScriptUnit.accept0(JavaScriptUnit.java:242)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2426)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.perform(OccurrencesFinder.java:92)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:2876)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor$5.selectionChanged(JavaEditor.java:2905)
	at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:158)
	at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:135)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 3 Carl Anderson CLA 2016-08-25 13:39:01 EDT
Moving to JSDT.  However, we need the exact setup in which this is occurring in order to reproduce/solve the issue- is this Luna? Mars? Neon?  One of the sub-releases of those?  Are you using the Java EE EPP?  Or how did you install JSDT?
Comment 4 gongping gongping CLA 2016-08-25 23:12:24 EDT
I used eclipse neon(https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/neonr).

I used eclipse neon (https://www.eclipse.org/downloads/packages/eclipse-ide-javascript-and-web-developers/neonr)


bug error:

!MESSAGE An internal error occurred during: "Requesting JavaScript AST from selection".
!STACK 0
java.lang.ClassCastException: org.eclipse.wst.jsdt.internal.core.dom.binding.FunctionBinding cannot be cast to org.eclipse.wst.jsdt.core.dom.IVariableBinding
	at org.eclipse.wst.jsdt.core.dom.BindingResolverDom.resolveVariable(BindingResolverDom.java:245)
	at org.eclipse.wst.jsdt.core.dom.VariableDeclaration.resolveBinding(VariableDeclaration.java:198)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:228)
	at
Comment 5 Victor Rubezhny CLA 2016-09-19 18:53:44 EDT

*** This bug has been marked as a duplicate of bug 496749 ***