<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stevenkaras</id>
	<title>Code::Blocks - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stevenkaras"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php/Special:Contributions/Stevenkaras"/>
	<updated>2026-05-02T12:21:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5432</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5432"/>
		<updated>2008-03-16T03:16:41Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you'll find some discussion on the Code::Completion rewrite, and some useful links to related materials online.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
* The user requests a completion of the current symbol.&lt;br /&gt;
** Call CC::EventSymbolHover&lt;br /&gt;
*** When the mouse hovers over a symbol after a timeout&lt;br /&gt;
** Call CC::EventSymbolTip&lt;br /&gt;
*** When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
*** When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
** Call CC::EventCallTip&lt;br /&gt;
*** When the user types in any of the following: ( ,&lt;br /&gt;
*** When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
** Call CC::EventPreprocTip&lt;br /&gt;
*** When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
* the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
* Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
* Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
* global namespace&lt;br /&gt;
* local scope (2 options)&lt;br /&gt;
** the local scope can be generated by smartly parsing the current file on every request&lt;br /&gt;
** keep a running count, and add/remove symbols from the table as the file is edited&lt;br /&gt;
* class scope&lt;br /&gt;
&lt;br /&gt;
Here's a good link for further reading on the subject and the problems:&lt;br /&gt;
[http://en.wikipedia.org/wiki/C%2B%2B#Parsing_and_processing_C.2B.2B_source_code On Wikipedia]&lt;br /&gt;
&lt;br /&gt;
==== Data Proposal ====&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some extra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Hidden virtual functions ===&lt;br /&gt;
&lt;br /&gt;
 class Base&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     virtual void stam(int);&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Derived : Base&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void stam(double, int);&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 main()&lt;br /&gt;
 {&lt;br /&gt;
     Base * pBase = new Derived;&lt;br /&gt;
     pBase-&amp;gt;'''stam('''&lt;br /&gt;
                ^ Function tip should show stam(double, int)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Macros hiding include files ===&lt;br /&gt;
in header.h&lt;br /&gt;
 int x;&lt;br /&gt;
in main.cpp&lt;br /&gt;
 #define myHeader &amp;quot;header.h&amp;quot;&lt;br /&gt;
 #include myHeader&lt;br /&gt;
 &lt;br /&gt;
 main()&lt;br /&gt;
 {&lt;br /&gt;
     int '''x''';&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5431</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5431"/>
		<updated>2008-03-16T02:09:27Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Hidden virtual functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
* The user requests a completion of the current symbol.&lt;br /&gt;
** Call CC::EventSymbolHover&lt;br /&gt;
*** When the mouse hovers over a symbol after a timeout&lt;br /&gt;
** Call CC::EventSymbolTip&lt;br /&gt;
*** When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
*** When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
** Call CC::EventCallTip&lt;br /&gt;
*** When the user types in any of the following: ( ,&lt;br /&gt;
*** When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
** Call CC::EventPreprocTip&lt;br /&gt;
*** When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
* the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
* Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
* Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
* global namespace&lt;br /&gt;
* local scope (2 options)&lt;br /&gt;
** the local scope can be generated by smartly parsing the current file on every request&lt;br /&gt;
** keep a running count, and add/remove symbols from the table as the file is edited&lt;br /&gt;
* class scope&lt;br /&gt;
&lt;br /&gt;
Here's a good link for further reading on the subject and the problems:&lt;br /&gt;
[http://en.wikipedia.org/wiki/C%2B%2B#Parsing_and_processing_C.2B.2B_source_code On Wikipedia]&lt;br /&gt;
&lt;br /&gt;
==== Data Proposal ====&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some extra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Hidden virtual functions ===&lt;br /&gt;
&lt;br /&gt;
 class Base&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     virtual void stam(int);&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Derived : Base&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void stam(double, int);&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 main()&lt;br /&gt;
 {&lt;br /&gt;
     Base * pBase = new Derived;&lt;br /&gt;
     pBase-&amp;gt;'''stam('''&lt;br /&gt;
                ^ Function tip should show stam(double, int)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Macros hiding include files ===&lt;br /&gt;
in header.h&lt;br /&gt;
 int x;&lt;br /&gt;
in main.cpp&lt;br /&gt;
 #define myHeader &amp;quot;header.h&amp;quot;&lt;br /&gt;
 #include myHeader&lt;br /&gt;
 &lt;br /&gt;
 main()&lt;br /&gt;
 {&lt;br /&gt;
     int '''x''';&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5430</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5430"/>
		<updated>2008-03-16T01:47:39Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Hidden virtual functions */ fixed formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
* The user requests a completion of the current symbol.&lt;br /&gt;
** Call CC::EventSymbolHover&lt;br /&gt;
*** When the mouse hovers over a symbol after a timeout&lt;br /&gt;
** Call CC::EventSymbolTip&lt;br /&gt;
*** When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
*** When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
** Call CC::EventCallTip&lt;br /&gt;
*** When the user types in any of the following: ( ,&lt;br /&gt;
*** When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
** Call CC::EventPreprocTip&lt;br /&gt;
*** When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
* the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
* Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
* Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
* global namespace&lt;br /&gt;
* local scope (2 options)&lt;br /&gt;
** the local scope can be generated by smartly parsing the current file on every request&lt;br /&gt;
** keep a running count, and add/remove symbols from the table as the file is edited&lt;br /&gt;
* class scope&lt;br /&gt;
&lt;br /&gt;
Here's a good link for further reading on the subject and the problems:&lt;br /&gt;
[http://en.wikipedia.org/wiki/C%2B%2B#Parsing_and_processing_C.2B.2B_source_code On Wikipedia]&lt;br /&gt;
&lt;br /&gt;
==== Data Proposal ====&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some extra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Hidden virtual functions ===&lt;br /&gt;
&lt;br /&gt;
 class Base&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     virtual void stam(int);&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Derived : Base&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void stam(double, int);&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 main()&lt;br /&gt;
 {&lt;br /&gt;
     Base * pBase = new Derived;&lt;br /&gt;
     pBase-&amp;gt;'''stam('''&lt;br /&gt;
                ^ Function tip should show stam(double, int)&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5429</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5429"/>
		<updated>2008-03-16T01:42:40Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Code::SymbolTable */ Added Wikipedia reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
* The user requests a completion of the current symbol.&lt;br /&gt;
** Call CC::EventSymbolHover&lt;br /&gt;
*** When the mouse hovers over a symbol after a timeout&lt;br /&gt;
** Call CC::EventSymbolTip&lt;br /&gt;
*** When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
*** When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
** Call CC::EventCallTip&lt;br /&gt;
*** When the user types in any of the following: ( ,&lt;br /&gt;
*** When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
** Call CC::EventPreprocTip&lt;br /&gt;
*** When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
* the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
* Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
* Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
* global namespace&lt;br /&gt;
* local scope (2 options)&lt;br /&gt;
** the local scope can be generated by smartly parsing the current file on every request&lt;br /&gt;
** keep a running count, and add/remove symbols from the table as the file is edited&lt;br /&gt;
* class scope&lt;br /&gt;
&lt;br /&gt;
Here's a good link for further reading on the subject and the problems:&lt;br /&gt;
[http://en.wikipedia.org/wiki/C%2B%2B#Parsing_and_processing_C.2B.2B_source_code On Wikipedia]&lt;br /&gt;
&lt;br /&gt;
==== Data Proposal ====&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some extra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Hidden virtual functions ===&lt;br /&gt;
&lt;br /&gt;
class Base&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
virtual void stam(int);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
class Derived : Base&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
void stam(double, int);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
    Base * pBase = new Derived;&lt;br /&gt;
    pBase-&amp;gt;'''stam('''&lt;br /&gt;
               ^ Function tip should show stam(double, int)&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5428</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5428"/>
		<updated>2008-03-16T01:38:20Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* More complex cases of C::C usage */  Removed numbers from section headers, added new case&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
* The user requests a completion of the current symbol.&lt;br /&gt;
** Call CC::EventSymbolHover&lt;br /&gt;
*** When the mouse hovers over a symbol after a timeout&lt;br /&gt;
** Call CC::EventSymbolTip&lt;br /&gt;
*** When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
*** When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
** Call CC::EventCallTip&lt;br /&gt;
*** When the user types in any of the following: ( ,&lt;br /&gt;
*** When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
** Call CC::EventPreprocTip&lt;br /&gt;
*** When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
* the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
* Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
* Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
* global namespace&lt;br /&gt;
* local scope (2 options)&lt;br /&gt;
** the local scope can be generated by smartly parsing the current file on every request&lt;br /&gt;
** keep a running count, and add/remove symbols from the table as the file is edited&lt;br /&gt;
* class scope&lt;br /&gt;
&lt;br /&gt;
Here's the current data proposal:&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some extra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Hidden virtual functions ===&lt;br /&gt;
&lt;br /&gt;
class Base&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
virtual void stam(int);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
class Derived : Base&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
void stam(double, int);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
    Base * pBase = new Derived;&lt;br /&gt;
    pBase-&amp;gt;'''stam('''&lt;br /&gt;
               ^ Function tip should show stam(double, int)&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5427</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5427"/>
		<updated>2008-03-16T01:27:52Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
* The user requests a completion of the current symbol.&lt;br /&gt;
** Call CC::EventSymbolHover&lt;br /&gt;
*** When the mouse hovers over a symbol after a timeout&lt;br /&gt;
** Call CC::EventSymbolTip&lt;br /&gt;
*** When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
*** When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
** Call CC::EventCallTip&lt;br /&gt;
*** When the user types in any of the following: ( ,&lt;br /&gt;
*** When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
** Call CC::EventPreprocTip&lt;br /&gt;
*** When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
* the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
* Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
* Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
* global namespace&lt;br /&gt;
* local scope (2 options)&lt;br /&gt;
** the local scope can be generated by smartly parsing the current file on every request&lt;br /&gt;
** keep a running count, and add/remove symbols from the table as the file is edited&lt;br /&gt;
* class scope&lt;br /&gt;
&lt;br /&gt;
Here's the current data proposal:&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some extra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 3: Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 4. Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 5. Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 6. Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5426</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5426"/>
		<updated>2008-03-16T01:25:53Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Code::SymbolTable */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
* The user requests a completion of the current symbol.&lt;br /&gt;
** Call CC::EventSymbolHover&lt;br /&gt;
*** When the mouse hovers over a symbol after a timeout&lt;br /&gt;
** Call CC::EventSymbolTip&lt;br /&gt;
*** When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
*** When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
** Call CC::EventCallTip&lt;br /&gt;
*** When the user types in any of the following: (&lt;br /&gt;
*** When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
** Call CC::EventPreprocTip&lt;br /&gt;
*** When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
* the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
* Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
* Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
* global namespace&lt;br /&gt;
* local scope (2 options)&lt;br /&gt;
** the local scope can be generated by smartly parsing the current file on every request&lt;br /&gt;
** keep a running count, and add/remove symbols from the table as the file is edited&lt;br /&gt;
* class scope&lt;br /&gt;
&lt;br /&gt;
Here's the current data proposal:&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some extra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 3: Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 4. Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 5. Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 6. Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5425</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5425"/>
		<updated>2008-03-16T01:23:19Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
* The user requests a completion of the current symbol.&lt;br /&gt;
** Call CC::EventSymbolHover&lt;br /&gt;
*** When the mouse hovers over a symbol after a timeout&lt;br /&gt;
** Call CC::EventSymbolTip&lt;br /&gt;
*** When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
*** When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
** Call CC::EventCallTip&lt;br /&gt;
*** When the user types in any of the following: (&lt;br /&gt;
*** When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
** Call CC::EventPreprocTip&lt;br /&gt;
*** When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
* the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
* Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
* Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
# global namespace&lt;br /&gt;
# local scope&lt;br /&gt;
# class scope&lt;br /&gt;
&lt;br /&gt;
Here's the current data proposal:&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some estra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 3: Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 4. Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 5. Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 6. Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5424</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5424"/>
		<updated>2008-03-16T01:22:42Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
# The user requests a completion of the current symbol.&lt;br /&gt;
## Call CC::EventSymbolHover&lt;br /&gt;
### When the mouse hovers over a symbol after a timeout&lt;br /&gt;
## Call CC::EventSymbolTip&lt;br /&gt;
### When the user types in any of the following: . :: -&amp;gt;&lt;br /&gt;
### When the user presses the keystroke CTRL-SPACE&lt;br /&gt;
## Call CC::EventCallTip&lt;br /&gt;
### When the user types in any of the following: (&lt;br /&gt;
### When the user presses the keystroke CTRL-SHIFT-SPACE&lt;br /&gt;
## Call CC::EventPreprocTip&lt;br /&gt;
### When the user types in any of the following: &amp;lt; &amp;quot; when in preproc context (# at the start of the line)&lt;br /&gt;
# the C::C plugin determines the proper scope, when applicable (global, local, class)&lt;br /&gt;
# Compare the current symbol against the symbol table of proper scope.&lt;br /&gt;
# Provide a composite list to the user.&lt;br /&gt;
&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
# global namespace&lt;br /&gt;
# local scope&lt;br /&gt;
# class scope&lt;br /&gt;
&lt;br /&gt;
Here's the current data proposal:&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some estra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 3: Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 4. Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 5. Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 6. Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5423</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5423"/>
		<updated>2008-03-16T01:09:07Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Purpose Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide variable tooltips&lt;br /&gt;
** type and modifiers&lt;br /&gt;
** scope&lt;br /&gt;
* Provide preprocessor tooltips&lt;br /&gt;
** replacement value of a macro&lt;br /&gt;
** parameter list when applicable&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
# global namespace&lt;br /&gt;
# local scope&lt;br /&gt;
# class scope&lt;br /&gt;
&lt;br /&gt;
Here's the current data proposal:&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some estra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 3: Automated deduction of template arguments from passed function arguments ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
 	public:&lt;br /&gt;
 		void SomeFunction()  { printf(&amp;quot;SomeFunction\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; T&amp;amp; Function( T&amp;amp; arg )&lt;br /&gt;
 {&lt;br /&gt;
 	return arg;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
 	Class f;&lt;br /&gt;
 	Function(f).'''SomeFunction'''();&lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 4. Template arguments for templates ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; template&amp;lt;class&amp;gt; class InternalTemplate, typename Type &amp;gt; class Test&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         InternalTemplate&amp;lt;Type&amp;gt; m_Member;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class TestInt&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         T m_IntMember;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Class&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         void Print() { printf(&amp;quot;Class::Print\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main( int, char** )&lt;br /&gt;
 {&lt;br /&gt;
     Test&amp;lt;TestInt,Class&amp;gt; Object;&lt;br /&gt;
     Object.m_Member.'''m_IntMember'''.'''Print'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 5. Partial specializations ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt; class T &amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void Print() { printf(&amp;quot;Generic specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 template&amp;lt;&amp;gt; class Template&amp;lt;float&amp;gt;&lt;br /&gt;
 {&lt;br /&gt;
     public:&lt;br /&gt;
         void PrintFloat() { printf(&amp;quot;Partial specialization\n&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;int&amp;gt; TInt;&lt;br /&gt;
     TInt.'''Print'''();         // PrintFloat() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     Template&amp;lt;float&amp;gt; TFloat;&lt;br /&gt;
     TFloat.'''PrintFloat'''();  // Print() should not be available here&lt;br /&gt;
 &lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 6. Advanced template argument deduction ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Class encapsulating function without arguments&lt;br /&gt;
 class Caller0&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( void );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller0( void (* Func )( void ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call0() { m_Func(); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; class Caller1&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller1( void (* Func )( T ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call1() { m_Func( T() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // Template for class encapsulating function with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; class Caller2&lt;br /&gt;
 {&lt;br /&gt;
         void (* m_Func )( T1, T2 );&lt;br /&gt;
 &lt;br /&gt;
     public:&lt;br /&gt;
 &lt;br /&gt;
         Caller2( void (* Func )( T1, T2 ) ) : m_Func(Func) {}&lt;br /&gt;
 &lt;br /&gt;
         void Call2() { m_Func ( T1(), T2() ); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions without arguments&lt;br /&gt;
 Caller0 Invoke( void (* Func )( void ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller0( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with one argument&lt;br /&gt;
 template &amp;lt; class T &amp;gt; Caller1&amp;lt;T&amp;gt; Invoke( void (* Func )( T ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller1&amp;lt;T&amp;gt;( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // This one will be used for functions with two arguments&lt;br /&gt;
 template &amp;lt; class T1, class T2 &amp;gt; Caller2&amp;lt;T1,T2&amp;gt; Invoke( void (* Func )( T1, T2 ) )&lt;br /&gt;
 {&lt;br /&gt;
     return Caller2&amp;lt;T1,T2&amp;gt; ( Func );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function0(void)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function0\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function1(float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function1\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function2(int)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function2\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void Function3(int,float)&lt;br /&gt;
 {&lt;br /&gt;
     printf(&amp;quot;Function3\n&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Invoke( Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( Function3 ).'''Call2'''();&lt;br /&gt;
 &lt;br /&gt;
     Invoke( &amp;amp;Function0 ).'''Call0'''();&lt;br /&gt;
     Invoke( &amp;amp;Function1 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function2 ).'''Call1'''();&lt;br /&gt;
     Invoke( &amp;amp;Function3 ).'''Call2'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5402</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5402"/>
		<updated>2008-03-11T16:09:19Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Current Effort */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Code::Completion ===&lt;br /&gt;
==== Purpose Statement ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Process ====&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
=== Code::SymbolTable ===&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
# global namespace&lt;br /&gt;
# local scope&lt;br /&gt;
# class scope&lt;br /&gt;
&lt;br /&gt;
Here's the current data proposal:&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some estra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5401</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5401"/>
		<updated>2008-03-11T16:07:44Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Code::SymbolTable */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Purpose Statement ===&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
=== Process ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
&lt;br /&gt;
There will be 3 symbol lists:&lt;br /&gt;
# global namespace&lt;br /&gt;
# local scope&lt;br /&gt;
# class scope&lt;br /&gt;
&lt;br /&gt;
Here's the current data proposal:&lt;br /&gt;
&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the workspace&lt;br /&gt;
     int    file_id;           // Id of file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     flags  modifiers;         // Bitfield used to mark some estra properties of symbol&lt;br /&gt;
                               // like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol&lt;br /&gt;
                               // (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // See table below&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 class list_entry&lt;br /&gt;
 {&lt;br /&gt;
     int    symbol_id;         // ID of the symbol referenced&lt;br /&gt;
     int    storage_class;     // Storage class of the symbol (private/protected/public)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Explanation of symbol::extra_lists[]&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border: 1px solid gray; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background: #ececec; border: 1px solid gray;&amp;quot;&lt;br /&gt;
! type&lt;br /&gt;
! modifiers&lt;br /&gt;
! value_type_id&lt;br /&gt;
! extra_type&lt;br /&gt;
! children&lt;br /&gt;
! extra_lists[0]&lt;br /&gt;
! extra_lists[1]&lt;br /&gt;
! extra_lists[2]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| namespace&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| declarations in namespace&lt;br /&gt;
|&amp;quot;using&amp;quot; namespaces&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| class / struct / union&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| members of class&lt;br /&gt;
| base classes&lt;br /&gt;
| template args&lt;br /&gt;
| friends of class&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| variable&lt;br /&gt;
| extern, static, volatile, const&lt;br /&gt;
| type of variable&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| function&lt;br /&gt;
| static, inline, const ...&lt;br /&gt;
| returned value&lt;br /&gt;
|&lt;br /&gt;
| arguments&lt;br /&gt;
| template arguments&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typedef&lt;br /&gt;
| pointer, array, reference, pointer_to_member&lt;br /&gt;
| base type&lt;br /&gt;
| type of class in pointer_to_member&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| items in enum&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| enum item&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| id of enum&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| macro parts&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| macro part&lt;br /&gt;
| arg_to_string, va_args&lt;br /&gt;
| number of arg or -1&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Comments:&lt;br /&gt;
* Such representation would require some extra &amp;quot;hidden&amp;quot; symbols - for example when some complex type is returned from function, extra symbol of typedef representing proper value would be required.&lt;br /&gt;
* Also in case of templates, typeid's should be threated in special way - negative value could mean to use template argument instead of some real type. Base types (the POD ones) should have some predefined type ids.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
* why are we storing filepos_end? Wouldn't it be much more useful to store declaration, definition info?&lt;br /&gt;
&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5400</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5400"/>
		<updated>2008-03-11T15:44:23Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Current Effort */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Purpose Statement ===&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
=== Process ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the project&lt;br /&gt;
     int    file_id;           // if od file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     int    modifiers;         // Bitfield used to mark some estra properties of symbol like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // Some extra lists which can provide additional symbols depending on type of current&lt;br /&gt;
                               // symbol - like list of base classes or list of template arguments, maybe we could give&lt;br /&gt;
                               // more than 3 lists, but I didn't found any reason for that now.&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5399</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5399"/>
		<updated>2008-03-11T15:14:40Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Code::SymbolTable */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Purpose Statement ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
=== Process ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
 class symbol&lt;br /&gt;
 {&lt;br /&gt;
     string name;              // name of the symbol&lt;br /&gt;
     int    id;                // Id of the symbol, should be unique in the project&lt;br /&gt;
     int    file_id;           // if od file where the symbol has been declared&lt;br /&gt;
     int    filepos_begin;     // Position where declaration of the symbol starts&lt;br /&gt;
     int    filepos_end;       // Position where declaration of the symbol ends&lt;br /&gt;
     int    type;              // Type of the symbol: macro / class / typedef / variable / function&lt;br /&gt;
     int    modifiers;         // Bitfield used to mark some estra properties of symbol like that it is static or inline&lt;br /&gt;
     int    value_type_id;     // Id of symbol which represents c++ type of current symbol (like type of variable or type of returned value from function)&lt;br /&gt;
     int    extra_type_id;     // Extra type used in some cases&lt;br /&gt;
     list   children;          // List of child elements of this symbol (members in class etc)&lt;br /&gt;
     list   extra_lists[3];    // Some extra lists which can provide additional symbols depending on type of current&lt;br /&gt;
                               // symbol - like list of base classes or list of template arguments, maybe we could give&lt;br /&gt;
                               // more than 3 lists, but I didn't found any reason for that now.&lt;br /&gt;
     map    extra_values;      // int -&amp;gt; string map which can keep some extra data&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5398</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5398"/>
		<updated>2008-03-11T15:10:48Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* More complex cases of C::C usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Purpose Statement ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
=== Process ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more complex examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Using_STLFilt_with_MinGW&amp;diff=5397</id>
		<title>Using STLFilt with MinGW</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Using_STLFilt_with_MinGW&amp;diff=5397"/>
		<updated>2008-03-11T15:09:54Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the '''Sandbox''' where you can edit until your heart's content. Check out the 'edit' link at the top of this page to play around in here.&lt;br /&gt;
&lt;br /&gt;
== Italic Text ==&lt;br /&gt;
&lt;br /&gt;
Look at the ''italic text''.&lt;br /&gt;
&lt;br /&gt;
== Bold Text ==&lt;br /&gt;
&lt;br /&gt;
Look at the '''bold text'''.&lt;br /&gt;
&lt;br /&gt;
== Lists ==&lt;br /&gt;
&lt;br /&gt;
*Lists are easy.&lt;br /&gt;
**Really easy.&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
Some images....&lt;br /&gt;
&lt;br /&gt;
[[Image:Chk.png]]&lt;br /&gt;
[[Image:Nop.png]]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
Links to other pages, external sites. etc&lt;br /&gt;
&lt;br /&gt;
Link to page in this wiki&lt;br /&gt;
[[Installing Code::Blocks from source]]&lt;br /&gt;
&lt;br /&gt;
Link with no title&lt;br /&gt;
[http://www.google.com]&lt;br /&gt;
Link with title&lt;br /&gt;
[http://www.google.com The Google Search engine]&lt;br /&gt;
&lt;br /&gt;
Link to category (note the initial colon)&lt;br /&gt;
[[:Category:Installation\Build Instructions]]&lt;br /&gt;
&lt;br /&gt;
To categorize a page, remove the initial colon like this: &amp;lt;nowiki&amp;gt;[[Category:Installation\Build_Instructions]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
 Code should have a space at the start of the line&lt;br /&gt;
&lt;br /&gt;
 Don't forget to put a space on blank lines, or the boxes get broken up.&lt;br /&gt;
 &lt;br /&gt;
 Like this!&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Using_STLFilt_with_MinGW&amp;diff=5396</id>
		<title>Using STLFilt with MinGW</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Using_STLFilt_with_MinGW&amp;diff=5396"/>
		<updated>2008-03-11T15:09:43Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the '''Sandbox''' where you can edit until your heart's content. Check out the 'edit' link at the top of this page to play around in here.&lt;br /&gt;
&lt;br /&gt;
== Italic Text ==&lt;br /&gt;
&lt;br /&gt;
Look at the ''italic text''.&lt;br /&gt;
&lt;br /&gt;
== Bold Text ==&lt;br /&gt;
&lt;br /&gt;
Look at the '''bold text'''.&lt;br /&gt;
&lt;br /&gt;
== Lists ==&lt;br /&gt;
&lt;br /&gt;
*Lists are easy.&lt;br /&gt;
**Really easy.&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
Some images....&lt;br /&gt;
&lt;br /&gt;
[[Image:Chk.png]]&lt;br /&gt;
[[Image:Nop.png]]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
Links to other pages, external sites. etc&lt;br /&gt;
&lt;br /&gt;
Link to page in this wiki&lt;br /&gt;
[[Installing Code::Blocks from source]]&lt;br /&gt;
&lt;br /&gt;
Link with no title&lt;br /&gt;
[http://www.google.com]&lt;br /&gt;
Link with title&lt;br /&gt;
[http://www.google.com The Google Search engine]&lt;br /&gt;
&lt;br /&gt;
Link to category (note the initial colon)&lt;br /&gt;
[[:Category:Installation\Build Instructions]]&lt;br /&gt;
&lt;br /&gt;
To categorize a page, remove the initial colon like this: &amp;lt;nowiki&amp;gt;[[Category:Installation\Build_Instructions]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
 Code should have a space at the start of the line&lt;br /&gt;
&lt;br /&gt;
 Don't forget to put a space on blank lines, or the boxes get broken up.&lt;br /&gt;
 &lt;br /&gt;
 Like this!&lt;br /&gt;
&lt;br /&gt;
 What happens when I try to nest spaces?&lt;br /&gt;
  Like this?&lt;br /&gt;
 &lt;br /&gt;
 Or something LIke this:&lt;br /&gt;
  A&lt;br /&gt;
  B&lt;br /&gt;
   C&lt;br /&gt;
 D&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Using_STLFilt_with_MinGW&amp;diff=5395</id>
		<title>Using STLFilt with MinGW</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Using_STLFilt_with_MinGW&amp;diff=5395"/>
		<updated>2008-03-11T15:08:53Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the '''Sandbox''' where you can edit until your heart's content. Check out the 'edit' link at the top of this page to play around in here.&lt;br /&gt;
&lt;br /&gt;
== Italic Text ==&lt;br /&gt;
&lt;br /&gt;
Look at the ''italic text''.&lt;br /&gt;
&lt;br /&gt;
== Bold Text ==&lt;br /&gt;
&lt;br /&gt;
Look at the '''bold text'''.&lt;br /&gt;
&lt;br /&gt;
== Lists ==&lt;br /&gt;
&lt;br /&gt;
*Lists are easy.&lt;br /&gt;
**Really easy.&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
Some images....&lt;br /&gt;
&lt;br /&gt;
[[Image:Chk.png]]&lt;br /&gt;
[[Image:Nop.png]]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
Links to other pages, external sites. etc&lt;br /&gt;
&lt;br /&gt;
Link to page in this wiki&lt;br /&gt;
[[Installing Code::Blocks from source]]&lt;br /&gt;
&lt;br /&gt;
Link with no title&lt;br /&gt;
[http://www.google.com]&lt;br /&gt;
Link with title&lt;br /&gt;
[http://www.google.com The Google Search engine]&lt;br /&gt;
&lt;br /&gt;
Link to category (note the initial colon)&lt;br /&gt;
[[:Category:Installation\Build Instructions]]&lt;br /&gt;
&lt;br /&gt;
To categorize a page, remove the initial colon like this: &amp;lt;nowiki&amp;gt;[[Category:Installation\Build_Instructions]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
 Code should have a space at the start of the line&lt;br /&gt;
&lt;br /&gt;
 Don't forget to put a space on blank lines, or the boxes get broken up.&lt;br /&gt;
 &lt;br /&gt;
 Like this!&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Using_STLFilt_with_MinGW&amp;diff=5394</id>
		<title>Using STLFilt with MinGW</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Using_STLFilt_with_MinGW&amp;diff=5394"/>
		<updated>2008-03-11T15:08:11Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the '''Sandbox''' where you can edit until your heart's content. Check out the 'edit' link at the top of this page to play around in here.&lt;br /&gt;
&lt;br /&gt;
== Italic Text ==&lt;br /&gt;
&lt;br /&gt;
Look at the ''italic text''.&lt;br /&gt;
&lt;br /&gt;
== Bold Text ==&lt;br /&gt;
&lt;br /&gt;
Look at the '''bold text'''.&lt;br /&gt;
&lt;br /&gt;
== Lists ==&lt;br /&gt;
&lt;br /&gt;
*Lists are easy.&lt;br /&gt;
**Really easy.&lt;br /&gt;
&lt;br /&gt;
== Images ==&lt;br /&gt;
&lt;br /&gt;
Some images....&lt;br /&gt;
&lt;br /&gt;
[[Image:Chk.png]]&lt;br /&gt;
[[Image:Nop.png]]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
Links to other pages, external sites. etc&lt;br /&gt;
&lt;br /&gt;
Link to page in this wiki&lt;br /&gt;
[[Installing Code::Blocks from source]]&lt;br /&gt;
&lt;br /&gt;
Link with no title&lt;br /&gt;
[http://www.google.com]&lt;br /&gt;
Link with title&lt;br /&gt;
[http://www.google.com The Google Search engine]&lt;br /&gt;
&lt;br /&gt;
Link to category (note the initial colon)&lt;br /&gt;
[[:Category:Installation\Build Instructions]]&lt;br /&gt;
&lt;br /&gt;
To categorize a page, remove the initial colon like this: &amp;lt;nowiki&amp;gt;[[Category:Installation\Build_Instructions]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
 Code should have a space at the start of the line&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5393</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5393"/>
		<updated>2008-03-11T15:06:06Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* More complex cases of C::C usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Purpose Statement ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
=== Process ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more comples examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5392</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5392"/>
		<updated>2008-03-11T15:05:37Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* More complex cases of C::C usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Purpose Statement ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
=== Process ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more comples examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
 template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
 private:&lt;br /&gt;
     T m_Instance;&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
 class Parameter&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
     void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
     Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5391</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5391"/>
		<updated>2008-03-11T15:04:20Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* More complex cases of C::C usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Purpose Statement ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
=== Process ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more comples examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== 2: Template classes ===&lt;br /&gt;
&lt;br /&gt;
template&amp;lt;typename T&amp;gt; class Template&lt;br /&gt;
{&lt;br /&gt;
    public:&lt;br /&gt;
        T&amp;amp; GetInstance() { return m_Instance; }&lt;br /&gt;
    private:&lt;br /&gt;
        T m_Instance;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
class Parameter&lt;br /&gt;
{&lt;br /&gt;
    public:&lt;br /&gt;
        void PrintfText() { printf(&amp;quot;Text&amp;quot;); }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
int main(int,char**)&lt;br /&gt;
{&lt;br /&gt;
    Template&amp;lt;Parameter&amp;gt; Object;&lt;br /&gt;
    &lt;br /&gt;
    Object.GetInstance().'''PrintfText'''();&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5390</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5390"/>
		<updated>2008-03-11T15:02:27Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Current Effort */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Structure ===&lt;br /&gt;
The current C::C is a monolithic library of features, which could be de-coupled and split up for use in multiple plugins, providing extra functionality and flexibility in the future.&lt;br /&gt;
Therefore, I propose the C::C be broken up into the following components:&lt;br /&gt;
&lt;br /&gt;
* Code::SymbolTable&lt;br /&gt;
** Provide a list of valid symbols in the workspace, along with relevant scope information&lt;br /&gt;
* Code::Completion&lt;br /&gt;
** Provide Auto-complete features&lt;br /&gt;
* Code::SymbolOutline&lt;br /&gt;
** Provide Symbol browser, find symbol, function jump features&lt;br /&gt;
* Code::Refactoring&lt;br /&gt;
** Provide code refactoring features&lt;br /&gt;
* Code::Documentation&lt;br /&gt;
** Provide automatic code generation features&lt;br /&gt;
&lt;br /&gt;
=== Purpose Statement ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
The current Code::Completion plugin is outdated, and needs a complete rewrite.&lt;br /&gt;
The purpose of the Code::Completion plugin is thus:&lt;br /&gt;
&lt;br /&gt;
* Provide a list of likely symbols in the current scope as possible solutions to the current symbol.&lt;br /&gt;
* Provide function tooltips&lt;br /&gt;
** Parameter list&lt;br /&gt;
** Relevant documentation&lt;br /&gt;
* Provide completion features for class constructors&lt;br /&gt;
* Provide completion features for initializer lists&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
=== Process ===&lt;br /&gt;
==== Code::SymbolTable ====&lt;br /&gt;
==== Code::Completion ====&lt;br /&gt;
&lt;br /&gt;
# Generate a list of all valid symbols in the current scope&lt;br /&gt;
## Take global list from C::SymbolTable&lt;br /&gt;
## Add in local scope parsed on the fly&lt;br /&gt;
# Reduce that list to what is likely&lt;br /&gt;
# Show that list to the user in some fashion&lt;br /&gt;
# Insert the proper solution on user request&lt;br /&gt;
&lt;br /&gt;
==== Code::SymbolOutline ====&lt;br /&gt;
==== Code::Refactoring ====&lt;br /&gt;
==== Code::Documentation ====&lt;br /&gt;
&lt;br /&gt;
== More complex cases of C::C usage ==&lt;br /&gt;
&lt;br /&gt;
Here we can put some more comples examples of c++ code where C::C may fail. Symbols that may be hard to find should be marked in bold&lt;br /&gt;
&lt;br /&gt;
=== 1: Fetching type of operator call ===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int,char**)&lt;br /&gt;
 {&lt;br /&gt;
     ( string(&amp;quot;first&amp;quot;) + &amp;quot;second&amp;quot; + &amp;quot;third&amp;quot; ) . '''c_str'''();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code_Completion_Rewrite&amp;diff=5388</id>
		<title>Code Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code_Completion_Rewrite&amp;diff=5388"/>
		<updated>2008-03-11T04:22:11Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: Code Completion Rewrite moved to Code::Completion Rewrite: Name semantics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Code::Completion Rewrite]]&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5387</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5387"/>
		<updated>2008-03-11T04:22:10Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: Code Completion Rewrite moved to Code::Completion Rewrite: Name semantics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Current Specification ===&lt;br /&gt;
To appear at some near date.&lt;br /&gt;
=== Current Data Model ===&lt;br /&gt;
Also to appear at some near date.&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=5386</id>
		<title>Installing Code::Blocks from source on Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=5386"/>
		<updated>2008-03-11T03:54:44Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* wxWidgets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
[[Category:Installing Code::Blocks from source]]&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
'''Note for RC2 users'''&lt;br /&gt;
&lt;br /&gt;
The older Code::Blocks RC2 does not support global compiler variables which were added after RC2 was released and is unable to read project files generated with post-RC2 versions.&lt;br /&gt;
To build Code::Blocks, you need a post-RC2 build, such as  any of the ''nightly builds'' obtainable by [/index.php?board=20.0 searching the forum].&lt;br /&gt;
&lt;br /&gt;
=== MinGW compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with the MinGW compiler (or any other gcc for that matter). You will need a complete, working [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
Since November 2007 MinGW-GCC 4.2.1&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
[http://wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Code::Blocks officially supports wxWidgets 2.6.3 (although any 2.6+ version probably works).&amp;lt;br/&amp;gt;&lt;br /&gt;
Download: [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.6.3-1.zip wxMSW-2.6.3-1.zip].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Code::Blocks uses&lt;br /&gt;
* since May 2007 wxWidgets 2.8.4&amp;lt;br/&amp;gt;Download: [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.4.zip wxMSW-2.8.4.zip]&lt;br /&gt;
&lt;br /&gt;
* since November 2007 wxWidgets 2.8.6 &amp;lt;br/&amp;gt;Download: [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.6.zip wxMSW-2.8.6.zip]&lt;br /&gt;
&lt;br /&gt;
* since 28 November 2007 wxWidgets 2.8.7 &amp;lt;br/&amp;gt;Download: [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.7.zip wxMSW-2.8.7.zip]&lt;br /&gt;
&lt;br /&gt;
For latest infos check forum: [/index.php?topic=3299.0 Important changes to the nightly builds]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You do ''not'' need MSYS (''in fact, if you have MSYS, make sure it is not in your PATH when building wxWidgets'').&lt;br /&gt;
&lt;br /&gt;
=== SVN client ===&lt;br /&gt;
&lt;br /&gt;
In order to check out the Code::Blocks sources you will need a SVN client.&lt;br /&gt;
For convenience, it is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine, as this is a lot more comfortable. However, if you get a bad feeling when some program is messing with your Explorer menu, then you can use the [http://subversion.tigris.org/project_packages.html svn command-line client] equally well.&lt;br /&gt;
&lt;br /&gt;
It is generally a good idea to install the command-line client (and adding it to PATH) even if you use TortoiseSVN for convenience. The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; binary if it is available. This is preferrable to the manual parsing of the entries file that is used as fallback.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please do note that working copies checked out with the 1.4 version of Subversion are no longer compatible with earlier versions (Subversion will transparently update existing repositories).&lt;br /&gt;
&lt;br /&gt;
The builtin fallback mechanism in &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; has been updated to the new 1.4 format and will no longer work with the old format.&amp;lt;br&amp;gt;&lt;br /&gt;
Therefore, if you use a Subversion client from the 1.0-1.3 line, you ''must'' put the commandline tool into &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; for a successful build.&amp;lt;br&amp;gt;&lt;br /&gt;
If you use Subversion 1.4, then it is good practice nevertheless, but you can do without, too.&lt;br /&gt;
&lt;br /&gt;
=== zip.exe ===&lt;br /&gt;
&lt;br /&gt;
You'll also need a working 'zip' program.&lt;br /&gt;
If you have the version listed on our [https://wiki.codeblocks.org/index.php?title=Mingw#Other_developer_tools tools page], you'll be fine.&lt;br /&gt;
&lt;br /&gt;
The zip program coming with cygwin will ''not'' work properly. You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure the zip binary is in your PATH so the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script will be able to find it (alternatively, you can edit the batch file, setting the ZIPCMD variable to something else).&lt;br /&gt;
&lt;br /&gt;
The easiest way is to put zip.exe into &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; inside your MinGW installation directory (that folder is normally in the path).&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks sources ===&lt;br /&gt;
&lt;br /&gt;
You will also (obviously) need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
Using ''TortoiseSVN'', make a folder where you want to store the sources, right-click on the folder, and select &amp;quot;SVN Checkout...&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In the top box, enter svn://svn.berlios.de/codeblocks/trunk and hit the OK button.&lt;br /&gt;
&lt;br /&gt;
Using ''svn'', you have to open a command prompt (&amp;quot;DOS Window&amp;quot;). Make a folder, change directory, and run svn:&lt;br /&gt;
&lt;br /&gt;
  mkdir codeblocks-head&lt;br /&gt;
  cd codeblocks-head&lt;br /&gt;
  svn checkout svn://svn.berlios.de/codeblocks/trunk&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
&lt;br /&gt;
=== Unicode Build ===&lt;br /&gt;
&lt;br /&gt;
==== Compile wxWidgets in Unicode mode ====&lt;br /&gt;
&lt;br /&gt;
After unpacking the zip file to a directory of your choice, open a cmd prompt, and navigate to the folder build/msw inside the wxWidgets folder. Use the following commands to compile wxWidgets:&lt;br /&gt;
&lt;br /&gt;
  set path=c:\mingw\bin;c:\mingw\mingw32\bin&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
This assumes your MinGW installation is in C:\mingw. Use a different path if you installed MinGW somewhere else.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of warning messages during compilation. Don't worry, this is normal, you are compiling wxWidgets. The build process may take 10-30 minutes, depending on your computer's speed.&lt;br /&gt;
&lt;br /&gt;
''remark: If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.''&lt;br /&gt;
''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; by &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
'''Optional:'''&lt;br /&gt;
&lt;br /&gt;
To reduce the size of your wxWidgets library, you can disable features which are not used by Code::Blocks. However, you should not do this unless you know what you are doing. You have to delete the generated setup.h from lib/gcc_dll/msw/wx before building, because your changes to include/wx/msw will otherwise not be honoured.&lt;br /&gt;
&lt;br /&gt;
==== Compile Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Open the project CodeBlocks.cbp. You will be prompted to define the global variable $(#wx). Enter the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
Hit the blue gear and lean back. Compilation may take 3-5 minutes, depending on the speed of your computer.&lt;br /&gt;
&lt;br /&gt;
After the compilaton has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw26u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;src\devel&amp;lt;/tt&amp;gt; directory inside the Code::Blocks source folder (it will also work if you keep a copy of that library in your Windows folder or anywhere in your system path, but this is generally not recommended because you can get into dll hell).&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;tt&amp;gt;src\update.bat&amp;lt;/tt&amp;gt; (located in the root source directory). This will pack the resource files and copy libraries and plugins to their correct locations.&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; folder.&amp;lt;br&amp;gt;&lt;br /&gt;
Congratulations, you own a freshly built version of Code::Blocks!&lt;br /&gt;
&lt;br /&gt;
For future updates, go into the Code::Blocks root directory and run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; (or use TurtoiseSVN to the same effect).&amp;lt;br/&amp;gt;&lt;br /&gt;
Then open and build the project as described before (and any contrib plugins that you wish to use), and re-run &amp;lt;tt&amp;gt;src\update.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Install Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Copy the folder output to where you want Code::Blocks to reside.&lt;br /&gt;
&lt;br /&gt;
==== Compile contributed (or your own) plugins ====&lt;br /&gt;
&lt;br /&gt;
The workspace file ContribPlugins.workspace contains the project files for all contributed plugins. Open that workspace and compile the plugins which you would like to use (or select &amp;quot;Build Workspace&amp;quot; from the context menu if you want them all).&amp;lt;br/&amp;gt;&lt;br /&gt;
When you open the contrib plugins workspace, you will be asked to define the &amp;lt;tt&amp;gt;$(#cb)&amp;lt;/tt&amp;gt; global compiler variable. This is the path that contains the sdk folder normally this is codeblocks\src. The build process uses this information to place the plugins and data files into the correct place. Enter the location of the Code::Blocks sources in the same way as for the &amp;lt;tt&amp;gt;$(#wx)&amp;lt;/tt&amp;gt; variable earlier.&lt;br /&gt;
&lt;br /&gt;
Don't forget to run update.bat again after building the contrib plugins.&lt;br /&gt;
&lt;br /&gt;
=== ANSI Build ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f7d9d9; border: 1px solid #000&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 5px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== DEPRECATION WARNING: ====&lt;br /&gt;
As of February 2006, the official default build for Code::Blocks is '''Unicode''' (see above). Although ANSI builds are technically possible, we discourage their use unless there is a good reason.&amp;lt;br/&amp;gt;&lt;br /&gt;
''Support for ANSI builds is likely to be dropped after Version 1.0 is out.''&lt;br /&gt;
&lt;br /&gt;
There is hardly any good argument against using a Unicode build if your OS supports Unicode, even if you do not understand any other language than English, as a Unicode version guarantees that it will be able to work with whatever languages you may possibly encounter in the future -- at a very reasonable cost.&lt;br /&gt;
&lt;br /&gt;
However, if you absolutely don't care about Unicode or if you are bound to use Windows 95, then you may want to build an ANSI version nevertheless.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compile wxWidgets in ANSI mode ====&lt;br /&gt;
&lt;br /&gt;
After unpacking the zip file to a directory of your choice, open a cmd prompt, and navigate to the folder build/msw inside the wxWidgets folder. Use the following commands to compile wxWidgets&lt;br /&gt;
&lt;br /&gt;
  set path=c:\mingw\bin;c:\mingw\mingw32\bin&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 clean&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0&lt;br /&gt;
&lt;br /&gt;
This assumes your MinGW installation is in C:\mingw. Use a different path if you installed MinGW somewhere else.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of warning messages during compilation. Don't worry, this is normal, you are compiling wxWidgets. The build process may take 10-30 minutes, depending on your computer's speed.&lt;br /&gt;
&lt;br /&gt;
'''Optional:'''&lt;br /&gt;
&lt;br /&gt;
To reduce the size of your wxWidgets library, you can disable features which are not used by Code::Blocks. However, you should not do this unless you know what you are doing. You have to delete the generated setup.h from lib/gcc_dll/msw/wx before building, because your changes to include/wx/msw will otherwise not be honoured.&lt;br /&gt;
&lt;br /&gt;
==== Compile Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Open the project CodeBlocks.cbp. You will be prompted to define the global variable $(#wx) if you have not used it before. Enter the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
'''Important:'''  The project file is set to compile an Unicode version of Code::Blocks by default. To make an ANSI build, you have to make the following two changes to build options before compiling:&lt;br /&gt;
1. In the &amp;quot;Compiler&amp;quot; tab, under &amp;quot;#defines&amp;quot;, remove the entry wxUSE_UNICODE.&lt;br /&gt;
2. Under &amp;quot;Custom variables&amp;quot;, set the variable WX_SUFFIX to empty (default value: u).&lt;br /&gt;
&lt;br /&gt;
Hit the blue gear and lean back. Compilation may take 3-5 minutes, depending on the speed of your computer.&lt;br /&gt;
&lt;br /&gt;
After the compilaton has finished, copy wxmsw26u_gcc_custom.dll from lib\gcc_dll inside the wxWidgets directory to the devel directory inside the Code::Blocks source folder (it will also work if you keep a copy of that library in your Windows folder or anywhere in your system path, but this is generally not recommended because you can get into [http://en.wikipedia.org/wiki/DLL_hell dll hell] ).&lt;br /&gt;
Run update.bat (located in the root source directory). This will pack the resource files and copy libraries and plugins to their correct locations.&lt;br /&gt;
The location of executable is src\output in C::B tree. From here you'll not need the nighty build anymore.&lt;br /&gt;
&lt;br /&gt;
One little note for svn updates and rebuilds : just go into the codeblocks root directory and do '''svn update''' (or use Turtoise svn).&lt;br /&gt;
&lt;br /&gt;
Then run the src/output/codeblocks.exe, reload project, build it, reload plugins workspace, build it, quit codeblocks and re-run update.bat. You'll have an up-to-date C::B in 3 minutes !&lt;br /&gt;
&lt;br /&gt;
==== Install Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Copy the folder output to where you want Code::Blocks to reside.&lt;br /&gt;
&lt;br /&gt;
==== Compile contributed (or your own) plugins ====&lt;br /&gt;
&lt;br /&gt;
The workspace file ContribPlugins.workspace contains the project files for all contributed plugins. Open that workspace and compile the plugins which you would like to use (or select &amp;quot;Build Workspace&amp;quot; from the context menu if you want them all). Don't forget to run update.bat again after building the contrib plugins.&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_the_latest_official_version_of_Code::Blocks_on_Windows&amp;diff=5385</id>
		<title>Installing the latest official version of Code::Blocks on Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_the_latest_official_version_of_Code::Blocks_on_Windows&amp;diff=5385"/>
		<updated>2008-03-11T03:50:55Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
[[Category:Installing the latest official version of Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
=== Install steps ===&lt;br /&gt;
&lt;br /&gt;
# [https://www.codeblocks.org/downloads/5 Download the Code::Blocks 8.02 installer]. If you know you don't have MinGW installed, download the package which has MinGW bundled.&lt;br /&gt;
# Run the installer, it's a standard installer for Windows; just press Next after reading each screen.&lt;br /&gt;
# If you're planning installing a compiler after you've installed Code::Blocks, read the information provided in the installer.&lt;br /&gt;
# If you downloaded the installer which doesn't come with MinGW, you may have to configure the compiler manually (usually Code::Blocks' autodetects the compiler).&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_the_latest_official_version_of_Code::Blocks_on_Windows&amp;diff=5384</id>
		<title>Installing the latest official version of Code::Blocks on Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_the_latest_official_version_of_Code::Blocks_on_Windows&amp;diff=5384"/>
		<updated>2008-03-11T03:49:27Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: /* Install steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
[[Category:Installing the latest official version of Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
::''NOTE: The current official version is outdated; we recommend [[Installing Code::Blocks nightly build on Windows|using the nightly builds]].''&lt;br /&gt;
&lt;br /&gt;
::'''Warning:''' Due to bug discovered in RC2, do not install the SVN plugin if you don't have the SVN versioning system installed or Code::Blocks may crash. If you already installed the plugin by accident, please '''delete svn.dll''' from the &amp;quot;share\codeblocks\plugins&amp;quot; subdirectory.&lt;br /&gt;
&lt;br /&gt;
=== Install steps ===&lt;br /&gt;
&lt;br /&gt;
# [https://www.codeblocks.org/downloads/5 Download the Code::Blocks 8.02 installer]. If you know you don't have MinGW installed, download the package which has MinGW bundled.&lt;br /&gt;
# Run the installer, it's a standard installer for Windows; just press Next after reading each screen.&lt;br /&gt;
# If you're planning installing a compiler after you've installed Code::Blocks, read the information provided in the installer.&lt;br /&gt;
# If you downloaded the installer which doesn't come with MinGW, you may have to configure the compiler manually (usually Code::Blocks' autodetects the compiler).&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5383</id>
		<title>Code::Completion Rewrite</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code::Completion_Rewrite&amp;diff=5383"/>
		<updated>2008-03-11T03:16:46Z</updated>

		<summary type="html">&lt;p&gt;Stevenkaras: New page: == Background == The current Code::Completion plug-in has some flaws, and is currently development frozen. The current plug-in lacks full support for: # function and class templates # defa...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
The current Code::Completion plug-in has some flaws, and is currently development frozen.&lt;br /&gt;
The current plug-in lacks full support for:&lt;br /&gt;
# function and class templates&lt;br /&gt;
# default arguments in some cases&lt;br /&gt;
# some of the more complicated c++ mucky business&lt;br /&gt;
&lt;br /&gt;
== Current Effort ==&lt;br /&gt;
=== Current Specification ===&lt;br /&gt;
To appear at some near date.&lt;br /&gt;
=== Current Data Model ===&lt;br /&gt;
Also to appear at some near date.&lt;/div&gt;</summary>
		<author><name>Stevenkaras</name></author>
	</entry>
</feed>