2026-03-30 6:52 AM
Hello,
Before compilation:
I’m having an issue with IntelliSense (possibly clangd).
When a macro is undefined, the code inside #ifdef is correctly shown as inactive (dimmed). However, after I build and flash the project, the same code becomes highlighted as if it were active, even though the macro mDEBUG is still not defined.
The highlighting only returns to the correct state after I switch tabs or force a refresh.
Is this expected behavior, or could this be a bug or bad config on my side? It brings confusion to my workflow.
After compilation:
2026-03-30 8:01 AM
run re-index and will be fixed.
Not all changes trigger this function.
2026-03-30 9:49 PM
But that's the issue, shouldn't it re-index by itself?
2026-03-30 10:14 PM - edited 2026-03-30 11:45 PM
I found that some edits do not trigger automatic re-indexing or force project clean-up before compiling; I use STM32CubeIde, but it looks that same problems are with MS editor.
It seems that happens more often with auto-save, I did not see on manual save yet.
Be aware that MS and STM share some part of background engine and compiler/linker.
More, not all pre-processor directives run correctly, like in my post https://community.st.com/t5/stm32cubeide-mcus/stm32cubeide-bug-wrong-behavior-with-has-include-xxx-h/m-p/775926?search-action-id=109827300795&search-result-uid=775926