Kate C++ Helper Plugin
This plugin intended to simplify the hard life of C/C++ programmers who use Kate to write code :-)
- code auto completion using clang
- flexible cleanup rules to beautify completion results
- code indexing and navigation (no need to use
- flexible search facility allowing to execute various queries using multiple indices
- preprocessor directives auto completion w/ automatic substitution
#includeheaders auto completion
#includelines if header not found in configured locations or found in multiple times
Edit->Copy #include to Clipboardto add
#include <current-file.h>to a clipboard
File->Open Header/Implementationa replacement for official Open Header plugin with few enhancements
- explore and navigate over included files
- monitor configured directories for header files
... and few more neat things. Hope you'll enjoy using it! ;-)
NOTE: Actually I don't know a real minimum requirements (I'm a gentoo user and have everything fresh in my system). So I call to users and distro-makers to provide some feedback, so I can update a list below.
- C++14 compatible compiler (gcc >= 4.9)
- clang >= 3.3 or >=3.5 if you want to compile it with clang
- cmake >= 3.1
- Kate editor version >= 3.8
- KDE >= 4.8
- boost library >= 1.49 required since version 0.8.7
- xapian library >= 1.2.12 required since version 1.0
NOTE: Attention distro guys! GNU Autogen, searched by CMake script, do not needed by end users! No need to add it to package dependencies! It is used (by me) in this particular project to generate C++ files from skeletons -- i.e. it is "this package developers only dependency"!
Clone sources into (some) working dir
To install into your home directory you have to specify a prefix like this::
$ cd <plugin-sources-dir> $ mkdir build && cd build $ cmake -DNO_DOXY_DOCS=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=~/.kde4 .. && make && make install
To make a system-wide installation, set the prefix to
/usrand become a superuser to
After that, you have to enable it from
Settings->Configure Kate...->Plugins, configure the include paths globally and/or per session and other options. Some details could be found at [home page]
Note: One may use
kde4-config utility with option
--prefix to get
user or system-wide prefix correspondingly.
- It seems recently released clang 3.2 has a bug with optional parameters: completer return only first one.
- clang 3.3 has a bug w/ pure virtual function call when accessing some completion diagnostic messages.
If you see a call to
clang_getSpellingLocationin a backtrace, do not report a bug to me ;-)
Add autocompleter for[done]
Handle multiple matches[done] Passive popups if nothing found[done]
#includefiles w/ relative and quoted paths (investigate the "problem")
Shift+F10to go back in stack (?)
#includedirective w/ filename currently active in a clipboard
List of currently[done]
#includedfiles in a dialog and/or menu
- OpenFile dialog for current
#includeline to choose (another) header
Is it possible to use annotations iface somehow to indicate 'not-found'[done]
- Add quick open dialog -- like quick document switcher, but allows to find a file to open based on configured include paths by partial name match...
Add view to explore a tree of[done someway]
Add option(s) to include/exclude files from completion list[exclusion list of extensions done]
- Issue a warning if
/proc/sys/fs/inotify/max_user_watchesis not high enough
KUrlfor files and dirs instead of
QStrings[code review required]
boost::enable_iffrom return value and parameters
- Use compilation database if possible. What to do w/ headers which are not in there? -- Collect various options from database and offer to autosetup "Additional clang options" from few variants...
- Auto generate doxygen documentation for functions from definition -- just skeleton w/ parameters and return type. (maybe better to implement as Python plugin for kate?)
- Enable code auto completion (configurable by checkbox)... but how to deal w/ really heavy project?
Nowadays for one of my current project it took ~8sec to show completions (even with PCH) :-(
So, definitely there should be possible to turn code autocompleter off[done] Need to introduce index database to lookup for declarations/definitions/references. It also can be used for code refactorings (like rename smth & etc.)
- Give a context hint to code completer
- Give a priority boost for code completion items depending on lexical/semantic context
Not quite related to C++, but it would be nice to have a CMake autocompleter. It can complete variables, functions, properties,[done in kate.git and KDE SC 4.11]
find_package()files. Also it can retrieve
helpscreen for particular module.
- Collect sanitizer stats (rule hits) -- it can help to understand what rules must be first in a configured list (to speedup completer + sanitizer).
Add a bunch of default sanitizer rules Add import/export sanitizer rules
- Show some diagnostic from sanitizer
- Colorize and group diagnostic messages [partially done]
Add icons to completion types[done for prefix-less layout]
- Get/show list of possible exceptions in particular function call
- Highlight interior of user specified
__WIN32__, etc) w/ a user specified color
- Try to get a location for completion item and show it
as suffix in a completion listin the expandable part of completion item
- Add ptr/ref/const/etc to a type under cursor (by a hot-key). maybe better to implement as a Python plugin for kate?
Show a real type of typedefs (as a tooltip?)In symbol details pane
- Render class layout according sizeof/align of of all bases and members
- Provide Python bindings to indexing and C++ parsing, so they can be used from kate/pate plugins
#includecompletion items by directory
#includedirectives according configurable rules and type (project specific, third party libs or system)
Upgrade plugin configuration (at least internal struct) to .kcfg-- BAD IDEA!
kateplugins can not use this feature cuz application class (plugins manager to be precise) do not designed for that...
xsltprocstill can be used :)
KCompletioncan't be used to complete search query (cuz it is designed to complete only one, very first, term) -- it would be nice to have terms completer anyway...
- Index comments from source code
- Add terms for overloads
- Add terms for symbols' linkage kind
- Add value slot for
- Add terms for arrays (and possible value slots)
- Add terms for variadic functions
- Add terms for function result type
- Add terms for calling conversion
- Handle attributes
- Add terms for 'noexcept'
- How to deal w/ 'redeclarations' of namespaces?
- Add terms for deprecated symbols (and platform availability)
Find crash after some DB gets enabled after reindexing Use actions w/ states (see KXMLGUIClient) Normalize file names when add to the cache on indexing
#includecompletions into a system and session? (controlled via config option) or even maybe it would be reasonable to have a base dirctory name as a group name.
- Add search options
- Add more indexing threads and control their count
Add Go to declaration/definition to the context menu
- Add Go to semantic/lexical parent to context menu
- Do incremental reindexing on view change and/or inactivity timeout
- Add a way to analyze and show to a user what exceptions are possible at some particular
point (function/method body/call) -- so user may add an appropriate
- That (possibly) would be nice to have
#elseblocks as inlined tabs inside a text buffer/view. So, depending on particular definitions the code (view) will activate a corresponding tab automatically (and still allows to switch to others and/or add some new branches).
#inclduelines into "links", if
Avoid CSS files (if found) to be indexed as C/C++ sources! (and
- Disable "Save Current List" button on Session Include Dirs page if current list is empty (to prevent overwriting some saved list occasionally). Introduce confirmation on overwrite?
- When autocomplete preprocessor, do not add a space if it is already here. Make autocompletion configurable?
- BUG: after sanitize refref has no space after parameter
- Strip '.' from ignore extensions list. Maybe it is better to have inclusion list instead, BTW?
- Try to match filenames when "open first header" option in effect
- Index standard headers w/ a predefined collection name and use them to add missed #includes
- Add an action to generate a
switchstatement for enumeration type