简体   繁体   English

Javascript 在 Eclipse-03 中编辑 - 设置默认编辑器

[英]Javascript editing in Eclipse-03 - set default editor

Having trouble with Javascript file editing after moving to Eclipse 2021-03.移动到 Eclipse 2021-03 后,在编辑 Javascript 文件时遇到问题。

I have seen similar related issues discussed elsewhere, for example: Eclipse 2020-06 Javascript - Syntax Hightlighting not working我在其他地方看到过类似的相关问题,例如: Eclipse 2020-06 Javascript - Syntax Hightlighting not working

The "answer" appears to be to set the default editor to "Generic Text Editor". “答案”似乎是将默认编辑器设置为“通用文本编辑器”。 However the default editor is set to "Text Editor" and this appears to be hard-wired.但是,默认编辑器设置为“文本编辑器”,这似乎是硬连线的。

After installing WDT, there is a Content Type Text->JavaScript Source File.安装 WDT 后,有一个 Content Type Text->JavaScript Source File。 This has Text Editor and Generic Text Editor as the associated editors, and these entries cannot be removed.这具有文本编辑器和通用文本编辑器作为关联的编辑器,并且这些条目不能被删除。 When I click on a.js file in the Project Explorer it opens with Text Editor.当我在 Project Explorer 中单击 a.js 文件时,它会使用文本编辑器打开。

Why is this so hard?为什么这么难? And is there a better JavaScript editor for Eclipse?对于 Eclipse 是否有更好的 JavaScript 编辑器?

Ok, so I figured this out.好的,所以我想通了。 I could just delete the question but maybe someone will be having the same UI blindness that I was experiencing.我可以删除这个问题,但也许有人会遇到与我相同的 UI 失明。

The trick is you have to specify the default from among the current associated editors.诀窍是您必须从当前关联的编辑器中指定默认值。 Go to Preferences -> General -> Editors -> File Associations; Go 到首选项 -> 常规 -> 编辑器 -> 文件关联; then select the editor you want as default and click the default button.然后 select 您想要的默认编辑器并单击默认按钮。 The name of the editor will now have (default) appended to it.编辑器的名称现在将附加(默认)。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM