

Based on https://docs.zephyrproject.org/latest/develop/getting_started/index.html Zephyr seems to use cmake
So you should be able to use https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html to generate the compile commands json and configure clangd to use that.
Isn’t the conditions quite different, from your screenshot, you get to devices if you want to terminate. But in the other case, they decide.