3

I use Eclipse-PDT to work on my PHP projects and find it inconvenient when Eclipse does not recognize my php files that have no extension. Our project contains many cli/bash-style php scripts that have no file-extension (for whatever reason). This results in no code-completion, highlighting, etc for these particular files. It treats them as plain-text.

Is there a way I can mark these particular files as PHP to use the PDT features?

Mike B
  • 31,886
  • 13
  • 87
  • 111

2 Answers2

0

If I remember correctly, you might be able to do something like this :

  • right-click on the file in the Navigator panel -- or the equivalent you are using
  • choose Open with > Other...
  • In the dialog box that pops-up, you should be able to choose the PHP Editor

Next time you'll double-click on that file to open it, it should automatically bge opened using the editor you selected earlier.

But you'll have to do that once for each one of your files, so Eclipse PDT does know for which files which editor it should use...

Pascal MARTIN
  • 395,085
  • 80
  • 655
  • 663
  • That's actually what I would prefer. I'd like to avoid any blanket configuration changes. I'll give it a shot. – Mike B Jan 05 '10 at 23:44
  • 3
    After opening the extensionless file with the PHP Editor I am presented a dialog that states `Unsupported content type in the editor` and it suggests I edit content types in the config menu. Oh well, sounded promising. – Mike B Jan 06 '10 at 15:18
0

A workaround suggested by Swooper (in his case for perl) here suggests to create links to the files with extensions and edit the files in Eclipse through those links.

Not ideal and maybe hard if you have a lot of extensionless files, but it will work.

Community
  • 1
  • 1
Matthijs Wessels
  • 6,530
  • 8
  • 60
  • 103