Eclipse中默認的JS編輯器非常慢,尤其在拷貝粘貼代碼時,CPU總是占用很高甚至到100%,也就導致了編輯起來很卡。
這是因為Eclipse中帶的Validate功能導致的,這個雞肋的功能簡直讓人抓狂。
試過在菜單和項目屬性中修改Validation相應的配置項都不起作用,最后發現需要修改項目根目錄下的.project文件才能徹底解決編輯JS文件的卡頓問題。
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>integrate-base-web</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> <triggers>full,incremental,</triggers> <arguments> <dictionary> <key>LaunchConfigHandle</key> <!-- <value><project>/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch</value> --> </dictionary> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> <triggers>full,incremental,</triggers> <arguments> <dictionary> <key>LaunchConfigHandle</key> <!-- <value><project>/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch</value> --> </dictionary> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.m2e.core.maven2Builder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <!-- <nature>org.eclipse.wst.jsdt.core.jsNature</nature> --> </natures> </projectDescription>
上面貼出來的代碼中的注釋部分就是要去掉的Validation配置項部分。
去掉之后整個世界都清凈了。
"原來忍住一段時間不聯系了,就真的不聯系了。"