User forums > Using Code::Blocks

File manager and refactoring

(1/2) > >>

Phumus-9:
Hi guys, it's me again.
This time I'm struggling with file organization. What can I do if I want to move a file to a new folder?
I've searched online, and I read that the only way to move a file is to create a new folder on the Windows file manager (or in the "Files" tab of the "Management" menu on C::B), move there the file(s) I want, remove that file from my project, add the same file but with the new path.
Now, I find this process just a bit time consuming for such a simple task, in one of the most famous IDEs of 2019. I really hope there is a faster way (for example I tried to right-click on the project name in "Management" menu, but I can only add virtual folders, and this is not what I want).

Moreover I have problems concerning refactoring. If I want to change the name of a variable I select that variable, right click on it, "Code refactoring", "Rename symbols" and I write the new name in the dialog box. All ok, but then if I have another variable with the same name, then it changes that variable too (for example in a setter method of a class this happens frequently). This makes the refactoring pretty useless... Is there another way to refactor my code?

Thanks in advance!

ollydbg:

--- Quote from: Phumus-9 on February 16, 2019, 11:06:11 pm ---Moreover I have problems concerning refactoring. If I want to change the name of a variable I select that variable, right click on it, "Code refactoring", "Rename symbols" and I write the new name in the dialog box. All ok, but then if I have another variable with the same name, then it changes that variable too (for example in a setter method of a class this happens frequently). This makes the refactoring pretty useless... Is there another way to refactor my code?

--- End quote ---

This feature is supplied by CodeCompletion plugin, and this plugin has bugs. It would be better to file a bug report on our Ticket system so that this bug won't lost.

BTW: fix such bug is not easy I guess.  :)

Phumus-9:

--- Quote from: ollydbg on February 17, 2019, 03:25:00 pm ---
--- Quote from: Phumus-9 on February 16, 2019, 11:06:11 pm ---Moreover I have problems concerning refactoring. If I want to change the name of a variable I select that variable, right click on it, "Code refactoring", "Rename symbols" and I write the new name in the dialog box. All ok, but then if I have another variable with the same name, then it changes that variable too (for example in a setter method of a class this happens frequently). This makes the refactoring pretty useless... Is there another way to refactor my code?

--- End quote ---

This feature is supplied by CodeCompletion plugin, and this plugin has bugs. It would be better to file a bug report on our Ticket system so that this bug won't lost.

BTW: fix such bug is not easy I guess.  :)

--- End quote ---

Thanks for the answer, I thoutght it was the normal behaviour, since eve when I select a variable, the highlighting too highlights all the occurrences.
Btw I suggest you to report this bug somewhere in the IDE, because at the beginning I didn't understand why it was acting like that.

What about my first question about file manegement?

BlueHazzard:
The thing with file management is this: you have a highly specialized program for file management on your pc, why should codeblocks try to re implement it?
If you have to move a lot files then the easiest way is to use the file manager of your os to move the files, open codeblocks and your project, call the plugin "Plugins->Find broken files in project" Remove the broken files and then add the new files via Project->Add files recursively. Codeblocks will select only the new files. You can also filter it more in the following dialogues...

Phumus-9:

--- Quote from: BlueHazzard on February 18, 2019, 09:24:19 am ---The thing with file management is this: you have a highly specialized program for file management on your pc, why should codeblocks try to re implement it?
If you have to move a lot files then the easiest way is to use the file manager of your os to move the files, open codeblocks and your project, call the plugin "Plugins->Find broken files in project" Remove the broken files and then add the new files via Project->Add files recursively. Codeblocks will select only the new files. You can also filter it more in the following dialogues...

--- End quote ---
Ok, I tried what you suggested and it is a bit faster.
I agree that my PC's file manager is highly specialized, and I'm ok with creating the main structure of my project with it. But it happens quite frequently that I have to do minor changes to the structure, and there is where an integrated file manager would be very useful.
Just a method to insert a new folder would be needed, so that I can drag and drop the files I want to move in that folder, without having to remove and re-add them. Of course I imagine that it isn't that easy to implement (if not you would have already implemented it), maybe in the future I can try to implement it by myself, but right now I'm not experienced enough (I'm just a student), and probably this is also why I do a lot of minor changes to the structure of my project...

Thanks for the answer!

Navigation

[0] Message Index

[#] Next page

Go to full version