"Go To Definition" doesn't work with VSCode/STM32Cube?

I just started using Platform.io and did a first test with the STM32Cube framework. I noted CTRL+clicking doesn’t navigate to the HAL function definitions, how can I set it up so I can see the code that I’m using? I’m wondering if using STM32CubeMX and importing the generated code into VS Code would be a better option if I want access to the HAL library definitions?

Thank you all for your help!

This is a VSCode issue at core. Their docs state that F12 should get you there. So where does it take you when you do that?

Looks like that also doesn’t work. It highlights any uses of the function in the file but doesn’t navigate you to the definition.

Have you tried to maybe rebuild the intellisense index? The resulting .vscode/c_cpp_properties.json file should contain all the info to the path to the header and source files. If VSCode still can’t find it even though these paths are correct, it’s a VSCode issue.

1 Like

Hello guys,
I’m having this issue repeatedly. I checked the settings for the Auto Rebuild Autocomplete Index and it is set to true. But I still can’t navigate to the definitions or declarations of methods and variables.

Any idea how to resolve this issue?

Thanks

With exactly STM32Cube, which is what this topic talks about?

If using something else, please post a new topic with the exact platformio.ini, code and screenshot of VSCode where it doesn’t find your definitions.

I will post a new topic with more details.
Thanks