使Eclipse查看不同的文件扩展名为PHP [英] Making Eclipse view different file extensions as PHP

查看:264
本文介绍了使Eclipse查看不同的文件扩展名为PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个文件扩展名,如$ code> .module ,我希望被Eclipse理解为PHP - 所以我得到相同的语法突出显示,代码完成, etc功能,因为我正在编辑一个 .php 文件。我如何做到这一点?



我去了窗口>>首选项>>一般>>文件关联,并添加了 * .module 到文件类型列表。当我点击 *。module 时,现在说相关编辑器是PHP编辑器和文本编辑器。



但是,当我打开 *。module 文件进行编辑时,会给我一个错误消息:


编辑器中不支持的内容类型。要
将文件扩展名与
支持的内容类型相关联,请参阅
内容类型首选项页面。


我做错了什么?



修复:重新启动Eclipse,现在可以使用。

解决方案

转到窗口 - >首选项。向下钻取常规 - >编辑器 - >文件关联。从这里您可以添加扩展名(例如* .module)并将其与您首选的PHP编辑器相关联。



然后重新启动Eclipse以使更改生效。 p>

I have several file extensions, like .module, that I would like to be understood by Eclipse to be PHP - so I get the same syntax highlighting, code completion, etc features as I would if I were editing a .php file. How can I do this?

I went to Window >> Preferences >> General >> File Associations and added *.module to the file types list. When I click on *.module, it now says the associated editors are the PHP Editor and the Text editor.

However, when I open the *.module file to edit it, it gives me an error message:

Unsupported content type in editor. To associate a file extension with a supported content type, please see the Content Types Preferences Page.

What am I doing wrong?

fixed: restarted Eclipse, and now it works.

解决方案

Head to Window -> Preferences. Drill down to General -> Editors -> File Associations. From here you can add your extensions (e.g., *.module) and associate them with your preferred PHP editor.

Then restart Eclipse for the change to take effect.

这篇关于使Eclipse查看不同的文件扩展名为PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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