Review Request 128480: fix clang plugin highlighting screwup

Milian Wolff mail at milianw.de
Wed Jul 20 09:56:39 UTC 2016


On Wednesday, July 20, 2016 11:47:35 AM CEST David Nolden wrote:
> Since reviewboard is currently somehow broken, I'm writing this by e-mail.
> 
> While reviewing the clang duchain code, I found some severe problems which
> are probably the main reason for these glitches to appear.
> 
> The core of the problem is, that the code assumes that for "unmodifed"
> files, it doesn't need to do any revision mapping, which is wrong. When you
> save a file in revision 10, the revision will still be 10 after saving, and
> the mapping still needs to be performed in the same way.
> 
> Some of these things were done on-demand with the foreground lock in the
> old cpp plugin, but that isn't possible straightforwardly any more, because
> the "unsaved files" need to be prepared _before_ parsing now.
> 
> So in principle, what needs to be done is:
> * Before parsing, either in foreground or with the foreground lock, the
> text of _all_ open documents need to be read, and the exact corresponding
> document revisions need to be locked and stored in the parse session. When
> the extracted text is used for parsing, then this can be used for
> glitch-free highlighting and navigation.

We have the UnsavedFile for that, which already gets all open documents 
contents. Would be awesome if we can really just add the locked revision there 
to fix the stuff :) Sven, could you try it out?

-- 
Milian Wolff
mail at milianw.de
http://milianw.de


More information about the KDevelop-devel mailing list