Author Topic: [SOLVED]Code Completion in toolbar  (Read 3261 times)

Offline qtreez

  • Multiple posting newcomer
  • *
  • Posts: 20
[SOLVED]Code Completion in toolbar
« on: March 01, 2015, 01:44:06 pm »
Hi.
My problem is that the plugin "Code Completion" in toolbar is not working properly. Not all methods are listed. But in Symbols tab in Management pane there are. This applies to a class that inherits from wxFrame (I use the wxWidgets framework). In my own class (not inherit) the problem does not occur.
This screenshot illustrate what I wanted to convey.

« Last Edit: March 01, 2015, 05:10:40 pm by qtreez »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code Completion in toolbar
« Reply #1 on: March 01, 2015, 03:05:16 pm »
Hi.
My problem is that the plugin "Code Completion" in toolbar is not working properly. Not all methods are listed. But in Symbols tab in Management pane there are. This applies to a class that inherits from wxFrame (I use the wxWidgets framework). In my own class (not inherit) the problem does not occur.
This screenshot illustrate what I wanted to convey.
From the image shot, I see it is a bug.
I know that CodeCompletion plugin use two different ways to generate the items in toolbar and symbol browser tree. But I'm not quite understand those mechanism, so I won't help much to solve this problem soon. Sorry.
Maybe, you can file a bug report here: Tickets, so this bug don't get lost. It will simply get lost in our forum. Thank you!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline qtreez

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Code Completion in toolbar
« Reply #2 on: March 01, 2015, 03:26:28 pm »
Now also noticed that the implementation of "the symbol browser tree" also has bugs. Context menu does not have the "Jump to implementation 'button. Only Jump to declaration. This applies to the same case about which I wrote in the first post.

The culprit is the stuff:
Code
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
    *
    *
    *
wxEND_EVENT_TABLE()

Workaround is put it at the end of source file.
« Last Edit: March 01, 2015, 03:48:50 pm by qtreez »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code Completion in toolbar
« Reply #3 on: March 01, 2015, 04:07:26 pm »
I tested, and works fine here, but I have
Code
BEGIN_EVENT_TABLE(wx3_hangFrame,wxFrame)
...
END_EVENT_TABLE()
You may need to add some custom replace rules in CodeCompletion plugin setting dialog. I have:
Code
BEGIN_EVENT_TABLE ->  -END_EVENT_TABLE
So, you may need to have
Code
wxBEGIN_EVENT_TABLE -> -wxEND_EVENT_TABLE
Our parser just skip those blocks.

BTW: In the future, those manually replace rules will be totally removed, see discussion: Macro expansion infinite loop.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline qtreez

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Code Completion in toolbar
« Reply #4 on: March 01, 2015, 04:38:22 pm »
This and reparsing project solve my problem.
Thanks :)