Enable C++ editor (and syntax highlighting) for *.tpp files in Eclipse

This article shortly describes how to set up the correct editor (+ correct syntax highlighting) for C++ template implementation files (extension: tpp) in Eclipse.

Syntax highlighting

Go to Window -> Preferences, then navigate to General -> Content Types. In the tree view on the right, go to Text -> C Source File -> C++ Source File -> C++ Header File and press Add… As Content Type enter *.tpp.

Do not close the preferences, yet.

File association

In Preferences, open General -> Editors -> File Associations. Press Add… and, as File Type, enter *.tpp . The editors list view at the bottom should contain the C/C++ Editor and Text Editor.

Acknowledgement

Thanks to JohnP@stackoverflow for describing this solution.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box