Eclipse 语法突出显示:尝试为新文件扩展名指定它,但它不起作用 [英] Eclipse syntax highlighting: trying to specify it for a new file extension, and it's not working

查看:42
本文介绍了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 语法突出显示:尝试为新文件扩展名指定它,但它不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆