| Summary: | Renaming a class affects CMake scripts | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Nicolás Alvarez <nalvarez> |
| Component: | Build tools: CMake | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | aleixpol |
| Priority: | NOR | ||
| Version First Reported In: | 4.2.1 | ||
| Target Milestone: | 4.2.0 | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Now I remember: the reason it doesn't appear in the rename dialog is that the CMake language handler doesn't have a ParseJob. That's not the reason. The reason is that when we find a use we first check if it is declared before, and DUChain reports those findings in the _whole_ project... Git commit 92cd00cd189a0520cd8aa25dca0fb1e4d4c4720c by Aleix Pol. Committed on 14/12/2011 at 03:38. Pushed by apol into branch 'master'. In cmake, Don't reuse declarations if they are not in a cmake script. BUG: 272110 M +12 -2 projectmanagers/cmake/parser/cmakeprojectvisitor.cpp M +4 -0 projectmanagers/cmake/tests/cmakeduchaintest.cpp http://commits.kde.org/kdevelop/92cd00cd189a0520cd8aa25dca0fb1e4d4c4720c |
If a class has the same name as a CMake target, they are considered the same for the purpose of renaming. CMakeLists.txt: ADD_EXECUTABLE(BugReport foo.cpp) foo.cpp: struct BugReport { BugReport() {} }; int main() { BugReport a; } Right click on any of the three BugReport identifiers in the C++ code, and select Rename. The rename dialog will only show the three uses in the C++ code, and nothing from CMakeLists.txt, as expected. Choose a new name and accept. The CMake target in CMakeLists.txt will get renamed too. This is incorrect.