Eclipse在JavaScript文件中复制/粘贴时卡住了。

17
我一直在使用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)

我注意到在关闭自动完成之前,提到了“AST”出现了卡顿。我想知道这是否可以缩小罪犯的范围? - grantwparks
你应该禁用“标记出现”。在这里找到我的答案:https://dev59.com/mmIj5IYBdhLWcg3wUjkX#24282723 - Biman Tripathy
3个回答

15

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

首选项/JavaScript/编辑器/打字{粘贴时}/更新导入


谢谢这个答案,复制时挂起非常令人讨厌。 - ossys
对我有用。谢谢。 - manikanta

7

好的,我想我找到了一个强制解决方案。 我进入windows>preferences>javascript>[所有子菜单],然后尽可能地取消选中尽可能多的内容。我在几周前这样做过,自那以来只有一次随机卡顿(我认为这与我不得不强制退出无关,因为已经过去5分钟)。


3

第一次遇见时,是关于 Eclipse 在复制/剪切 JavaScript 文件时卡死https://github.com/Nodeclipse/nodeclipse-1/issues/159

目前的总结:

  • 大小问题:大型项目会导致 Eclipse JSDT 冻结(如 @andreialecu 收集的 https://github.com/Nodeclipse/nodeclipse-1/issues/159#issuecomment-68098716
  • 权宜之计是为该项目删除 JsNature
  • 更微妙的方法是禁用部分 JSDT 功能
    Window>Preferences>JavaScript>Editor>Mark Occurrences 甚至还可以禁用Window->Preferences->General->Editors->Text Editors->Hyperlinking
  • JSDT 维护者建议(供进一步观察):(by @vrubezhny)
    • 获取最新的 JSDT 版本
    • 增加可用内存设置
  • 使用资源过滤器来隐藏文件夹中的更多文件,如 build/dist/bower/vendor(by @ppartida)

总的来说:

  • 使用任何软件时,请注意您所采取的步骤。
  • 尝试进行小的更改。

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


在我的情况下(在 OS X 上的 Eclipse 4.5),在“窗口”->“首选项”->“常规”->“编辑器”->“文本编辑器”->“超链接”中,只取消选中(JavaScript元素;命令;HTML编辑器)就可以解决问题。 - Edoardo Panfili

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接