Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我通常用它的默认编辑器打开一个文件。因此 .php 文件在默认的 PHP 编辑器中打开,并被视为 PHP 文件。
但是,我的 PHP 文件中的代码通常包含很多 JS 或 HTML。在这些情况下,最好使用 JS 或 HTML 编辑器打开此类 PHP 文件。现在,这很痛苦,因为我必须单击Open With -> Other然后选择 JS 或 HTML 编辑器。
Open With -> Other
有没有办法将 JS 或 HTML 编辑器作为选项添加到Open With菜单中?
Open With
尝试将 PHP 文件类型添加到内容类型。进入 Eclipse 首选项General > Content Types
General > Content Types
JavaScript Source File在内容类型中选择,然后,
JavaScript Source File
在File associations单击Add并添加*.php如下:
File associations
Add
*.php
然后在 php 文件的打开方式菜单中,JS 编辑器应该开始显示如下: