Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => CodeCompletion redesign => Topic started by: aerea on May 17, 2009, 12:27:50 pm

Title: Redesign
Post by: aerea on May 17, 2009, 12:27:50 pm
Hi all,

I would like to begin redesigning the Code Completion plugin.  I use Codeblocks frequently and find this a severely limiting feature when compared to Visual Studio (as well as the lack of support for background color options, but that's another topic).  Has anyone already began this, or would it be appreciated if I started?
Title: Re: Redesign
Post by: ollydbg on May 17, 2009, 02:05:08 pm
Great!
I'm happy to hear that someone want to redesign it. But it seems a bit complicated. I have write a little wiki page about the current architecture, but not sure it can help. :D
Title: Re: Redesign
Post by: MortenMacFly on May 18, 2009, 08:37:55 am
Has anyone already began this, or would it be appreciated if I started?
Not really, but internally we are already using a heavily modified version of CC. Hence this requires the wxAUI branch to work so it's not published officially. Hence any help is welcome. CC (even modified) still needs improvement. So if you are willing to work on the wxAUI branch I can provide you with the patch / modified sources.
Title: Re: Redesign
Post by: aerea on May 18, 2009, 09:20:07 am
Alright, well, I've begun development.  I figured I'd spin in circles in the beginning since I've never done any CodeBlocks plugin development before, so I just started off as I created a library which I can link to later.

I'm starting off from scratch using ANTLR to parse the grammar.  I'm working with the C preprocessor now since I understand macros and defines are a huge shortfall.  I'll be populating a tree structure that can be walked through the GUI side.  I envision something like this:

CC has two components: A Parser and Data storage functions.  The GUI calls the CC library with a pointer to a memory buffer and pointer to store resulting tree data.  If the GUI exits, the tree data can be saved outright to a file and reopened later; if a file is changed, every file that references the changed file is reprocessed in the background.  This way, large projects only need to be parsed once.  If there is no data found on startup, n different threads will each parse the files (likely configurable).  Any other ideas?

I can tokenize the C++, but I need to actually store everything and get it to interact with the preprocessor (i.e. #ifndefs).

In cases where I can sacrifice a bit of memory for speed, I have.

Just a warning: I work full-time, so it's unlikely everything'll be done next week :-).
Title: Re: Redesign
Post by: oBFusCATed on May 18, 2009, 12:30:39 pm
/OFF

Not really, but internally we are already using a heavily modified version of CC. Hence this requires the wxAUI branch to work so it's not published officially. Hence any help is welcome. CC (even modified) still needs improvement. So if you are willing to work on the wxAUI branch I can provide you with the patch / modified sources.

Is there more info (TODO, thread, plan) about the wxAUI branch?

/OFF
Title: Re: Redesign
Post by: MortenMacFly on May 18, 2009, 01:10:25 pm
Is there more info (TODO, thread, plan) about the wxAUI branch?
Not really.
In fact will discuss when exactly we do the merge as this affects the SDK and thus s proper release heavily.
The general plan is to merge as soon as the branch becomes stable (which it is IMHO) and tested intensively by many users. That's the current bottleneck: Not all devs do work with this branch so we are just careful with merging.
Title: Re: Redesign
Post by: Dr.Optix on June 09, 2009, 09:52:10 pm
I just got the latest C::B SVN and successfully built it, I'm gona try some mods for the CodeCompletion so that it parse templates but other situations in a right way. If I'll be able to come up with something I will release a patch for jens or other dev to test and maybe commit it.

~Dr.Optix
Title: Re: Redesign
Post by: MortenMacFly on June 10, 2009, 06:56:51 am
I'm gona try some mods for the CodeCompletion so that it parse templates but other situations in a right way.
Be careful: There is already some work done. please check the patch tracker before you start implementing the wheel twice... ;-)
Title: Re: Redesign
Post by: Dr.Optix on June 10, 2009, 10:22:18 am
I'm gona try some mods for the CodeCompletion so that it parse templates but other situations in a right way.
Be careful: There is already some work done. please check the patch tracker before you start implementing the wheel twice... ;-)

Understood Morten :)
Title: Re: Redesign
Post by: Dr.Optix on June 10, 2009, 03:03:11 pm
Checked patch list on BerliOS and as i can see [ Patch #2624 ] Code completion improvement.

Is complete CodeCopletion. I'm gona test it with anonymous structs, nested structs templates and other stuff that cause trouble in current version from trunk

http://developer.berlios.de/patch/?func=detailpatch&patch_id=2624&group_id=5358 (http://developer.berlios.de/patch/?func=detailpatch&patch_id=2624&group_id=5358)

Also adding patches with Tortoise SVN make me say rage when itshout that there are conflict between current trunk and the patch, it seems that i still need to learn about SVN but more how SVN patches are created
Title: Re: Redesign
Post by: ollydbg on June 10, 2009, 03:11:08 pm
Is complete CodeCopletion. I'm gona test it with anonymous structs, nested structs templates and other stuff that cause trouble in current version from trunk
Sorry, I can't fully understand the meaning of "Is complete CodeCompletion" ?

AFAIK, in that patch you mentioned, the author add many stuffs such as "sort" the list entry, also many context menu item was added. But nothing to do with parsing templates.