# Plugin Tools

&kdevelop; contains a large number of little tools that help you to perform certain task. Most of them are realized as plugins. That means, if you do not need a plugin, you can disable it.

That also means, if you are looking for a functionality that should be there and isn't, then maybe it's implemented in a plugin and that plugin is disabled. For example, in the file menu there is a Quick Open feature, but only if it's enabled in the Project - Project Options dialog.

Technically, plugins are based on the KDevPlugin class defined in lib/interfaces/kdevplugin.h. The following is taken from a comment from there.

KDevPlugin is the base class for all KDevelop plugins. A plugin is a component which is loaded into KDevelop shell at startup or by request. A plugin has a scope that can be either:

- Core

- Global

- Project

Core plugins are global plugins which offer some important "core" functionality and thus are not selectable by user in plugin configuration pages.

Global plugins are plugins which require only shell to be loaded and do not operate on KDevProject interface and/or do not use project wide information. For example, the uimode plugin allows a developer to select which user interface they wish to use.

Project plugins require a project to be loaded and are usually loaded/unloaded along with the project. If a plugin operates on project-related information then it is a project plugin. The Automake Manager, for example, only needs to be active when an Automake based project is currently loaded.

As stated above, core plugins cannot be disabled. Global plugins can be enabled/disabled in Settings Configure KDevelop... under Plugins. Project plugins can be enabled/disabled in Project Project Options... under Plugins. Active plugins can have many effects on KDevelop. Depending on their function, they may add extra menus, extra menu items, extra tool buttons, etc.

Plugins which are disabled do not clutter your menus and are not loaded into memory.

The following plugin list is generated by a small script (listplugins.sh) written by Volker Paul. All plugins have a .desktop file where information such as name and comments are written. If in the following these comments are not very useful, it is because the plugin authors made them this way.

The plugins are grouped by scope (Core, Global, Project).

Scope: Core

- ## Application Wizard

  Application Wizard

- ## Difference Viewer

  Difference Viewer

- ## FileCreate

  FileCreate

- ## FullScreen

  FullScreen

- ## Tip of the Day

  Tip of the Day

- ## User-Interface Selection

  Provides a dialog for UI-mode selection.

- ## VCSManager

  Version Control System Manager

Scope: Global

- ## Abbreviation Expansion

  Provides support for customizable abbreviations - short words which expand into commonly needed code structures.

- ## Documentation

  The Documentation plugin offers browsing and searching in local and online documentation with support for multiple documentation systems.

- ## FileList

  Provides a list of all currently open files. (Handy when the tab bar is not quite wide enough.)

- ## File Selector

  Powerful network transparent file browser utility.

- ## Shell Filtering and Insertion

  Provides a way of manipulating editor text using commandline tools. Appears in the Tools menu.

- ## Grep Frontend

  Integrates "find|grep" in KDevelop - allows fast searching of multiple files using patterns or regular expressions.

- ## Embedded Konsole

  This plugin gives KDevelop an embedded konsole for quick and easy command line access.

- ## "Open with" Menu Addon

  This plugin provides additional "open" alternatives for various context menus in KDevelop.

- ## Part Explorer Tool

  A Graphical tool for performing KTrader-like queries about registered services

- ## Regular Expression Tester

  Tool to design and test regular expressions against common regexp syntaxes.

- ## Replace Part

  This plugin is an interactive projectwide "Search and Replace" tool. Search using string or regexp matching, and select the replacements to be made from a preview before the action is finalized. When loaded it appears in the Edit menu.

- ## Scripting

  The Scripting plugin offers KScript based scripting of the KDevelop application

- ## Code Snippets

  This plugin allows you to store code snippets and add them to your code

- ## Text Structure

  Provides a structure overview and navigation for HTML and TEX files

- ## Tools Menu Addition

  This plugin provides an easy way to add external applications to the Tools menu and toolbar.

- ## Valgrind Frontend

  Valgrind is a tool that helps you find memory management problems in programs. http://developer.kde.org/~sewardj/

Scope: Project

- ## annotation Plugin

  annotation Description

- ## Source Code Formatter

  A plugin for formatting of sourcecode according to a specified set of rules. When loaded it is found in the Tools menu.

- ## Bookmarks

  Plugin that provides navigation and overview of active source bookmarks and persists them between sessions.

- ## Class View

  This plugin displays a graphical view of all the classes in the project, complete with methods and attributes, and provides a way of direct source navigation.

- ## CopyTo

  Simple file uploader plugin. It does a file copy over any KIO supported protocol.

- ## CTags Frontend

  CTags is a source navigation tool with support for many languages. When loaded it provides a context menu for finding type declarations/definitions and also a query dialog. http://ctags.sourceforge.net/

- ## Final Packaging Support

  Aids in building and publishing the final project. Only RPM package format is supported for now.

- ## Doxygen Support

  The doxygen plugin provides a way to specify and control generation of documentation for a project, based on source code content. You need to have doxygen installed to be able to use this. For more info goto http://www.doxygen.org

- ## QuickOpen

  Provides an efficient way of finding/opening files, classes and methods in a large project. Appears in the File and Tools menus when loaded.

- ## Security Checker

  Code security checker

So far the generated plugin list.

## Project Management Plugins in &kdevelop;

antproject | ANT Project Manager (&Java; applications)
autoproject | Automake Project Manager
customproject | Custom Project Manager
trollproject | QMake based Project Manager

The above plugins are currently (May 2005) empty. Maybe project management support will be implemented as plugins in the future.

## Language Support Plugins in &kdevelop;

cppsupport | Support for C/C++
fortransupport | Support for Fortran
javasupport | Support for &Java;
perlsupport | Support for Perl
phpsupport | Support for PHP
pythonsupport | Support for Python

In the following, some of the plugins will be discussed in detail.

- ## The `abbrev` Plugin

  This plugin expands abbreviations into frequently used code snippets. It is activated by pressing Ctrl Space. For example, when you enter `"ife"` into a C++ in the editor and press CtrlSpace, you obtain an `if-else` code template and save some key strokes. The set of supported abbreviations depends on the programming language of the edited file. For example, for PHP you will obviously be interested in other code templates than for &Java;.

  The set of code templates is configurable. If the plugin is enabled, you can see which ones are available in the Settings Configure KDevelop... dialog under Abbreviations.

- ## The `filter` Plugin

  This offers two features. If you select Tools Execute command, you can enter a shell command. The output of this command is inserted into the editor buffer when you hit the Start button.

  A related feature is available under Tools Filter selection through command.... In order to use this, you must select a text area in the editor. If you now enter a shell command and hit the Start button, the command is started and the selection used as the standard input for it. The standard output of the command is then inserted into the editor, replacing the selection.

  For example, if you write documentation, you frequently have to refer to menu items. To do this correctly for e.g. the Copy command in the Edit menu, you have to write:

      <menuchoice><guimenu>Edit</guimenu><guimenuitem>Copy</guimenuitem></menuchoice>

  This is cumbersome, so you'd rather just write "Edit - Copy" and let the computer do the tagging. Here is how you can do it. You write a little shell script called mef you put e.g. in your home's bin directory:

      sed s/"^\(.*\) - \(.*\)\$"/"<menuchoice><guimenu>\1<\/guimenu><guimenuitem>\2<\/guimenuitem><\/menuchoice>"/

  Don't forget to make it executable. That's all. Now, in your documentation .docbook source, you write "Edit - Copy". You select this text you just wrote, choose Tools Filter selection through command... and call ~/bin/mef. Instantly "Edit - Copy" is replaced by

      <menuchoice><guimenu>Edit</guimenu><guimenuitem>Copy</guimenuitem></menuchoice>

- ## The &doxygen; Plugin

  This one helps you to use the &doxygen; API documentation tool (). You can select Project Run Doxygen to generate API documentation for your current project, based on the configuration given by the file `Doxyfile` in your project directory.

  Furthermore, you can configure &doxygen; in the Project Project options... dialog. This dialog is very similar to the &doxywizard; tool.

- ## The &ctags; Plugin

  Although the class browser gives you extensive insight into the symbols and classes of your project, you may also want to use the ctags tool. In particular, this one supports a lot more language than the class browser.

  You activate this plugin under Tools CTags.... When you start it the first time, you will be asked to generate a search database first. When you accept this, the &ctags; program will be started and will create a file named `tags` in your project directory. This is a text file containing all symbols of your source files.

  You can search in the symbol database in two ways: when the Regular expression match box is checked, the text you enter will be interpreted as a regular expression (POSIX flavor) and matched with the existing symbols. For example, the text `.*Widget` will search for all symbols ending with `Widget`. If the box is not checked, the search will be verbatim.

  When searching, you will get a list of the matched symbols, accompanied with the line numbers where they are defined. You jump to the respective point by clicking on the list.

  For some languages, &ctags; distinguishes different kinds of symbols. For example, Python has classes and functions. You can selectively search only for classes by checking the respecting kinds in the dialog.

  The symbol database is normally not updated when your sources change. Consequently, after a while the line numbers will not be correct anymore and newly added classes and functions will be missing. Therefore you should update the `tags` file in regular intervals by pressing the button Regenerate.

- ## The `astyle` Plugin

  Astyle is a plugin for formatting of sourcecode according to a specified set of rules.

- ## The `regexptest` Plugin

  Designing with regular expressions can be hard work. Often the first try at an expression matches too many strings. In particular, when working with a compiled language, the turnaround times when debugging a regular expression can be awkward. The regexptest plugin allows you to directly explore the changes in a regular expression. It is activated by choosing Tools Debug Regular Expression....

  In the flavor group box, you can choose the flavor of the regular expression engine used. Currently supported is the flavor defined in the POSIX standard, which is used by the &grep; program, and the extended POSIX syntax used by the program &egrep;.

  When you enter an expression, you get immediate feedback about any syntax errors in it. By entering a text under Test string, you can see whether the expression matches this string. In particular, if your regular expression includes groups, such as `([a-z])`, the content of the matched subgroups will be shown in a list box.