Patch: TODO highlighting in comments

David Nolden zwabel at
Sat Nov 13 17:09:18 UTC 2010

I think it was too early to apply this on master. There are some
severe efficiency problems. First of all, there were some very heavy
QString/QByteArray operations on every single comment encountered
during parsing, which is evil, since we already before spent a lot of
time processing comments. I have somewhat fixed these efficiency
problems by adding an _efficient_ pre-check for the todo keywords
(based on fast IndexedString token comparison).

The other big problem is (as Dmitry already noted) the way the
problems are collected from the top-contexts when the scope goes over
the whole project. There doesn't seem to be a proper updating scheme
(see BackgroundParser::parseJobFinished for a possible entry point
into updating), and the whole TopDUContexts of the whole project are
processed whenever the items are collected.

As first, it has to be made sure that the problem-reporter doesn't do
any significant work at all when the problem-report view is not
visible. Then, it needs to be made sure that, when one parse-job has
finished, only the problems from the corresponding TopDUContext are
updated, and all other problems remain untouched.

For the slightly farrer future, it would be better to not use the
duchain directly, for example to build the TODO lists, but to transfer
the TODOs of the whole project into a separate ItemRepository, where
they can be stored and accessed persistently and efficiently (this
repository would need to be partially updated only after each

Greetings, David

More information about the KDevelop-devel mailing list