16

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

1 Answer 1

28

You only have to enable it from here

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

and do a restart.

3
  • 2
    Thanks, problem solved. The bit I'd stupidly forgotten was to do the restart!
    – xgretsch
    Commented Apr 2, 2011 at 16:45
  • 2
    Thanks, wonderful. No need for a restart on Indigo. Just close and re-open the file.
    – Basil Musa
    Commented Feb 11, 2012 at 14:43
  • I had to restart on Kepler.
    – pvorb
    Commented Apr 30, 2014 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.