Does CubeIDE refactor methods in class between header and source ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-19 8: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.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-19 9:03 AM
Yes it will. Use Refactor -> Rename (Alt+Shift+R)
Any calls to it are also updated, assuming your index is valid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-19 9:03 AM
Yes it will. Use Refactor -> Rename (Alt+Shift+R)
Any calls to it are also updated, assuming your index is valid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-19 9: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-19 9: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-19 10:00 AM
So I need to build it (hammer icon) and that's when they get linked?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-22 8: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-22 9: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-02-23 9:34 AM
Another question on the subject: are there tools that helps with deleting a member variable or a method cleanly?
