Domanda

In my project I have a series of *.tpl files that I would like Eclipse to interpret as PHP code. I have managed to get syntax highlighting to work properly for these files by adding a *.tpl entry in Preferences -> General -> Editors -> Content Types. However this does not seem to also enable syntax error checking / validation.

So to be clear, I would like Eclipse to show me per-line errors in the editor and also indicate any errors/warnings on the files in the PHP Explorer - for files with a .tpl extension. Currently neither is happening.

I have tried also adding *.tpl to Preferences -> General -> Editors -> File Associations. I have tried pressing F5 in various relevant places, and have tried restarting Eclipse. The folder with the *.tpl files is a subdirectory of a source folder. Other subdirectories of this source folder are working correctly (although they have .php files). I don't know what else to do. Please help!

Thanks!

È stato utile?

Soluzione 2

Well that's bizarre. I just tried to test Ashutosh's example and it worked. After creating a new file test.tpl, all of a sudden all other .tpl files in the project started being parsed/validated properly and all the warning/error icons suddenly appeared.

So this seems like a bug in this version of Eclipse (http://www.zend.com/en/community/pdt/downloads). Hopefully this is a repeatable workaround for anyone else who experiences the problem though!

Thanks very much guys.

Altri suggerimenti

For what it's worth, I tried creating a custom *.guvava and was able to do so by adding *.guvava to Content Types and File Associations. When I opened up a new guvava file after that, I had everything I would have in a java file.

enter image description here

enter image description here

enter image description here

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top