Eclipse语法高亮:尝试指定一个新的文件扩展名,它不工作 [英] Eclipse syntax highlighting: trying to specify it for a new file extension, and it's not working

查看:341
本文介绍了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)通过在首选项 - 通用编辑器 - 文件关联中指定它,以及(2)通过在首选项 - 常规内容类型中指定.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天全站免登陆