Syntax highlighting within C++ Makro arguments not working

Milian Wolff mail at
Mon Feb 20 22:36:38 GMT 2012

On Monday 20 February 2012 23:30:34 Torbjoern Klatt wrote:
> Hi all,
> recently I realised, that the awesome syntax highlighting of KDevelop is not
> working for arguments of C++ makros.
> E.g. when using Boost.Test with `BOOST_CHECK_EQUAL(one, two)`, `one` and
> `two` are not getting highlighted in any way.
> But everything around this line does fine. Even `one` and `two` used outside
> of the makro call.
> Take this as an working example (except the fact, you don't have the class
> Visit defined):
>   std::string validDateTime( "2012-12-21 21:42:00" );
>   Visit v;
>   BOOST_CHECK_EQUAL( v.getDateTime(), boost::posix_time::not_a_date_time );
>   v.setDateTime( validDateTime );
> But:
> The argument of `BOOST_AUTO_TEST_SUITE(suite_name)` is highlighted, while
> the argument of `BOOST_AUTO_TEST_CASE(case_name)` is not. They are
> separated just by a new line.

Yes this is known and very hard to support due to range-collapses. I.e. the 
preprocesses content is very different from the editor-contents and if we have 
e.g. something that does not actually use the macro-argument such that it can 
be highlighted, it won't be. I can think of most MOC-macros which are empty, 
or I think stuff like

#define foo(x) "x"

foo(x) <-- how should it be highlighted?

> By the way: Why does `kdevelop --verison` not close the bracket after the
> release info of KDE? Looks awkward.

probably a kde bug or one of the package :)
Milian Wolff
mail at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the KDevelop mailing list