TeamCity Plugin Development Help
 

Extending Highlighting for Web diff view

Edit page Last modified: 23 April 2019

TeamCity uses JHighlight library to render the code on Difference Viewer page. Essentially what JHighlight is doing is it takes plain source code, recognizes the language by extension, parses it, and in case of success renders the HTML output where the tokens are highlighted according to the specified settings. Unfortunately JHighlight supports relatively small subset of languages out-of-the-box (major ones like Java, C++, XML, and several more). Here we'd like to present you a HOWTO on adding the support for more languages.

As an example we are implementing a highlighting for properties files, like this one:

The implementation consists of the following steps: