BUG:Requesting JavaScript AST from selection

用 Eclipse Helios或者Eclipse indigo 编写Javascript函数中出现 return 时。 
错误提示: 
An internal error occurred during: "Requesting JavaScript AST from selection".

java.lang.NullPointerException.

解决方法: 
修改 Mark Occurrences。快捷键:Alt+Shift+O。 
(Window-->Preferences->Javascript-->Editor-->Mark Occurrences) 取消选中该项
问题分析:
英文原文:
 I believe that the problem is in org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(CompilationUnit) method which calls cleanUp() method on CompilationUnitDeclaration (which subsequently cleans up all the references/bindings as well as all the SourceTypeBindings collected). But later (in hover calculation in my case or or in occurrences finder in this issue's stacktrace) those SourceTypeBinding-s are still needed to resolve types, but they (SourceTypeBinding-s) are already cleared by ReconcileWorkingOperation, so they aren't usable anymore.

Not sure would it be a problem if not to call cleanUp() method on unit declaration during reconciling operation (in ReconcileWorkingCopyOperation.makeConsistent() method), but excluding this call in my local workspace helps to prevent this NPE.

So, probably the CompilationUnitDeclaration is not to be cleaned up by reconcile operation (and it's not in case the working copy is not consistent - see ReconcileWorkingCopyOperation.makeConsistent() method source). 

理解:
光标放到某个地方,会出现一个Mark Occurence的类型变量
这个变量需要被ResourceTypeBindings来解析,而这个ResourceTypeBindings又被cleanup清除了
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值