AddMissingIncludePath dialog for easier fixing of missing includes
AbandonedPublic

Authored by kossebau on Sep 4 2016, 12:38 PM.

Details

Reviewers
mwolff
nicolaih
Group Reviewers
KDevelop
Summary

Instead of opening the project configuration where include paths must be
added manually, the missing include assistant now opens a dialog that is
pre-populated with matching include files from currently open dialogs.

The user can choose one of them, as well as the project path where the
custom include should be added (any ancestor of the compilation unit that
triggered the diagnostic). Also, an external include file can be chosen
instead.

This greatly simplifies setting up include paths for large code bases with
custom build systems.

Diff Detail

Repository
R32 KDevelop
Branch
pub-includes2-dialog
Lint
No Linters Available
Unit
No Unit Test Coverage
nicolaih updated this revision to Diff 6420.Sep 4 2016, 12:38 PM
nicolaih retitled this revision from to AddMissingIncludePath dialog for easier fixing of missing includes.
nicolaih updated this object.
nicolaih edited the test plan for this revision. (Show Details)
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptSep 4 2016, 12:38 PM

D2649 is mostly logically separate, but the two changes conflict textually, and the automatic selection of a project directory which is added in this change only works correctly when D2649 is applied.

mwolff requested changes to this revision.Sep 5 2016, 2:37 PM
mwolff added a reviewer: mwolff.
mwolff added a subscriber: mwolff.

I like the idea (I think, could you add some screenshots please)?

Some code changes are required, but overall this is pretty good already - thanks!

languages/clang/duchain/missingincludepathproblem.cpp
52

auto

languages/plugins/custom-definesandincludes/addmissingincludepath.cpp
37

use Path::List (i.e. QVector!)

style: move down into an explicitly private section

51

const

53

afaik you can use m_paths.value(row, {})

62

|| !hasIndex(index.row(), index.size(), index.parent())

65

the above check makes this obsolete

66

auto

languages/plugins/custom-definesandincludes/addmissingincludepath.h
72

const

78

const

languages/plugins/custom-definesandincludes/definesandincludesmanager.cpp
281

better not put it on the stack (could be deleted via dbus or funky stuff like that), but rather create on the heap and then set Qt::WA_DeleteOnClose on the dialog

297

the QUrl::fromLocalFile should not be required, Path(QString) does what you want, no?

298

this algorithm should be put somewhere out of this dialog, and get properly tested

also, the implementation looks pretty bad, performance wise. I think you want to put the includeName into an IndexedString and then use ProjectModel::item{,s}ForPath.

322

better use show and connect lambdas to signals that handle when the dialog got accepted

334

auto

335

auto

This revision now requires changes to proceed.Sep 5 2016, 2:37 PM
kfunk added a subscriber: kfunk.Oct 12 2016, 7:41 PM

@nicolaih Still willing to work on this patch?

Yes. I haven't forgotten, I'm just not sure when I'll find the time to do it.

kfunk added a comment.Jan 9 2017, 4:45 PM

Bump. @nicolaih We'd be really happy to have that feature in KDevelop!

maybe someone should take over?

In D2650#87486, @mwolff wrote:

maybe someone should take over?

Will have a look.

Hi @mwolff @kfunk , still plans to take over? Otherwise I would propose to mark it abandoned, so our list of patches to review is clean from (currently) dead things.

kossebau commandeered this revision.Oct 28 2018, 12:55 PM
kossebau abandoned this revision.
kossebau added a reviewer: nicolaih.

Abandoning for now given inactivity by the original author, for cleaning the to-review list. Still hoping one day someone/you will pick up this again.