I have a problem with Aptana file/editor associations. I have installed PDT into Aptana. In a directory I have three (and more) PHP files. When I open the first Aptana opens the “PHP Editor”, when I open the second I get an Error (“Unsupported content type editor”) and with the third Aptana opens the “PHP Source Editor”. All have the same extension (.php). I want Aptana to open all PHP files with “PHP Editor”. When I explicitly open the files that throw the error with “PHP Editor” I get the same error.
I have activated the PHP perspecive. Content Types > Text > PHP Content Type has *.php (locked), Content Types > Text > PHP Source has *.php (locked), too. In the file associations I have both editors (and two text editors) listed for *.php and “PHP Editor” is the default editor.
The project is a (local) GIT repository. In another project (also a GIT repository) it seams to work (all *.php files are opened in the “PHP Editor”).
Can somebody explain me that “magic” and give me a tip how to solve my problem. I don’t want to switch to another IDE or something like that…
EDIT
Here is how the different files behave:
Open With… Open With… Open With…
file double click PHP Editor PHP Source Editor Default Editor
-------- -------------------- ------------- -------------------- --------------
a.php Error Error PHP Source Editor Error
b.php PHP Editor PHP Editor PHP Source Editor PHP Editor
c.php PHP Source Editor PHP Editor PHP Source Editor PHP Editor
Like described by Sarah Kemp in her answer the different behavior of b.php and c.php is correct. But why can I not open file a.php with the PHP Editor?
EDIT 2
When I look at the file properties, b.php and c.php have the type “File (PHP Content Type)” and a.php has “File (PHP Source)”.
You can set file associations on a per file basis too, it looks like maybe that is your problem since your other repo is working correctly?
Right click on your file in the Project Explorer (this is where I tested) and choose ‘Open With…’ and select the editor you prefer from the sub menu. Once you have selected an editor in this list, Aptana will remember your preference for that file and use it when you double click in future – even if all other file of that type open with something else.
Hope this works for you.