Review Request 120176: Suggest file buddies based on DUChain

Max Schwarz max.schwarz at online.de
Sat Sep 13 15:01:37 UTC 2014



> On Sept. 13, 2014, 2:17 nachm., Milian Wolff wrote:
> > documentfinderhelpers.cpp, line 220
> > <https://git.reviewboard.kde.org/r/120176/diff/3/?file=311970#file311970line220>
> >
> >     could be simplified to:
> >      
> >         if (type1.second != type2.second)

not really, the type is not binary. There is also `FileType::Unknown`.

But I merged the if() with the second one in the function and made each case explicit. I think it is more readable now.


> On Sept. 13, 2014, 2:17 nachm., Milian Wolff wrote:
> > tests/test_buddies.cpp, line 510
> > <https://git.reviewboard.kde.org/r/120176/diff/3/?file=311972#file311972line510>
> >
> >     This should/could be handled in the generic `cleanup()` function, which will be called after every test function. That way, if a check before fails and the function context is left, the documents will still be closed.

Okay. I noticed that as well ;-)
That means my patch will also touch the other test functions.


- Max


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120176/#review66401
-----------------------------------------------------------


On Sept. 13, 2014, 1:10 nachm., Max Schwarz wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120176/
> -----------------------------------------------------------
> 
> (Updated Sept. 13, 2014, 1:10 nachm.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> Many projects have source trees with split include / source folders.
> In that situation the path-based buddy finder does not work. So
> examine DUChain declarations/definitions and rank possible buddy files
> to find the most probable one. If we found such a buddy file, add it
> to the suggestions.
> 
> Of course, this improvement does not depend on kdev-clang. If you point
> me towards a suitable place in kdevplatform, I can also add it there.
> 
> 
> Diffs
> -----
> 
>   documentfinderhelpers.cpp 6535ab9 
>   tests/test_buddies.h 1c6f8f3 
>   tests/test_buddies.cpp da1fcea 
> 
> Diff: https://git.reviewboard.kde.org/r/120176/diff/
> 
> 
> Testing
> -------
> 
> Tested on a medium codebase (>100 source files) with the SwitchToBuddy shortcut (Ctrl+Alt+c). Works fine with no visible performance drop.
> Tests added in the TestBuddies unit test.
> 
> 
> Thanks,
> 
> Max Schwarz
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140913/7d54a081/attachment.html>


More information about the KDevelop-devel mailing list