Making Eclipse view different file extensions as PHP(使 Eclipse 查看不同的文件扩展名作为 PHP)
问题描述
我有几个文件扩展名,如 .module,我希望 Eclipse 将其理解为 PHP - 所以我获得了与我想要的相同的语法突出显示、代码完成等功能我正在编辑一个 .php 文件.我该怎么做?
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?
我去了 Window >> Preferences >> General >> File Associations 并将 *.module 添加到文件类型列表中.当我点击 *.module 时,它现在显示关联的编辑器是 PHP 编辑器和文本编辑器.
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.
但是,当我打开 *.module 文件进行编辑时,它给了我一条错误消息:
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.
我做错了什么?
已修复:重新启动 Eclipse,现在它可以工作了.
fixed: restarted Eclipse, and now it works.
推荐答案
前往 Window -> Preferences.深入到常规 -> 编辑器 -> 文件关联.从这里您可以添加您的扩展(例如,*.module)并将它们与您首选的 PHP 编辑器相关联.
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.
然后重新启动 Eclipse 以使更改生效.
Then restart Eclipse for the change to take effect.
这篇关于使 Eclipse 查看不同的文件扩展名作为 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使 Eclipse 查看不同的文件扩展名作为 PHP
基础教程推荐
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 存储 20 位数字的数据类型 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
