https://bugs.kde.org/show_bug.cgi?id=375274

            Bug ID: 375274
           Summary: #include added at end of file if there is an include
                    there
           Product: kdevelop
           Version: git master
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: wishlist
          Priority: NOR
         Component: Language Support: CPP (Clang-based)
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: nicolas.alva...@gmail.com
  Target Milestone: ---

If I have a foo.cpp file declaring QObject subclasses, I need to add #include
"foo.moc". Usually this goes at the end of the .cpp file.

This causes a problem when the assistant offers to add an include file. For
example, if I do QWidget foo; the assistant says QWidget is not declared (or
only forward-declared) and offers to add #include <QtWidgets/QWidget>. But if I
select this solution, it adds #include <QtWidgets/QWidget> at the end of the
file, after the .moc include. I would want it to go below all my other includes
near the beginning of the file.

I think we need a special case / heuristic here: if the #include ends with
".moc", ignore it for the purpose of looking where to add new #includes.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to