Community
Participate
Working Groups
Build Identifier: 2.2.1 When using new PDT 2.2 with Helios, it becomes impossible to set up a new default editor for files whose content-type is associated with PHP. As PHP Content type now includes ".tpl" extension, it's for an example not possible any more to embed a different default editor, which was a common practice on tools driving their own template system. All "locked by content-type PHP" extensions seem to be concerned (*.inc, *.php, ..., *.tpl). Reproducible: Always Steps to Reproduce: 1.Open "File Association" tab from "Window/Preferences/General/Editors/" 2.Add a file type association by clicking "Add", defining "*.tpl" or "*.php". 3.On the "Associated editors" panel, click "Add" and choose your own internal editor, for an example HTML editor or any other editor that should look different. 4.Mark the added editor as default one, by clicking "Default". A string "Default" will be added to signify that the change has been made. 5.Now validate preferences and try to open a file that matches the extension pattern (*.tpl or *.php) using the default editor (automatically used by double cliking from the PHP Explorer view). As you would expect that the default defined editor will be used to open the file, it will happen that the internal defined "PHP Editor" will be used to render the file. The "Default" setting is not honored, you will need to right-click and choose your own editor to render as expected, which is from day to day quite a calamity to use..
Seems indeed linked to behavior of PHP explorer as "Open with default editor" and click opening from standard navigator tab will work fine.
I also came here to report this bug. I encountered it on Windows, and would love to see it fixed. I am guessing it is a similar issue to the one I reported a while back (which was fixed), found here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=270137 . From my debugging, I can tell that the call to EditorUtility.openInEditor in org.eclipse.php.internal.ui.actions.OpenActionUtil returns an EditorPart of type PHPStructuredEditor no matter what you have set as the default editor for the *.php extension. I suspect this is the problem.
yes,I notice org.eclipse.php.internal.ui.actions.OpenActionUtil will get PHPStructuredEditor if the the file's content type is "org.eclipse.php.core.phpsource" after discussing with Roy,we decide to remove tpl from "org.eclipse.php.core.phpsource".
Verified. Closing...