KDevCXX with AI is an innovative extension for the KDevelop IDE and soon also for Kate editor, focusing on integrating AI-powered features specifically designed to enhance C++ development. This project leverages the latest advancements in machine learning and natural language processing to provide KDevelop users with intelligent coding assistance, including code completion, documentation lookup, and advanced code analysis.
- AI-Powered Code Completion: Utilizes a trained model
gpt-4-1106-previewto suggest code completions, significantly speeding up the development process. - Documentation Lookup: Instant access to documentation for C++ standard library functions, classes, and more directly within the IDE.
- Code Analysis: Advanced code analysis features powered by AI, helping to identify potential improvements and optimizations.
- Error Correction Suggestions: Offers suggestions for correcting syntax errors and logical mistakes.
- Refactoring Assistance: AI-assisted refactoring tools to improve and simplify existing code without changing its external behavior.
- Multiple Presets for AI query assistant working with new and existing code, explanation providing information with tools windows, refactor for refactoring old code
- Add kdevelop settings kcm ui for easier settings access
- Kate plugin reusing plugin code with conditional build as Kate plugin
- Chat with GPT windows producing desired result with finall button apply to move result to code editor window.
- KDevelop IDE installed on your system.
- Internet connection for accessing AI features.
- CMake: Required to configure the build system.
- Boost: Version 1.66.0 or later, components
systemandthreadrequired. - OpenSSL: Necessary for https secure data handling.
Install these packages using your system's package manager.
This project uses CPM for automatic management of external libraries:
- simple_enum from
arturbac/simple_enum - small_vectors from
arturbac/small_vectors - stralgo from
arturbac/stralgo - glaze from
stephenberry/glaze - fmt from
fmtlib/fmt - ut from
C++20 μ(micro)/Unit Testing Framework
KDE frameworks are utilized, requiring:
- Extra CMake Modules (ECM) version
5.68.0or newer.
Ensure KDE development libraries and the ECM package are installed.
Follow these steps to install and configure KDevCXX with AI:
Start by cloning the repository to your local machine using the following command:
git clone https://github.com/arturbac/kdevcxx_with_ai.gitUse CMake to build the plugin with the following command:
cmake --workflow --preset="clang-release"Use provided install.sh script it will determine location of kdevplatform plugins and install plugin into that directory
Upon launching KDevelop, a modal dialog will appear, prompting you to review and update your settings located at ~/.config/kdevcxx_with_ai/kdevcxx_with_ai_ai_settings.json.
After installing the plugin, restart KDevelop. The AI features should now be seamlessly integrated into your IDE.
To use the AI functionality within the editor, follow these steps:
-
Write your AI request in the editor, preceded by
[AI DO something for me with that code], followed by the code you wish AI to analyze or modify. -
Highlight the request and the target code.
-
Press
Ctrl + 1to activate the AI processing of selected request and code. With 0.1.3 there is context menu availableProcess With OpenAI
Implementing unit tests example. note that it takes into effect my system rules specifying explicitly to use bost-ext/ut and You can change this in settings
{ "api_key": "******************", "cxx_rules": "You are great c++23 coder,... if implementing unit tests You use boost-ext/ut ...", "version": 1 } Or asking for help with explanations
or example refactoring of very old code
And perhaps the most weird use of AI i did with code, optimise ai query with ai for ai
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Thanks to the KDevelop community for providing a powerful and extensible IDE platform.




