In version 4.7.x was available quite useful function: Code -> Move to source or hit Ctrl + Alt + S Described here: https://userbase.kde.org/KDevelop4/Manual/Working_with_source_code like following: "This remove the code between curly braces from the header file (and replaces it by a semicolon as necessary to terminate the function declaration) and moves it into the source file" Is it possible to restore it in KDevelop 5.x.x? Reproducible: Always
Yes, I miss this feature too. There was an attept to use Clang for refactoring (I guess this included move to source too), but I'm not sure what happened to it . If we're not going to use it, then I could port the needed code over from oldcpp to make this feature work. Milian, what's the status of Clang-based refactoring? Any plans on merging it into master?
In my eyes, the Clang-based refactoring has a too high complexity and does not integrate that well into our existing structure and code base. It also had serious problems with project-wide refactorings. So imo, we should try to look at bringing back this functionality requested here and others based on a slimmed down architecture, also leveraging our DUChain where possible.
Created attachment 96837 [details] Patch Here is a patch that adds "move into source" support. It still missing tests, also I noticed that there are some issues with e.g. const parameters, and probably more. I'm not really sure when I'll have time to fix those issues (maybe in the next month), so I'm pasting this patch here, in case someone wants to work on it.
Git commit 9b001d16ff1e88dc09f40298eba82a59f5dc357b by Sergey Kalinichev. Committed on 28/02/2016 at 06:28. Pushed by skalinichev into branch '5.0'. Added "move into source" helper This mostly uses the code from oldcpp. Which I cleaned up a bit and remove a lot of unused functionality. Also I had to introduce a couple of changes to the code due to e.g. inconsistencies in internal vs. function contexts with oldcpp. Related: bug 358480 Differential revision: https://phabricator.kde.org/D1005 M +2 -0 languages/clang/CMakeLists.txt M +10 -4 languages/clang/clangsupport.cpp M +2 -2 languages/clang/clangsupport.h A +251 -0 languages/clang/codegen/simplerefactoring.cpp [License: GPL (v2/3)] A +58 -0 languages/clang/codegen/simplerefactoring.h [License: GPL (v2/3)] A +321 -0 languages/clang/codegen/sourcemanipulation.cpp [License: GPL (v2/3)] A +80 -0 languages/clang/codegen/sourcemanipulation.h [License: GPL (v2/3)] M +97 -0 languages/clang/tests/test_assistants.cpp M +3 -0 languages/clang/tests/test_assistants.h http://commits.kde.org/kdevelop/9b001d16ff1e88dc09f40298eba82a59f5dc357b