Bug 369194 - Background parser does not reparse other open files after changes
Summary: Background parser does not reparse other open files after changes
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (Clang-based) (show other bugs)
Version: 5.0.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-22 13:21 UTC by Ian H
Modified: 2022-10-31 16:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
"proof" of kdevelop vs filesystem (60.24 KB, image/png)
2016-10-27 08:08 UTC, OlafLostViking
Details
Parser bug video (2.98 MB, video/ogg)
2017-01-05 21:44 UTC, Ian H
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian H 2016-09-22 13:21:56 UTC
After changing a function previously marked private to public, the background parser did not reparse one of my open files which was attempting to call this function until after i made a change to that file.

Reproducible: Always

Steps to Reproduce:
1. create private function (private: void test();) in header file
2. attempt to call test from another open file(should highlight red for declared private)
3.change private function to public

Actual Results:  
function will still be marked red on the file attempting to call it.

Expected Results:  
background parser should reparse all open files and unmark that function call.
Comment 1 Ian H 2016-09-29 20:53:16 UTC
also related to this, the background parser will not reparse a file if it is not the current file when the parser decides to parse it.

If you change a function in the header file or add to it and then quickly switch to the cpp file, it will not reparse that header file until you go back to it again.
Comment 2 OlafLostViking 2016-10-27 08:08:25 UTC
As I _guess_ this could be related, I'll just add my experience to this thread. In my "not so huge" project, the parser sometimes stops parsing at all for certain files (as described in #371018 it's quite slow to start so that I sometimes don't even realise it anymore when it fails). So currently I have the situation that no matter what I change an #include directive to, KDevelop insists it is the old, correct file that is meant. I'll add a screenshot...

This behaviour could explain many other parts where the highlighting isn't working anymore after switching to KDevelop 5 (until now I thought it's a huge mess in my code that the parser simply gave up or so - but here it's pretty obvious).

Restarting KDevelop doesn't help. It starts, takes its 5 seconds or so clang salute (see #369164) and then stays like shown in the following screenshot. Even clearing the DUCHAIN cache by deleting the whole kdevelop .cache directory doesn't work (which irritates me a lot ;-) ).
Comment 3 OlafLostViking 2016-10-27 08:08:55 UTC
Created attachment 101821 [details]
"proof" of kdevelop vs filesystem
Comment 4 OlafLostViking 2016-10-27 12:44:14 UTC
After a long testing session, I found the reason for the behaviour in my case (and some other smaller problems :-/ ) which is probably not related to OP's case. So I created a new bug report: bug #371741
Comment 5 OlafLostViking 2016-10-28 08:39:22 UTC
Sorry for coming back ;-)

But I now have a error-free header file not included anywhere which isn't parsed anymore after some editing (renaming of a class). Deleting the cache won't help either. Just copy/paste the contents to a file2.hpp makes it work again.

Is there something we users can do in such a case to gather more meaningful information for the kdevelop developers despite just crying "Won't work!"?
Comment 6 Kevin Funk 2016-10-28 09:02:30 UTC
Steps to reproduce are always useful. Unfortunately we don't have the time to look at all incoming bug reports immediately, so please bear with us :)

We'll ask for more information when we need it.
Comment 7 Ian H 2017-01-05 21:44:51 UTC
Created attachment 103221 [details]
Parser bug video

Added a video of the bug. In the first part, i show the correct case, what it is supposed to do. the second section i show the bug i'm having with the parser.
Comment 8 Justin Zobel 2022-10-30 00:37:29 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 9 Ian H 2022-10-31 16:21:02 UTC
seems to be fixed