<div class="gmail_quote">On Mon, Mar 29, 2010 at 1:36 AM, Aleix Pol <span dir="ltr"><<a href="mailto:aleixpol@kde.org">aleixpol@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><div class="gmail_quote">On Mon, Mar 29, 2010 at 1:05 AM, David Nolden <span dir="ltr"><<a href="mailto:zwabel@googlemail.com" target="_blank">zwabel@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Given the available information it would be relatively easy to do<br>
this, as said, all the info is there. It just needs someone to<br>
implement the "is this #include really needed" logic by looking at all<br>
the uses (given the "TopDUContext* topContext" for the file,<br>
recursively go through all context->childContexts(), and look at the<br>
contained context->uses()), and at the<br>
topContext->parsingEnvironmentFile()->usedMacros().<br>
<br>
I was planning for a long time to implement such a thing, but didn't<br>
come to it yet, and given my currently available time I won't do it in<br>
the close future.<br>
<br>
Also, you should be aware that this never will be 100% reliable, so<br>
I'm not sure whether I'd do it automatically over a whole codebase.<br>
I'd rather go for a menu-entry "Mark Unneeded Includes" within the<br>
"Code" menu, so that the user can decide by himself whether he really<br>
wants to remove them.<br>
<div><div></div><div><br>
--<br>
KDevelop-devel mailing list<br>
<a href="mailto:KDevelop-devel@kdevelop.org" target="_blank">KDevelop-devel@kdevelop.org</a><br>
<a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel" target="_blank">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel</a><br>
</div></div></blockquote></div><br></div></div>Hi,<br>I was thinking about doing that for some time so I created a little plugin now in playground to do so.<br>It's not what want yet but we can see it as a start. The main problem in terms of the identification of these include directories is that we should recognize the alias headers (like QString to qstring.h) and I didn't have an idea to get to do so, maybe david will have an idea? :D<br>

But it's a start.<br><br>Good night!<br><font color="#888888">Aleix<br>
</font></blockquote></div><br>Oh btw, it's the includemanager plugin, couldn't find a better name.<br>And only works with the currently opened file, we can extend to the whole project later.<br>