Bug 359942

Summary: Files ui_CLASSNAME.h generated during building are not parsed and as result their members are not highlighted properly
Product: [Applications] kdevelop Reporter: Piotr Mierzwinski <piotr.mierzwinski>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: piotr.mierzwinski
Priority: NOR    
Version First Reported In: 4.90.91   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: kdevelop_libclang_crashes_20160229 KDEV_CLANG_DISPLAY_DIAGS=1

Description Piotr Mierzwinski 2016-03-01 00:29:27 UTC
Before running KDevelop I exported variable "KDEV_CLANG_DISPLAY_DIAGS=1" and removed kdevduchain cache. In attached file I put the output generated by KDevelop just after loading when parsing finished.

When you open attached text file you will be able to notice that on end there are errors referring to not existing files. Example:
/media/piotrek/FreeAgent/linux_containers/kubuntu_15.10/home/piotrek/Projekty/Qt/qtcmd_work/qtcmd_git/qtcmd2/libs/widgets/multiprogressdialog.h:22:10: fatal error: 'ui_multiprogressdlg.h' file not found
/media/piotrek/FreeAgent/linux_containers/kubuntu_15.10/home/piotrek/Projekty/Qt/qtcmd_work/qtcmd_git/qtcmd2/libs/widgets/mediacontrolwidget.h:22:10: fatal error: 'ui_mediacontrolwidgetgui.h'file not found

This is because both of them will be created during compilation/building the project. In the project there is a class (header file) where such file is included and class inherits by class located in ui_CLASSNAME.h.

For example I have such file multiprogressdialog.h contains:
#include "ui_multiprogressdlg.h"
#include <QDialog>

class MultiProgressDialog : public QDialog, Ui::MultiProgressDlg
{
...
}
whilst:
      Ui::MultiProgressDlg is located in ui_multiprogressdlg.h

In MultiProgressDialog I'm using members from MultiProgressDlg. Unfortunately all of these members are not parsed, and as a result not highlighted. As far as remember in KDevelop 4.7.x when project has been rebuild then all of these members were parsed and properly highlighted.

Note.
Above convention is used in Qt4 projects. I'm not aware whether the same is used in Qt5 projects.

Reproducible: Always


Actual Results:  
Members from ui_* header generated during project building are not parsed at all

Expected Results:  
Members from ui_* header generated during project building should be parsed

Tested with KDevelop and KDevplatform cloned at February 28th, 2016 after 10pm (branch 5.0).
Comment 1 Piotr Mierzwinski 2016-03-01 00:33:19 UTC
Created attachment 97616 [details]
kdevelop_libclang_crashes_20160229 KDEV_CLANG_DISPLAY_DIAGS=1
Comment 2 Kevin Funk 2016-03-01 06:15:08 UTC
Does it find the includes after you've built the project once? Note, that this is inevitable, the ui_CLASSNAME.h files are only built when you build the project (as you've noted).
Comment 3 Piotr Mierzwinski 2016-03-01 18:12:53 UTC
Project is building without errors. Includes (ui_CLASSNAME.h) are generated during building, probably on begin.
I understand that error what I noticed is inevitable, but the problem is that all of these files are not reparsed later. It happened in KDevelop 4.7.x. For me it looks like regression.
Comment 4 Piotr Mierzwinski 2021-01-26 18:39:28 UTC
Currently such files are present not in project scope, because in build directory, and more detailed in: ..._autogen/include.
After opening such file highlighting works correctly.