Bug? Solved: Issue with help while hovering in specific subs...

amykonio

Active Member
Licensed User
Longtime User
Hi.
In some subs I use as return a type (structure).
B4X:
Sub Process_Globals
...
    Type PlayedChoice(row As Int, column As Int)
...
End Sub

'Function description...
'Examples: ...
Private Sub test3 As PlayedChoice
    Dim a As PlayedChoice
   
    a.Initialize
    a.row = 0
    a.column = 0
    Return a
End Sub

'Does nothing
Private Sub test2(a As Int) As Int
    Return a
End Sub

When I mouse hover against "Sub test2" I see the following:
1670579355529.png

But if I do hover on "Sub test3" I don't see text in comment before declaration.
Is this expected behavior?
Andreas.
 

amykonio

Active Member
Licensed User
Longtime User
Sorry. I wrote this question in B4i, while I was thinking I was in B4J forum. Anyway, as this is related to IDE it may occur also in B4i (cannot test - I don't have B4i).

@Erel
If this can be moved to B4J it would be ideal.

Thanks.
Andreas.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1670594666679.png


This is what I see with your code. Looks fine.

If I may add about comments, if you use a < in it (e.g. as in: if the string starts with '<' then it will be parsed...) the IDE does not show the comment when hovering over it.
The comments are parsed as xml. This allows using links and some other style elements. You need to escape that character:
B4X:
'Function &lt;description&gt;
'<b>Examples</b> <u>test</u>
Private Sub test3 As PlayedChoice
1670594841093.png
 

amykonio

Active Member
Licensed User
Longtime User
Thank you Erel for checking this.
You are right... It's an issue related to & character usage.
In my original comment I has more lines and an & .
Can you check the following:

B4X:
'Test Working
Private Sub test3 As PlayedChoice
    Dim a As PlayedChoice
 
    a.Initialize
    a.row = 0
    a.column = 0
    Return a
End Sub

'Test showing is not used & NOT showing tooltip...
Private Sub test4 As PlayedChoice
    Dim a As PlayedChoice
 
    a.Initialize
    a.row = 0
    a.column = 0
    Return a
End Sub
Test4 has a "&" in comment. There it doesn't work. If this is expected it's ok.
By the way, are there other characters we should avoid using in documentation?

Andreas.
 

amykonio

Active Member
Licensed User
Longtime User
Well this works.
'Test showing is not used & NOT showing tooltip... Private Sub test5 As PlayedChoice Dim a As PlayedChoice a.Initialize a.row = 0 a.column = 0 Return a End Sub:
'Test showing is not used &amp; NOT showing tooltip...
Private Sub test5 As PlayedChoice
    Dim a As PlayedChoice
 
    a.Initialize
    a.row = 0
    a.column = 0
    Return a
End Sub
I've noted that info about xml and using escape characters.

Thank you.

Andreas.
 
Top