Review Request: Add Switch to buddy plugin which always swichting between cpp and header file [1/2]

André Stein andre.stein at rwth-aachen.de
Sun Nov 18 14:13:07 UTC 2012



> On Nov. 17, 2012, 5:19 p.m., Milian Wolff wrote:
> > I think this is ready to go... except - putting that context menu into its own plugin seems overkill. Personally I think this could be put into the context browser plugin, as this is about "browsing", no?
> > 
> > It would remove the need for a lot of boiler plate code in your plugin, just to get a simple context menu action up and running. What do you (and others) say?

I first also thought about integration this functionality somewhere else. Either another plugin or the document controller itself. But still I think it's better to leave it in its own plugin:
- Like this it's possible to just turn off the context menu extension by disabling the plugin. Integration in an other plugin would mean to introduce a new option to turn it off.
- I think from the point of view of maintainability it's better to leave in its own plugin. One of the things I really like about Kdevelop's code base is its modularity: Every little feature could be a plugin and doesn't have to be stuffed somewhere else. Also from the point of view of "Single responsibility" it's better to just leave there as the context browser plugin for example would be responsible for too many things otherwise.
- Thanks to Kdevelop's well thought plugin system I really think the boiler plate is kept to a minimum. If I just think about other "extensible" systems... :)


- André


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107310/#review22135
-----------------------------------------------------------


On Nov. 16, 2012, 1:35 p.m., André Stein wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107310/
> -----------------------------------------------------------
> 
> (Updated Nov. 16, 2012, 1:35 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Description
> -------
> 
> This request adds a new plugin "Switch to buddy" which enables in the c++ language plugin a new context menu action to switch to corresponding header or implementation file. This request is split in two parts because it needs changes in kdevelop too (see Request 107311).
> 
> Changes made:
> - A new function has been added to IBuddyDocumentFinder to allow language plugins to implement logic to find buddy or related files.
> - The new plugin "switch to buddy" implements a context menu extension which is only trigged if at least one buddy can be found. To get possible buddies IBuddyDocumentFinder is used using the editor's current document's mime type.
> - See plugin
> 
> This implements a feature known from many IDEs. Using the Buddy interface and a separate plugin I think it's rather clean and generic.
> 
> 
> Diffs
> -----
> 
>   interfaces/ibuddydocumentfinder.h 7807df7 
>   plugins/CMakeLists.txt 8aac3ae 
>   plugins/switchtobuddy/CMakeLists.txt PRE-CREATION 
>   plugins/switchtobuddy/Messages.sh PRE-CREATION 
>   plugins/switchtobuddy/kdevswitchtobuddy.desktop PRE-CREATION 
>   plugins/switchtobuddy/switchtobuddyplugin.h PRE-CREATION 
>   plugins/switchtobuddy/switchtobuddyplugin.cpp PRE-CREATION 
>   shell/tests/shellbuddytest.cpp 981daa3 
> 
> Diff: http://git.reviewboard.kde.org/r/107310/diff/
> 
> 
> Testing
> -------
> 
> Manual testing.
> 
> 
> Screenshots
> -----------
> 
> Context menu in action
>   http://git.reviewboard.kde.org/r/107310/s/830/
> 
> 
> Thanks,
> 
> André Stein
> 
>

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


More information about the KDevelop-devel mailing list