Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Several improvements to Code Completion plugin
oBFusCATed:
1. Using PluginManager and GetDynamicLibrary is still bad. Please checkout the work done here: https://github.com/alpha0010/codeblocks_sf/tree/cc_interface
This branch tries to implement a CCManager and similar stuff. There is a topic in the forum and I think Ollydbg posted a link to it in a previous comment.
2. You still modify the lexer for C++, why don't you just find the defines for the file after parsing the includes and pass them to Scintilla, I think it is possible.
3. Using char* to store strings is highly discouraged.
4. I think this will be one of the harder to apply patches, because it does weird things in many subsystems. Probably you should concentrate on the simpler things getting in and then this one.
ollydbg:
I got an error when apply one patch:
--- Quote ---$ patch <../patches/CodeBlocks_patch_huki_130906/cc_enum_values.patch -p0
patching file `src/plugins/codecompletion/parser/expression.cpp'
patching file `src/plugins/codecompletion/parser/expression.h'
patch: **** malformed patch at line 36: Index: src/plugins/codecompletion/parser
/parserthread.cpp
--- End quote ---
EDIT: problem solved, I found that an empty line is missing, that is mostly caused by manually editing/spliting the patch file
--- Code: ---@@ -88,7 +88,7 @@
PostfixVector m_PostfixExpression;
InfixVector m_InfixExpression;
- bool m_Result;
+ long m_Result; //MOD(huki), return type was (bool)
bool m_Status;
};
Index: src/plugins/codecompletion/parser/parserthread.cpp
--- End code ---
Note that there should be an empty line before the line "Index:.....".
About other patches:
cc_build_target_handling.patch
If a build target is changed, reparse the whole project, I think it is not necessory. E.g. If we change the build target in Codeblocks.cbp, the whole project get reparsed? That's not necessory I think. If the user do want to a reparse, he can right click on the context menu of the project manager, and select "reparse this project" sub menu.
cc_includes_parsing.patch
I think this is OK, priority header parsing is not needed here. The only issue is that some standalone header files included in a project, but those include files were not used/included in any cpp files, so they will be skipped by the parser.
oBFusCATed:
--- Quote from: ollydbg on September 13, 2013, 04:32:02 pm ---About other patches:
cc_build_target_handling.patch
If a build target is changed, reparse the whole project, I think it is not necessory. E.g. If we change the build target in Codeblocks.cbp, the whole project get reparsed? That's not necessory I think. If the user do want to a reparse, he can right click on the context menu of the project manager, and select "reparse this project" sub menu.
--- End quote ---
ollydbg: The user should never have to click reparse, never, everything should be automatic. We even should remove it.
Also keep in mind that very few people do project management as we do. I'm sure most people use multiple projects+debug/release targets instead of the C::B's approach.
So if this patch helps for such scenarios we should consider it.
ollydbg:
About cc_enum_values.patch
I think it is OK. I see you want to use the expression solver to calculate the enum value, which means if you are going to parse the code:
--- Code: ---enum A
{
x = 1+2;
}
--- End code ---
Then, you will get the correct enum value of x. I think a simple test code is necessary, you can simply follow the file under: \src\plugins\codecompletion\testing, maybe the enumerator.cpp, thanks.
ollydbg:
--- Quote from: oBFusCATed on September 08, 2013, 01:25:57 am ---Hm...
Can you post thorough descriptions for the problems you try to solve with every patch?
Steps to reproduce will be useful, too.
--- End quote ---
About the CC part: I'm interested on the patch: cc_fix_tokenizer.patch, cc_fix_ctor_dtor.patch, thanks. Maybe other cc patches, but I'm not viewing them yet. ;)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version