Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Several improvements to Code Completion plugin
Huki:
Hello,
I've been using CB for a few months now and love it. :) As I started noticing some parsing bugs and areas of improvement in CC features, I decided to take a look at it and have so far managed to fix most of the things I had in mind. I've attached a patch file and commented all my changes, let me know if something is not clear.
To summarize the important changes:
1) Full file parsing (i.e., expand each #include file and recurse), no need to keep priority headers. Previously when the parser finds an #include token, the file was simply added to the end of the parsing queue, so although all the include files are getting parsed anyway, it is done in the wrong order. Now the #include file parsing is done immediately instead of getting queued. It also means there is no need for 3-phase parsing (priority headers, non-priority headers, sources) anymore, simply parsing the source files is enough.
2) The "Grey out inactive code" feature now uses CC plugin support. I had to study carefully the CB SDK vs Scintilla communication to get this done in a clean way. I'm happy with my current implementation but let me know if it needs improvement. Despite the limitations of CC plugin, this feature is working nicely for most practical purposes. In case a token is #defined and used within the same file, their order is checked too. This ensures header files (with header guards) do not get totally greyed out.
3) CC support for DirectX (and related typedefs) and full WinAPI (including macro and function calltips). Parses function pointers and variables defined with constructor (eg., wxString myString(_T("text")); ), recursive union inside union, etc. and several other fixes. Improved tooltip behavior and speed, for both CC and Debugger.
With my 2008 PC (Core 2 Duo 2.6 GHz) and all parsing options enabled (parse global / local headers, preprocessor, complex macros) it takes about 20sec to parse the full CodeBlocks project, not bad at all. :)
All changes are checked with rev 9271.
[attachment deleted by admin]
oBFusCATed:
Can you provide separate patches for all different fixes, so they can be reviewed on a per fix basis?
Reviewing one massive patch is a night mare and minimizes the chance of a fix getting in.
BlueHazzard:
also look at this thread: http://forums.codeblocks.org/index.php/topic,18114.45.html
i think alpha has made some changes, maybe you both can sync your patches (i don't have revised any of the patches, but i thought i will inform you that there is ongoing work on the CC plugin)
--- Quote from: Huki on September 06, 2013, 10:03:35 pm ---With my 2008 PC (Core 2 Duo 2.6 GHz) and all parsing options enabled (parse global / local headers, preprocessor, complex macros) it takes about 20sec to parse the full CodeBlocks project, not bad at all. :)
All changes are checked with rev 9271.
--- End quote ---
these sounds great!
greetings
Huki:
Ok, I'll try to split the patch file for each fix / improvement. Several fixes belong to the same file, but I'll see what I can do.
@BlueHazzard: Thanks for the link, I'm not sure if they are working on the current CC plugin or something new entirely (seems like the latter). Will check it in detail soon. :)
oBFusCATed:
--- Quote from: Huki on September 07, 2013, 06:00:26 am ---Ok, I'll try to split the patch file for each fix / improvement. Several fixes belong to the same file, but I'll see what I can do.
--- End quote ---
You can do it, pretty easily with git and git gui.
You can use the repo at https://github.com/obfuscated/codeblocks_sf
--- Quote from: Huki on September 07, 2013, 06:00:26 am ---@BlueHazzard: Thanks for the link, I'm not sure if they are working on the current CC plugin or something new entirely (seems like the latter). Will check it in detail soon. :)
--- End quote ---
In fact Alpha is extracting some API for writing CC plugins and he is modifying the current CC plugin to use the API.
I've looked at your changes and you're adding something similar, but you're doing it in a pretty unacceptable way (I'm talking about the wxdynamiclib stuff and all the modifications to wxscintilla). But I'm waiting for the separate patches to post some more thorough comments.
Navigation
[0] Message Index
[#] Next page
Go to full version