cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE how to show hints when calling function

Mykola_Levun
Associate III

Hello,

STM32CubeIDE.

Is it possible to show hints (description of the function, description of the parameters of the function, description of the return value) when calling function?

I made this function (see Figure 1) and made documenting comment. When I calling this function or I hover the cursor over the function name a tooltip with the function code pops up, but I want to see description of the function (@brief parameter from documenting comment, see Figure 1).

Figure 1

Mykola_Levun_0-1725009010067.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

It will show the comments before the function definition (not declaration), plus the function code, automatically. This is what "Combined Hover" does. Probably you don't have comments before the definition, only the declaration. Don't think you can change this behavior.

TDK_0-1725014171469.png

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

15 REPLIES 15
Sarra.S
ST Employee

Hello @Mykola_Levun

I think it should be here: windows> preferences

SarraS_0-1725010658708.png

 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @Sarra.S,
It is not work (see Figure 2).

Figure 2

Mykola_Levun_0-1725011050616.png

When I check the box next to Documentation, then I get an error "'Documentation' hover uses the same modifier as 'Combined Hover' hover" (see Figure 2). When I uncheck the box next to Combined Hover, then there is no error, but when I calling function or I hover the cursor over the function name, there is no a tooltip.

Yes, obviously there is a conflict, since both combined hover and documentation have key modifier blank.. you should set a key modifier for one of them  

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I did it (see Figure 3), but tooltips from the documentation comment are not shown; hovering over the function name only shows the function code.

Figure 3

Mykola_Levun_0-1725014355933.png

 

TDK
Super User

It will show the comments before the function definition (not declaration), plus the function code, automatically. This is what "Combined Hover" does. Probably you don't have comments before the definition, only the declaration. Don't think you can change this behavior.

TDK_0-1725014171469.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Hello @TDK,
Everything works as you explained. Thank you for explanation.

The problem is that it is not working how it should be. It should be clearly formatted hint with Javadoc or similar style, based on the info from the comment. Without any of the source code. Just like it works in the Eclipse for Java. In this case is completely unusable, especially when Dark Mode is enabled.

Why would Javadoc be used for C code? Why is Eclipse for Java relevant? This isn't Java.

If you feel a post has answered your question, please click "Accept as Solution".
Javadoc is a standard for code documentation with comments. Nowadays, it is widely used for commenting and documenting code in various languages, not just Java. Not to look so far, the ST HAL libraries use this kind of documentation broadly.
 
Most contemporary IDEs use this kind of comment by default, like VS Code and JetBrains.


@TDK wrote:

Why is Eclipse for Java relevant? This isn't Java.


Yes and no. STM32CubeIDE is, obviously, based on Eclipse, the environment primarily intended for Java (and written in Java too). So there was a capability to display properly formatted hints with documentation, based on Javadoc-style comments, that vanished with Eclipse CDT. And I think it's the right time to bring back this option.