Review Request 124200: Introduction of rename variable refactoring

Milian Wolff mail at milianw.de
Wed Jul 15 22:27:22 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124200/#review82555
-----------------------------------------------------------

Ship it!


can you add a multi-file unit test for this as well?

in general though, I do wonder whether this shows some serious issues with the clang API for refactoring. Renaming a variable based on the data we store in the DUChain cache could be done much quicker. Of course that cache must be up2date, but that's the same for you here... Maybe what we have had in oldcpp (minus the horrible code) wasn't that bad after all. For these "simple" rename refactorings at least, the old architecture could serve us quite well. What I'd be interested in seeing next is other refactorings which we so far never had. Like negating conditionals, putting code into a function, wrapping string literals, ... for that one really needs a proper AST access and probably libTooling. And it's purely local thus does not require all other files to be updated.

- Milian Wolff


On July 14, 2015, 11:44 a.m., Maciej Poleski wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124200/
> -----------------------------------------------------------
> 
> (Updated July 14, 2015, 11:44 a.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> Introduced rename variable refactoring.
> 
> This patch provides preliminary support for variable rename refactoring.
> Currently only one project is supported.
> Currently it is required to save all opened documents (cache is not ready).
> Regeneration of compile_commands.json needs to be polished. How to get appropriate notification (IProjectBuilder::configured signal)? As a workaround i simply restarted KDevelop to get this regenerated.
> To use this refactoring right click on variable declaration (definition) and select "rename" refactoring.
> 
> 
> Full renaming support will consist of a few parts - one of them is renaming around VarDecl (this patch).
> Quite early, but i wanted to see that this work is going into some direction after month of coding of pure interfaces/details.
> 
> How to split diffs? I noticed that RBTool created diff consisting of all changes ignoring other pending request. I wanted only the last one, because earlier commits are subject of other review.
> 
> NOTE: This is very conservative refactoring. It runs ClangTool on every TU defined in compile_commands.json. Such refactorings are very slow. I will have to work more on it (make some heuristics reducing set of TUs which need processing).
> 
> 
> Diffs
> -----
> 
>   refactoring/utils.cpp PRE-CREATION 
>   refactoring/utils.h PRE-CREATION 
>   refactoring/renamevardeclrefactoring.cpp PRE-CREATION 
>   refactoring/renamevardeclrefactoring.h PRE-CREATION 
>   refactoring/refactoringmanager.cpp PRE-CREATION 
>   refactoring/kdevrefactorings.cpp PRE-CREATION 
>   refactoring/debug.cpp PRE-CREATION 
>   refactoring/debug.h PRE-CREATION 
>   refactoring/CMakeLists.txt PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/124200/diff/
> 
> 
> Testing
> -------
> 
> Manual testing on very small code bases as cache and compile_commands.json regeneration is not fully functional.
> 
> 
> Thanks,
> 
> Maciej Poleski
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150715/f68b6922/attachment-0001.html>


More information about the KDevelop-devel mailing list