简体   繁体   English

Eclipse 2020-06 Javascript - 语法高亮不起作用

[英]Eclipse 2020-06 Javascript - Syntax Hightlighting not working

after updating my Eclipse IDE to the actual 2020-06 version the syntax highlighting for JavaScript does not work any more.将我的 Eclipse IDE 更新到实际的 2020-06 版本后,JavaScript 的语法突出显示不再起作用。

Is this a known/common problem and how can I fix this?这是一个已知/常见问题,我该如何解决?

After spending most of a day futzing with it, including installing a new instance of Eclipse PDT, I found that I could fix it simply by adding *.js to the File Associations preference page and setting its default to "Generic Text Editor".在花了一天的大部分时间来处理它之后,包括安装 Eclipse PDT 的新实例后,我发现我可以通过将*.js添加到文件关联首选项页面并将其默认设置为“通用文本编辑器”来修复它。

Per the Eclipse Bugzilla Report :根据Eclipse Bugzilla 报告

Standalone JS Editor is not provided anymore.不再提供独立的 JS 编辑器。

To work with JavaScript/TypeScript projects users may install JS [1] or JEE [2] EPP packages, WildWebDeveloper [3] or other products.要使用 JavaScript/TypeScript 项目,用户可以安装 JS [1] 或 JEE [2] EPP 包、WildWebDeveloper [3] 或其他产品。

[1] https://www.eclipse.org/downloads/packages/release/2020-06/r/eclipse-ide-web-and-javascript-developers [1] https://www.eclipse.org/downloads/packages/release/2020-06/r/eclipse-ide-web-and-javascript-developers

[2] https://www.eclipse.org/downloads/packages/release/2020-06/r/eclipse-ide-enterprise-java-developers [2] https://www.eclipse.org/downloads/packages/release/2020-06/r/eclipse-ide-enterprise-java-developers

[3] https://marketplace.eclipse.org/content/eclipse-wild-web-developer-html-css-javascript-typescript-nodejs-angular-json-yaml [3] https://marketplace.eclipse.org/content/eclipse-wild-web-developer-html-css-javascript-typescript-nodejs-angular-json-yaml

Basically this means that the Eclipse JavaScript Development Tools (JSDT) is no longer supported.基本上这意味着不再支持 Eclipse JavaScript 开发工具 (JSDT)。

It could just be me, but [1] seems to be a pretty stripped-down version of Eclipse.可能只是我,但 [1] 似乎是 Eclipse 的精简版。 It doesn't even include Package Explorer, which baffles me.它甚至不包括 Package Explorer,这让我感到困惑。 [2] is a bit better in my opinion, at least having Package Explorer. [2] 在我看来要好一些,至少有 Package Explorer。 (I do love Package Explorer ) However, I'm not really interested in installing a new version of Eclipse when the way [1] and [2] implement JavaScript support is through [3] Wild Web Developer ("WWD") anyway. (I do love Package Explorer ) However, I'm not really interested in installing a new version of Eclipse when the way [1] and [2] implement JavaScript support is through [3] Wild Web Developer ("WWD") anyway. (You don't have to follow that link for [3]; you can find it in the Eclipse Marketplace just fine. Also, you'll have to reopen any JavaScript files you have open for the update to work.) (您不必点击 [3] 的链接;您可以在 Eclipse 市场中找到它。此外,您必须重新打开您打开的所有 JavaScript 文件才能使更新正常工作。)

I added WWD through the Eclipse Marketplace on my Windows x64 version of Eclipse IDE for Java Developers, 2020-06. I added WWD through the Eclipse Marketplace on my Windows x64 version of Eclipse IDE for Java Developers, 2020-06. I guess it works, but it sure doesn't integrate like JSDT did.我想它可以工作,但它肯定不会像 JSDT 那样集成。

I'm not thrilled with WWD since the first thing I tried to do is comment a line in JavaScript using Ctrl + / and it summons a dropdown of keyword and available function choices.我对 WWD 并不感到兴奋,因为我尝试做的第一件事是使用Ctrl + /在 JavaScript 中评论一行,它会召唤一个关键字下拉菜单和可用的 function 选项。 Ctrl + . Ctrl + does the same thing, and feels more appropriate, so what's the deal?做同样的事情,并且感觉更合适,所以有什么关系? Want to change the keyboard shortcuts?想要更改键盘快捷键? Too bad.太糟糕了。 There's nothing under the Keys preference that has anything to do with TextMate/WWD actions. Keys 首选项下没有任何内容与 TextMate/WWD 操作有关。

Want to change the syntax coloring?想要更改语法着色? Better love what you're given.更好地爱你得到的东西。 There is no Syntax Coloring section or anything like it.没有语法着色部分或类似的东西。 There's a TextMate set of preferences, but it seems like anything regarding Theme doesn't actually work.有一组 TextMate 首选项,但似乎有关 Theme 的任何内容实际上都不起作用。 Is it because I use DevStyle and the Darkest Dark theme?是因为我使用 DevStyle 和 Darkest Dark 主题吗? Who knows.谁知道。

There's only one WWD preference (XML), which does nothing but tell you "See 'XML Catalogs' for XML catalogs preferences".只有一个 WWD 首选项 (XML),它只会告诉您“请参阅‘XML 目录’了解 XML 目录首选项”。 Thanks?谢谢? It's also version 0.10.0.etc, which feels like we're being forced to test it.它也是 0.10.0.etc 版本,感觉就像我们被迫对其进行测试。 Overall I'm pretty disappointed, especially since Eclipse just automatically upgraded itself from 2020-03 to 2020-06 and now I'm stuck with this.总的来说,我很失望,特别是因为 Eclipse 刚刚从 2020 年 3 月自动升级到 2020 年 6 月,现在我被困住了。 Boo to you on this move, Eclipse在这一举动中向你嘘声,Eclipse

This is how I fixed it:这就是我修复它的方法:

  1. Install "Eclipse web developer tools 3.20" from Eclipse marketplace从 Eclipse 市场安装“Eclipse web 开发人员工具 3.20”
  2. Restart重新开始
  3. Open a JS file.打开一个 JS 文件。 Right-click on line number > Switch to theme > Eclipse light.右击行号 > 切换到主题 > Eclipse 灯。

Done.完毕。

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

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