Review Request 120174: Fix SwitchToBuddy from function definitions for kdev-clang

Max Schwarz max.schwarz at online.de
Sat Sep 13 11:22:42 UTC 2014



> On Sept. 13, 2014, 7:22 vorm., Olivier Jean de Gaalon wrote:
> > Looks good, thanks!
> > 
> > You cannot remove the condition otherwise you'll always get the top context. In the future we just want to travel up until the first FunctionContext and use that, but for now this allow backwards compatibility with oldcpp's context structure.
> > 
> > Could you add a comment: "TODO: oldcpp: just need to find first FunctionContext"

Should I make a new version of the patch with the comment? Considering the patch is already in the master branch, I'm not sure what the correct procedure is.


- Max


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


On Sept. 12, 2014, 11:49 nachm., Max Schwarz wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120174/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2014, 11:49 nachm.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
> I'm using kdev-clang and the SwitchToBuddy functionality (Ctrl+Alt+c) does not work from function definition to declaration. See attached files for a minimal example.
> 
> The problem is that `SwitchToBuddy::switchDefinitionDeclaration()` just traverses `DUChainContext::Other` contexts while looking for a parent context owned by a definition. kdev-clang creates a `DUChainContext::Function` context for the definition (as I would expect), and the function fails to find a context.
> 
> Fix that by also considering `DUChainContext::Function` contexts. Maybe we can also drop the context type check, not sure why it is there.
> 
> 
> Diffs
> -----
> 
>   plugins/switchtobuddy/switchtobuddyplugin.cpp 142553f 
> 
> Diff: https://git.reviewboard.kde.org/r/120174/diff/
> 
> 
> Testing
> -------
> 
> Tested on a large private codebase and the KDevelop codebase, seems to work fine.
> 
> 
> File Attachments
> ----------------
> 
> test.cpp
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/09/12/b9ecffbc-0637-4c50-a1f1-0cdbe0901e4a__test.cpp
> test.h
>   https://git.reviewboard.kde.org/media/uploaded/files/2014/09/12/e8a17aea-08d9-4947-aa87-7bd127043812__test.h
> 
> 
> Thanks,
> 
> Max Schwarz
> 
>

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


More information about the KDevelop-devel mailing list