Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refactring in CLion isn't working

I have problem with refactoring, e.g. renaming classes in CLion. CLion shows me the refactoring windows, but doesn't find anything to refactor. Screenshots are appended. I also tried to add header files into CMakeLists, but without success. Do you have any idea what I should do?
Thank you.
enter image description here enter image description here

Edit: I am using Debian 8.2 x64 with Cinnamon

like image 293
Patrik Valkovič Avatar asked Jan 04 '16 18:01

Patrik Valkovič


2 Answers

I just added all .h files into CMakeLists.txt into set(SOURCE_FILES ....) and now its work fine. Thanks to V-R.

like image 116
Patrik Valkovič Avatar answered Nov 03 '22 11:11

Patrik Valkovič


If renaming doesn't work, it could be because your project does not successfully build. Try it with a simplest project, e.g. create a completely new Hello World program. I'm sure if it builds successfully, refactoring will work as well. Worked for me in CLion 1.2.4 on OS X 10.9.4.

Concerning CMakeLists.txt, it is a standard file that is created automatically by CLion if you create a new project. If you have an existing project, you will find CMakeLists.txt if you open the menu View->Tool Windows->Project.

My advice is to experiment by closing your existing project (File->Close Project), creating a New Project and playing around with the CLion features. Here is a nice Quick Start Guide for CLion

like image 40
V-R Avatar answered Nov 03 '22 11:11

V-R