用户登录
用户注册

分享至

使 Eclipse 查看不同的文件扩展名作为 PHP

  • 作者: 霜霜她大姨妈
  • 来源: 51数据库
  • 2023-01-14

问题描述

我有几个文件扩展名,如 .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.

软件
前端设计
程序设计
Java相关