I have just started using Eclipse PDT, and I have a similar problem to that which is described in How do I suppress warnings in Eclipse for PHP?
I have just pointed Eclipse to look at a project that was built with a different IDE. In that project there are many HTML files that are parsed as PHP by Apache.
I am getting many Eclipse validation errors showing up in my Problems Window.
However, I suspect that the only reason why Eclipse thinks that they are errors is because it is thinking that those files are HTML. They do have the .html extension after all. Bless it.
I am reluctant to change the validation settings to suppress the errors, because it seems like it is not really tackling the issue, but just putting a plaster over it.
I have already followed the suggestion here and drilled down to General -> Editors -> File Associations and associated PHP editor to be the default editor associated with .htm and .html file extensions. (And then restarted Eclipse). But, that has had no effect.
So I'd appreciate it if someone could let me know how to tell Eclipse to validate .htm files as PHP.
Also, just for interest, which piece of the Eclipse framework is responsible doing the actual validation?
You should go to in your eclipse preferences to General -> Editors -> File Associations as you did and then click on "Content Types":
and add *.htm as PHP Content Type
P.S. The method works for Eclipse 3.7.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With