Eclipse在JavaScript文件中复制/粘贴时被挂起

时间:2010-08-18 18:33:06

标签: javascript eclipse copy-paste jsdt

我一直在使用Java / CFEclipse IDE运行Eclipse Helios 3.6,并在尝试编辑Javascript文件时发现一些非常奇怪和加重的错误。在.js文件达到一定大小(大约250行代码)之后,只要我尝试选择,复制粘贴选择或保存,Eclipse就会随机挂起。在挂起开始后单击将导致“文件编辑源...帮助”栏被取消,并再次单击导致程序标题中显示的窗口“(未响应)”消息。在等待5-10秒之后,挂起就会消失。这是我尝试编辑的所有JavaScript文件的情况,尽管较短的文件不会挂起那么久并且不会显示“(没有响应)”消息。

我认为这是Javascript验证/自动填充选项的问题,并因此关闭了它们;但是,复制粘贴挂起问题仍然存在。我也尝试过Javascript IDE - 同样的问题。这是Eclipse Javascript处理的一个问题,期间?有没有其他人得到这样的错误?如果它是一个基本的Eclipse问题,是否有人能够建议一个更好的Javascript / Coldfusion编辑器?

编辑:有关更多信息,请记录最新挂起的输出:

!ENTRY org.eclipse.wst.jsdt.ui 4 2 2010-08-18 11:25:54.699
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.wst.jsdt.ui".
!STACK 0
java.lang.NullPointerException
    at org.eclipse.wst.jsdt.internal.compiler.lookup.ArrayBinding.getExactMethod(ArrayBinding.java:233)
    at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.findExactMethod(Scope.java:401)
    at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getMethod(Scope.java:1813)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:307)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.resolve(Expression.java:477)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Block.resolve(Block.java:89)
    at org.eclipse.wst.jsdt.internal.compiler.ast.ForStatement.resolve(ForStatement.java:280)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Block.resolve(Block.java:89)
    at org.eclipse.wst.jsdt.internal.compiler.ast.ForStatement.resolve(ForStatement.java:280)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Block.resolve(Block.java:89)
    at org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:191)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:337)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:139)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:291)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:362)
    at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:394)
    at org.eclipse.wst.jsdt.core.dom.JavaScriptUnitResolver.resolve(JavaScriptUnitResolver.java:859)
    at org.eclipse.wst.jsdt.core.dom.JavaScriptUnitResolver.resolve(JavaScriptUnitResolver.java:527)
    at org.eclipse.wst.jsdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:862)
    at org.eclipse.wst.jsdt.core.dom.ASTParser.createAST(ASTParser.java:647)
    at org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:581)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:574)
    at org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:509)
    at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:150)
    at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:135)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

!ENTRY org.eclipse.wst.jsdt.ui 4 0 2010-08-18 11:25:54.824
!MESSAGE Error in JSDT Core during AST creation
!STACK 0
java.lang.NullPointerException
    at org.eclipse.wst.jsdt.internal.compiler.lookup.ArrayBinding.getExactMethod(ArrayBinding.java:233)
    at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.findExactMethod(Scope.java:401)
    at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getMethod(Scope.java:1813)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:307)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Expression.resolve(Expression.java:477)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Block.resolve(Block.java:89)
    at org.eclipse.wst.jsdt.internal.compiler.ast.ForStatement.resolve(ForStatement.java:280)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Block.resolve(Block.java:89)
    at org.eclipse.wst.jsdt.internal.compiler.ast.ForStatement.resolve(ForStatement.java:280)
    at org.eclipse.wst.jsdt.internal.compiler.ast.Block.resolve(Block.java:89)
    at org.eclipse.wst.jsdt.internal.compiler.ast.IfStatement.resolve(IfStatement.java:191)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:337)
    at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:139)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:291)
    at org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:362)
    at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:394)
    at org.eclipse.wst.jsdt.core.dom.JavaScriptUnitResolver.resolve(JavaScriptUnitResolver.java:859)
    at org.eclipse.wst.jsdt.core.dom.JavaScriptUnitResolver.resolve(JavaScriptUnitResolver.java:527)
    at org.eclipse.wst.jsdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:862)
    at org.eclipse.wst.jsdt.core.dom.ASTParser.createAST(ASTParser.java:647)
    at org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:581)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:574)
    at org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:509)
    at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:150)
    at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:135)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

3 个答案:

答案 0 :(得分:14)

对我来说,解决方案是禁用此选项......

偏好设置/ JavaScript /编辑器/键入{粘贴时} /更新导入

答案 1 :(得分:7)

好吧,我想我找到了一个强力解决方案。我进入了Windows>首选项> javascript> [所有子菜单],并且只是取消选中了我可以忍受的许多东西取消选中。几个星期前我就这样做了,从那时起它只挂了一次(我认为这是不相关的,因为我必须在5分钟后强制退出)。

答案 2 :(得分:3)

首次见面为Eclipse hangs on copy/cut for JavaScript fileshttps://github.com/Nodeclipse/nodeclipse-1/issues/159

当前摘要:

  • 大小很重要:大项目会导致Eclipse JSDT冻结(这是旧问题,因为@andreialecu收集了https://github.com/Nodeclipse/nodeclipse-1/issues/159#issuecomment-68098716
  • 锤子100%解决方案是删除该项目的JsNature
  • 更微妙的是只禁用一些JSDT功能
    Window>Preferences>JavaScript>Editor>Mark Occurrences 甚至可能Window->Preferences->General->Editors->Text Editors->Hyperlinking
  • JSDT维护者推荐(进一步观察):( @vrubezhny)
    • 获取最新的JSDT版本
    • 增加可用内存设置
  • 使用资源过滤器隐藏文件夹中的更多文件,例如build / dist / bower / vendor(by @ppartida)

一般而言:

  • 注意使用任何软件时采取的步骤。
  • 进行少量更改的实验

请在此处添加更多答案 (2010年8月18日提出的第一个问题)