Highlighting an "already up to date" document?

Milian Wolff mail at milianw.de
Wed Apr 15 11:24:43 UTC 2009


On Wednesday 15 April 2009, David Nolden wrote:
> Am Mittwoch 15 April 2009 00:24:06 schrieb Nick Shaforostoff:
> > I'm not sure this is related, but custom (non-kate) highlighting indeed
> > doesn't work in some cases: doesn't work when opening file via: ctrl+o,
> > ctrl+alt+o
> > does work when opening file via: project view, ctrl+click (from code)
>
> Are you sure that this is the exact pattern? Because I cannot reproduce it.
> Maybe your build is screwed up as well.
>
> Greetings, david

I just deleted all installed files + kdevduchain and did a fresh install of 
kdevplatform, kdevelop and php. Yet still I can reproduce the problem:

1. Open a file in KDevelop (Cpp or PHP - doesn't matter)
2. Let it be parsed and highlighted
3. close the file
4. reopen the file via quickopen

=> broken, as I have described above

Now close kdevelop with the "broken" file opened and reopen kdevelop with that 
file, i.g. "kdevelop myfile.cpp"

=> still broken

Now close the file, and open it via Ctrl + O (i.e. File->Open):
Tada! It works... At least for Cpp, in PHP not even that is working...

And when I look at the code it sounds reasonable: For example inside the 
cppparsejob.cpp we got this part:

~~~~~~~~~
    if(!parentJob()->needsUpdate()) {
      parentJob()->processDelayedImports();
      kDebug( 9007 ) << "===-- ALREADY UP TO DATE --===> " << parentJob()-
>document().str();
      return;
    }
~~~~~~~~~

Actually highlighting the file is done later in the parsejob. So what _should_ 
happen if we open a file which did not change at all since the last time it was 
parsed? Wouldn't needsUpdate return false and thus the "ALREADY UP TO DATE" 
part kick in? The file would never get highlighted!

-- 
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/20f53b1b/attachment.sig>


More information about the KDevelop-devel mailing list