Eclipse syntax highlighting: trying to specify it for a new file extension, and it#39;s not working(Eclipse 语法突出显示:尝试为新文件扩展名指定它,但它不起作用)
问题描述
我正在使用 Eclipse/PHP,刚开始使用 Drupal 7,这需要我使用扩展名为 .test 的 PHP 文件.所以我正在尝试将.test"扩展名添加到 Eclipse 识别为 PHP 的文件列表中.
I'm working with Eclipse/PHP and just starting with Drupal 7, which needs me to use PHP files of extension .test. So I'm trying to add the ".test" extension to the list of files that Eclipse recognises as PHP.
我有两种方法:(1)通过在 Preferences-General-Editors-File Associations 中指定它,以及(2)通过在 Preferences-General-Content Types 中指定.test"(如 如何手动指定特定扩展的语法高亮在 Eclipse 中?).
I've done this two ways: (1) By specifying it in Preferences-General-Editors-File Associations, and (2) By specifying ".test" in Preferences-General-Content Types (as described in How to manually specify syntax highlighting for a specific extension in Eclipse?).
问题是,什么也没有发生——我的 xyz.test 文件在 PHP 编辑器中打开得很好,但没有突出显示语法(是的,文件确实以 <?php 开头).一个明显相同的技术适用于.module"扩展名,但我很久以前就这样做了,我不确定我可能做了什么不同的事情.
The trouble is, nothing happens - my xyz.test file opens just fine with the PHP editor, but no syntax is highlighted (and yes, the file does start with <?php). An apparently identical technique works fine for the ".module" extension, but I did this a long time ago and I'm not sure what I may have done differently.
任何想法表示赞赏.我可能忘记了一些愚蠢的事情.
Any ideas appreciated. I've probably forgotten something stupid.
推荐答案
你只需要从这里启用它
Window > Preferences > General > Content Types > Text > PHP Content Type
然后重新启动.
这篇关于Eclipse 语法突出显示:尝试为新文件扩展名指定它,但它不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Eclipse 语法突出显示:尝试为新文件扩展名指定它,但它不起作用


基础教程推荐
- 大摇大摆的枚举 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 多个组件的复杂布局 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01