Highlighting an "already up to date" document?

Milian Wolff mail at milianw.de
Tue Apr 14 22:03:28 UTC 2009


This is imo mainly targeted at David:

How do you highlight documents which are already up 2 date? In PHP we have 
(imo copied from CPP):

~~~~~~~~~~~~
void ParseJob::run()
{
  ...
  
    {
        DUChainReadLocker lock(DUChain::lock());
        bool needsUpdate = true;
        foreach(const ParsingEnvironmentFilePointer &file, DUChain::self()-
>allEnvironmentFiles(document())) {
            if (file->needsUpdate()) {
                needsUpdate = true;
                break;
            } else {
                needsUpdate = false;
            }
        }
        if (!(minimumFeatures() & TopDUContext::ForceUpdate) && !needsUpdate) 
{
            kDebug() << "Already up to date" << document().str();
            return;
        }
    }
   ...
   // actual parsing, duchain building and stuff
  
        if (!abortRequested() && editor.smart()) {
            if (php() && php()->codeHighlighting()) {
                php()->codeHighlighting()->highlightDUChain(chain);
            }
        }

  // more suff
}
~~~~~~~~~~~~~~~~~~~

Simply copying (and adapting) the last part of the snippet into the "already 
up to date" part does not work, I'm afraid... And I'm actually a bit lost 
since in the  CPP plugin I can't see why it should work (yet it does seem to 
work?), since - theoretically - it should return before doing the highlighting 
when nothing needs to be updated...

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090415/6b74b70b/attachment.sig>


More information about the KDevelop-devel mailing list