Author Topic: Stage 1 completed!  (Read 39858 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Stage 1 completed!
« on: January 11, 2006, 07:58:42 am »
Good news people! I have finished Stage 1 of the code completion redesign. After fixing the crashes, hangs and unexpected exceptions ( :mrgreen: ), I managed to optimize most of the Codecompletion plugin. You'll notice a significant speed-up related to previous versions - specially when saving files.

I'll commit as soon as I finish recompiling latest SVN :eek: and test.

Benchmarks welcome :)

Post-Edit notes:
1) Warning! I may have possibly caused one or two unicode bugs since my C::B version is ANSI (i needed to debug some strings and unicode had a bug in there). But I can't wait anymore to commit, i'm sure any unicode-related bugs can be fixed in very little time.

2) Tested - ANSI version works like charm! :D I also removed redundant categories from the symbols (i.e. classes, defines, others) if they contain no tokens. I'll commit now :)

3) Oops, I forgot to mention... the Load/Save progress dialog of the codecompletion cache has been wiped out. Anyway i really hope you don't miss it, because:

 Done parsing project Code::Blocks ANSI (wx2.6) (485 total parsed files, 14999 tokens in 0.813 seconds).
<- and that's unoptimized :D

4) Hit my first bug :( Apparently, when loading the cache, the class browser isn't updated. This is bad! :( I need some help with this guys. Probably an event not triggered or something. In any case, i'll still commit. I'm sure we can spare the cache for now. Sorry :?
« Last Edit: January 11, 2006, 08:13:57 am by rickg22 »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Stage 1 completed!
« Reply #1 on: January 11, 2006, 08:19:54 am »
Commited (revision 1711  ). Enjoy :)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Stage 1 completed!
« Reply #2 on: January 11, 2006, 10:08:57 am »
That's just great Rick. Thanks :D
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Stage 1 completed!
« Reply #3 on: January 11, 2006, 02:35:04 pm »
Feedback: "Search->Go to function" no longer works...
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Stage 1 completed!
« Reply #4 on: January 11, 2006, 05:32:14 pm »
Ouch. OK, i'll see what I can do. Just a question, is the said function present in the class browser, or it's gone (as if the token wasn't generated in the first place)?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Stage 1 completed!
« Reply #5 on: January 12, 2006, 06:18:41 pm »
Update: Apparently the cache problem is more complicated than i thought :( But I spotted two bugs already! :)

1) When loading from the cache, the tree pointer is still uninitialized in the tokens, so that's the reason for the crash if you invoce codecompletion when cached. This one's very easy to fix.

2) The namespaces and global namespace list isn't updated when loading from the cache. This could be the bug responsible for the class browser not being updated. I'll see if these objects can be updated in the token addition instead of afterwards.

I'll fix them tonight.
« Last Edit: January 12, 2006, 06:20:14 pm by rickg22 »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Stage 1 completed!
« Reply #6 on: January 12, 2006, 06:28:03 pm »
Fix "Search->Go to function" please. I can't work without it :P

Btw, you did notice I added support for unicode wxStrings in the debugger, didn't you?
I bet you would now like STL support too, right? ;)
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Stage 1 completed!
« Reply #7 on: January 12, 2006, 06:36:51 pm »
Fix "Search->Go to function" please. I can't work without it :P

Nevermind, I 've fixed it myself :)
In Parser::ParseBufferForFunctions replace
Quote
   ParserThread* thread = new ParserThread(this,&this->m_abort_flag,
                                 wxEmptyString,
                                 false,
                                 opts,
                                 m_pTokens);

with
Quote
   ParserThread* thread = new ParserThread(this,&this->m_abort_flag,
                                 wxEmptyString,
                                 false,
                                 opts,
                                 m_pTempTokens);
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Stage 1 completed!
« Reply #8 on: January 12, 2006, 08:05:02 pm »
Nevermind, I 've fixed it myself :)

Thanks! :D One less problem to worry about. Please commit it, since in last night's fix-attempt i modified too much code unnecessarily, so i'll have to update.

Oh btw... I search for funtions using ctrl-f :P (no kidding :shock: )
« Last Edit: January 12, 2006, 08:06:58 pm by rickg22 »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Stage 1 completed!
« Reply #9 on: January 12, 2006, 08:07:32 pm »
Oh btw... I search for funtions using ctrl-f :P (no kidding :shock: )

It's the same thing but it only takes 2-3 keypresses usually, instead of typing the whole function name ;)
Be patient!
This bug will be fixed soon...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Stage 1 completed!
« Reply #10 on: January 12, 2006, 08:21:49 pm »
About that, I sent you a PM about a new feature request.  :) You'll like the idea.
Edit: nevermind... i tried the goto function now :P
« Last Edit: January 13, 2006, 08:40:04 am by rickg22 »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Stage 1 completed!
« Reply #11 on: January 13, 2006, 08:44:03 am »
Caché loading is finally fixed! :D

There was a problem with LoadIntFromFile... apparently the -1 was read as -256. Yianniis, any idea of why this happens?

In any case, i replaced the "== -1", for "< 0" and now works like charm. Yes, creepy. :shock:

Offline Raindog

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Stage 1 completed!
« Reply #12 on: January 18, 2006, 04:05:08 am »
This code is in the latest SVN head, or the code that is published in the nightly builds?

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Stage 1 completed!
« Reply #13 on: January 18, 2006, 04:29:30 am »
The Nightly Builds are compiled from SVN head. Last post, from January 13, says something was fixed, so any Nightly Build after that date (maybe including) will have those fixes.

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Stage 1 completed!
« Reply #14 on: January 19, 2006, 08:46:57 am »
I am having a problem with a codecompletion (rev 1800) following project following includes right.  I hav the following directory structure:
Code
/math
  /include
  /src
  Math.cbp
/common
  /include
  /src
/test
  /src
    mathtest.cpp
  tests.cbp

The tests.cbp project has these includes ../common/include and ../math/include (on the one and only target in the file), but every time I tell the parser to follow local and global includes it still doesn't get any symbols from those headers.  It doesn't seem to parser them at all.  If I open up the Math.cbp project it parsed all the headers that are its files fine, but it to doesn't follow the ../common/include (which is global includes for all targets in the project) path to parse those files.