Eclipse 在 JavaScript 文件中复制/粘贴时挂起
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3515422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse is hanged on copy/paste in JavaScript files
提问by user417589
I've been running Eclipse Helios 3.6 using the Java/CFEclipse IDEs, and finding some very strange and aggravating errors when trying to edit Javascript files. After the .js file reaches a certain size (~250 lines of code), Eclipse will randomly hang whenever I try to select, copy-paste selections, or save. Clicking after the hang starts will result in the "file edit source ... help" bar being whited out, and clicking again leads to the windows "(not responding)" message displayed in the program header. The hang then goes away after another 5-10 seconds of waiting. This is the case for all JavaScript files I try to edit, although shorter ones don't hang as long and don't bring up the "(not responding)" message.
我一直在使用 Java/CFEclipse IDE 运行 Eclipse Helios 3.6,并在尝试编辑 Javascript 文件时发现了一些非常奇怪和严重的错误。在 .js 文件达到特定大小(约 250 行代码)后,每当我尝试选择、复制粘贴选择或保存时,Eclipse 都会随机挂起。挂起后点击会导致“文件编辑源...帮助”栏变白,再次点击会导致窗口程序标题显示“(无响应)”消息。再等待 5-10 秒后,挂起就会消失。我尝试编辑的所有 JavaScript 文件都是这种情况,尽管较短的文件不会挂那么久,也不会显示“(无响应)”消息。
I've thought it was a problem with the Javascript validation/autocomplete options, and have accordingly turned those off; however, the copy-paste hang problem still persists. I've also tried the Javascript IDE - same problem. Is this a problem with Eclipse Javascript handling, period? Has anyone else gotten errors like these? And if it's a fundamentally Eclipse problem, would anyone be able to suggest a better Javascript/Coldfusion editor?
我认为这是 Javascript 验证/自动完成选项的问题,因此已将其关闭;但是,复制粘贴挂起问题仍然存在。我也试过 Javascript IDE - 同样的问题。这是 Eclipse Javascript 处理的问题吗?有没有其他人遇到过这样的错误?如果这是一个根本的 Eclipse 问题,有人能推荐一个更好的 Javascript/Coldfusion 编辑器吗?
EDIT: For more information, log output from the latest hang:
编辑:有关更多信息,请记录最新挂起的输出:
!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.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.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.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.run(SelectionListenerWithASTManager.java:135)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
回答by Felipe
For me the solution was disable this option...
对我来说,解决方案是禁用此选项...
Preferences/JavaScript/Editor/Typing{When pasting}/Update imports
首选项/JavaScript/编辑器/打字{粘贴时}/更新导入
回答by Mark
Ok, I think I found a brute force solution to this. I went into windows>preferences>javascript>[all sub menus] and just unchecked as many things as I could stomach to uncheck. I did that a couple of weeks ago and it's only hung once since then (I think it was unrelated as I had to force quit after 5 minutes).
好的,我想我找到了一个蛮力解决方案。我进入了 windows>preferences>javascript>[所有子菜单] 并尽可能多地取消选中我可以取消选中的东西。几周前我这样做了,从那以后它只挂了一次(我认为这无关,因为我不得不在 5 分钟后强制退出)。
回答by Paul Verest
First time met as Eclipse hangs on copy/cut for JavaScript files, and https://github.com/Nodeclipse/nodeclipse-1/issues/159
第一次见面,因为Eclipse 挂起 JavaScript 文件的复制/剪切和https://github.com/Nodeclipse/nodeclipse-1/issues/159
Current summary:
当前摘要:
- size matters: big project can cause Eclipse JSDT to freeze (this is old issue as @andreialecu has collected https://github.com/Nodeclipse/nodeclipse-1/issues/159#issuecomment-68098716)
- hammer 100% solution is to remove JsNature for that one project
- more subtle is to disable only some JSDT features
Window>Preferences>JavaScript>Editor>Mark Occurrences
and maybe evenWindow->Preferences->General->Editors->Text Editors->Hyperlinking
- recommended by JSDT maintainers (for further observation): (by @vrubezhny )
- get latest JSDT version
- increase available memory settings
- use resource filters to hide more files in folders like build/dist/bower/vendor (by @ppartida )
- 大小很重要:大项目会导致 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 等文件夹中隐藏更多文件(由 @ppartida 提供)
And generally:
通常:
- pay attention what step you have taken when working with any software.
- experiment with little changes
- 请注意您在使用任何软件时所采取的步骤。
- 尝试一些小的变化
Please add more answers here (the first issue raised Aug 18 '10)
请在此处添加更多答案(第一个问题于 10 年 8 月 18 日提出)