Author Topic: Does doxygen documentation window and parenthesis completion work for you?  (Read 4718 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Hi,
i investigate on ticket https://sourceforge.net/p/codeblocks/tickets/1001/ 
Now i am wondering does the doxygen documentation popup and the parenthesis completion for functions work for you?
Can you give me your operating system and codeblocks/wxWidgets version?

For me on windows 7 and windows 10 wxWidgets v3.1.3-72-g014f04b437 it does not work.


For devs:
The problem is, that cbStyledTextCtrl does not send the wxEVT_COMMAND_LIST_ITEM_SELECTED event, what is responsible for some internal state management and the popup for the documentation window

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #1 on: September 06, 2020, 01:58:01 pm »
Also does not work with wxWidgets v3.1.4-216-gc2b1dbda83

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #2 on: September 08, 2020, 03:53:36 pm »
With C::B 13.12 on Mint 18.2 (wx3.0.2) both features work OK, I will check more recent releases.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #3 on: September 08, 2020, 04:00:37 pm »
C::B 16.01 on Debian Stretch works OK.

EDIT: 17.12 on XP (wx2.8.12) works OK.
« Last Edit: September 08, 2020, 04:10:52 pm by Miguel Gimenez »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #4 on: September 08, 2020, 07:26:14 pm »
What do you mean by "works"? It seems to work fine for me on linux with wx3.0.5.

Keep in mind that there is a big overhaul of the popup code in the wxWidgets we haven't backported, yet.
I started the work, but there were two problems back then - wx2.8 support and compiling some .mm files on macOS.
The former is no longer an issue, the latter still is.

So before doing any work related to this the we should backport their changes first!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #5 on: September 08, 2020, 07:48:54 pm »
I mean "it does what it is supposed to do", i.e. code completion inserts the selected function name adding parentheses and shows associated doxygen information if any is available.

Current C::B revision (12198) compiled with wx3.1.3 or wx3.1.4 and running on Windows 7 fails. This means:
  - If you write, p.e. print and select printf from the code completion popup, you get printf without parentheses
  - If the function is documented with Doxygen, the documentation is not shown.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #6 on: September 08, 2020, 09:39:55 pm »
I have bounded the problem with two nightlies:
2019/04/20, SVN11628, wx3.1.1 works
2020/02/08, SVN11957, wx3.1.3 does not work

The ones in between lack the wxWidgets files or crash when starting:

Code
codeblocks.exe caused a Stack Overflow at location 000000006C5A0A42 in module wxmsw313u_gcc_cb.dll

This is on Windows 10.

EDIT: SVN11628 works with wx3.1.1, but fails with wx3.1.4
« Last Edit: September 08, 2020, 11:24:04 pm by Miguel Gimenez »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #7 on: September 09, 2020, 02:33:20 pm »
Quote
Keep in mind that there is a big overhaul of the popup code in the wxWidgets we haven't backported, yet.
I started the work, but there were two problems back then - wx2.8 support and compiling some .mm files on macOS.
The former is no longer an issue, the latter still is.

Can you point to a source file or commit of wxWidgets? Or any other point i can look for this?

@Miguel Gimenez
Thank you for the testing. So it seems that it is a problem with the popup code on windows past wx3.1.1

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #8 on: September 09, 2020, 04:14:23 pm »
wxWidgets commit Reimplement wxPopupWindow as a WS_POPUP window under MSW (that went right into wx3.1.2 release) made C::B crash when a popup was about to be shown. This was discussed in ticket 773, https://sourceforge.net/p/codeblocks/tickets/773/

https://github.com/wxWidgets/wxWidgets/commit/56c419116838045f23f046112960d4e42f98f80d

Later NewPagodi restored popup behaviour under MSW with commit Add wxPU_CONTAINS_CONTROLS style for wxPopupWindow

https://github.com/wxWidgets/wxWidgets/commit/07f64c3b75c79b79b46a7e8ac8db585a618c57da

but looks like an event generation (or something similar) was not restored, leaving parentheses generation and documentation popup out of the game.

I have made the bisection between wx3.1.1 and wx3.1.3 using current C::B head, and I have also tested current master just in case; it also fails.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #9 on: September 09, 2020, 08:12:09 pm »
Can you point to a source file or commit of wxWidgets? Or any other point i can look for this?
Nope. git log for the include/stc and src/stc folders in wxWidgets and you'll see it. But the change is massive and it is not the one described by Miguel Gimenez.

I mean "it does what it is supposed to do", i.e. code completion inserts the selected function name adding parentheses and shows associated doxygen information if any is available.
"Works" was directed at BlueHazzard, sorry for not being clear about it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #10 on: September 15, 2020, 04:01:39 pm »
If you edit src/common/popupcmn.cpp in wxMaster and change

Code
bool wxPopupWindowBase::Create(wxWindow* WXUNUSED(parent), int WXUNUSED(flags))
 {
    // By default, block event propagation at this window as it usually
    // doesn't make sense. This notably prevents wxScrolledWindow from trying
    // to scroll popup contents into view if a popup is shown from it but
    // extends beyond its window boundaries.
    SetExtraStyle(GetExtraStyle() | wxWS_EX_BLOCK_EVENTS);

     return true;
 }

to

Code
bool wxPopupWindowBase::Create(wxWindow* WXUNUSED(parent), int WXUNUSED(flags))
 {
     return true;
 }

then documentation popup and parentheses completion work again.

This change was made by Vadz four days after the one that made C::B crash, and wasn't reverted by NewPagodi when he restored wxPopupWindow original behaviour.

https://github.com/wxWidgets/wxWidgets/commit/9562ca2b70c5421a9f3e94d6ea818efad0ac265b#diff-ae8d87556bfe1b32c101c69c2fb1cec4


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #11 on: September 15, 2020, 06:05:31 pm »
So this is a wxWidgets bug?

NewPagodi  introduced new popup code for windows.
This introduced a bug https://trac.wxwidgets.org/ticket/18243
Vadz fixed it with this culprit code,
NewPagodi reverted, but missed the change from vadz?

so this should be reported to wxWidgets?

Edit: How did you even found this :)

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #12 on: September 15, 2020, 07:01:29 pm »
20/10/2018, Vadz changed the popup code. This change made C::B crash when showing a popup

https://github.com/wxWidgets/wxWidgets/commit/56c419116838045f23f046112960d4e42f98f80d

24/10/2018, Vadz blocked event transmission to parents. No apparent side effect, as C::B crashed because of previous commit, but this commit is the real culprit.

https://github.com/wxWidgets/wxWidgets/commit/9562ca2b70c5421a9f3e94d6ea818efad0ac265b

28/01/2019, NewPagodi restores behaviour prior to 20/10/2018 but doesn't revert the 24/10/2018 commit, possibly because he overlooked it. Now C::B does not crash, but documentation popup and parentheses addition fail.

https://github.com/wxWidgets/wxWidgets/commit/07f64c3b75c79b79b46a7e8ac8db585a618c57da

IMHO this should be reported to wxWidgets, unless somebody finds a workaround.

Quote
How did you even found this
The main problem was C::B crashiing between the first and the third commit, so I couldn't use bisection.

I made a diff between the code after the third commit and the code just before the first commit, and then removed all changes not related to popups. As you said it looked like an event problem, so a visual inspection led me to the code blocking event transmission (see line 230 in the attached file)

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Does doxygen documentation window and parenthesis completion work for you?
« Reply #13 on: September 16, 2020, 11:42:03 am »
I made it work, patch posted in ticket 1001 (https://sourceforge.net/p/codeblocks/tickets/1001/)