D18224: Clang Plugin: Report some problems from included files

Milian Wolff noreply at phabricator.kde.org
Tue Jan 15 13:48:55 GMT 2019


mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  can you please also add tests for this feature? Have a look at `test_duchain.cpp` and in there e.g. `TestDUChain::testInclude` for how to create multiple files and have them include each other.
  
  Generally, I'm very much in favor of the direction this patch is going. This issue has been bugging me for a long time but I never got around to fixing it!
  
  Regarding Note 1: I think that sounds fine. Just make sure to add tests for all these scenarios and then we can decide to change this behavior later on, if need be.
  
  Regarding Note 2: Could this be a result of the "don't reparse if file didn't change" logic? I can believe that there are issues left that result in inconsistencies, when only a header was changed, or only an include file... Anyhow, I hope that's unrelated to this patch?

INLINE COMMENTS

> parsesession.cpp:457
>          if (diagnosticFile != file && ClangDiagnosticEvaluator::diagnosticType(diagnostic) != ClangDiagnosticEvaluator::IncludeFileNotFoundProblem) {
> -            continue;
> +            bool keepDiagnostic = false;
> +            auto childDiagnostics = clang_getChildDiagnostics(diagnostic);

put this into a helper function to reduce the complexity here

> parsesession.cpp:486
> +
> +            if (diagnosticFile != file) {
> +                // Insert a copy of the parent problem as the first

similarly, create a helper function for this chunk

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D18224

To: thomassc, #kdevelop, mwolff
Cc: mwolff, kdevelop-devel, glebaccon, hase, antismap, iodelay, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190115/43783692/attachment-0001.html>


More information about the KDevelop-devel mailing list