2022-02-19 08:46 AM
When developing a class, can CubeIDE update a method's name in the .cpp file when it's modified in the .h (the sme the other way around)? Or do we have to modify both files?
Solved! Go to Solution.
2022-02-19 09:03 AM
Yes it will. Use Refactor -> Rename (Alt+Shift+R)
Any calls to it are also updated, assuming your index is valid.
2022-02-19 09:03 AM
Yes it will. Use Refactor -> Rename (Alt+Shift+R)
Any calls to it are also updated, assuming your index is valid.
2022-02-19 09:29 AM
OK, so I must be doing something wrong.
[a few minutes later] : Ooh I found the "implement method" tool. Ok.
So if I don't use this "implement method" tool, how can I make the indexer link the method's declaration and definition?
2022-02-19 09:52 AM
You don't need to do anything special. Type the header and class definitions correctly, make sure they're used (or at least compiled) in your project, make sure it builds correctly. You can rebuild the index but shouldn't need to.
2022-02-19 10:00 AM
So I need to build it (hammer icon) and that's when they get linked?
2022-02-19 10:08 AM
No, but if it builds, it means you don’t have typos and the IDE can interpret the code.
Edit: or hit F3 on the declaration and ensure it jumps to the definition.
2022-02-22 08:33 AM
Did you solve the issue?
Is the header file only setup as an include path but not as a resource (folder/file) visible in the project explorer?
If so, the CDT Indexer will not keep track of changes inside the include path directory.
Consequently many CDT features like refactoring will not work well.
2022-02-22 09:01 AM
Yes, I think the issue was that I need to save a file for the indexer to acknowledge a method written within (it then appears in the autocomplete tool).
I don't think UM2609 mentions anything about that. Is there another UM for CubeIDE?
2022-02-23 09:34 AM
Another question on the subject: are there tools that helps with deleting a member variable or a method cleanly?