Eclipse syntax highlighting: trying to specify it for a new file extension, and it's not working

家住魔仙堡 提交于 2020-01-01 04:15:30

问题


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.

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?).

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.


回答1:


You only have to enable it from here

 Window > Preferences > General > Content Types > Text > PHP Content Type

and do a restart.



来源:https://stackoverflow.com/questions/5524366/eclipse-syntax-highlighting-trying-to-specify-it-for-a-new-file-extension-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!