Eclipse is a powerful development platform written in Java. It comes in various flavors — as a Java Development tool, as a PHP application development platform, among many other variants. Eclipse offers syntax highlighting for source code. But the problem crops up when you use a unconventional file-type for a specific source code. The default syntax highlighting fails.

Let me give you an example. The PHP syntax in .php files in Eclipse PDT are highlighted by default. But some PHP frameworks use .thtml (or .ctp/.inc) files as PHP files. If you open these files in Eclipse PDT, the syntax highlighting fails.

Here is a workaround:
  • Go to Windows » Preferences...
  • Go to General » Content Type » Text » PHP Content Type.
  • In the "File Associations" field, add a new file-association: *.ctp (or *.thtml, as your requirement.)
  • Restart Eclipse.

Tags: Eclipse, Tips, Syntax highlighting


blog comments powered by Disqus