Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => CodeCompletion redesign => Topic started by: blueshake on August 28, 2009, 01:35:52 pm

Title: codecompletion suggestion list
Post by: blueshake on August 28, 2009, 01:35:52 pm
i found a problem on cc suggestion list .
here is the codes.
for the variable stt, the suggestion list have no
member funciton operator = ,operator +,see the attachment snap1
and the class tree have these function .see the attachment snap2.
anyone has comment on this.

Code
#include <iostream>

using namespace std;
class Strings{
public:
 Strings();
 Strings(char *s);
 Strings(const Strings &s);
 Strings& operator = (const Strings& s){
 };
 Strings& operator + (const Strings& s){
 };
 Strings& operator + (const  char *s){
 };
 ~Strings(){
  if(str != NULL)
   delete [] str;
 cout<<"~Strings() is called"<<endl;
 }
 void display(){
 };
private:
 char *str;
};
Strings stt;
stt.|
int main()
{

    cout << "Hello world!" << endl;
    return 0;
}


[attachment deleted by admin]
Title: Re: codecompletion suggestion list
Post by: ollydbg on August 28, 2009, 01:50:26 pm
OK, I can confirm.

Operator + and operator = were shown correctly in the Symbols tree.

But I think we don't need to show the operator after stt.. :D
Title: Re: codecompletion suggestion list
Post by: MortenMacFly on August 28, 2009, 09:16:03 pm
...another gotcha (I just found out):

If you open: filemanager.cpp
You'll realise that the CC stops parsing at:
Code
LoaderBase* FileManager::Load(const wxString& file, bool reuseEditors)
All other functions like e.g.:
Code
bool FileManager::ReplaceFile(const wxString& old_file, const wxString& new_file)
...are not in the list in the toolbar
Title: Re: codecompletion suggestion list
Post by: blueshake on August 29, 2009, 06:47:12 am
Quote
bool FileManager::ReplaceFile(const wxString& old_file, const wxString& new_file)
this function is in my toolbar.see my attachment.

[attachment deleted by admin]
Title: Re: codecompletion suggestion list
Post by: MortenMacFly on August 29, 2009, 04:53:21 pm
Quote
bool FileManager::ReplaceFile(const wxString& old_file, const wxString& new_file)
this function is in my toolbar.see my attachment.
...ok...?! :shock:
For me it's really not. Could your provide me with a patch of your whole codecompletion plugin based on the current codecompletion_refactoring branch?
Title: Re: codecompletion suggestion list
Post by: Jenna on August 29, 2009, 05:17:35 pm
It's there for me in cc-branch and trunk.
Title: Re: codecompletion suggestion list
Post by: MortenMacFly on August 29, 2009, 08:34:49 pm
Quote
bool FileManager::ReplaceFile(const wxString& old_file, const wxString& new_file)
this function is in my toolbar.see my attachment.
It's not for me (see image attached).
The file manager source is exactly as on trunk, the CC plugin is (meanwhile) the same as CC branch plur one minor addition that *cannot* be related. Now what's going on here???


[attachment deleted by admin]
Title: Re: codecompletion suggestion list
Post by: Jenna on August 29, 2009, 10:25:33 pm
Quote
bool FileManager::ReplaceFile(const wxString& old_file, const wxString& new_file)
this function is in my toolbar.see my attachment.
It's not for me (see image attached).
The file manager source is exactly as on trunk, the CC plugin is (meanwhile) the same as CC branch plur one minor addition that *cannot* be related. Now what's going on here???

I had the same issue with IncrementalSearch.cpp, but it's gone now, without any changes.
Sometimes I see another very strange behaviour: I have a horizontal line inside the dropdown list, I don't know if it is instead of a function or additional.
Title: Re: codecompletion suggestion list
Post by: killerbot on August 29, 2009, 10:35:06 pm
Quote
Sometimes I see another very strange behaviour: I have a horizontal line inside the dropdown list, I don't know if it is instead of a function or additional.

I have this to occasionally in the code completion toolbar drop down list. ANd it is either replacing or hiding (drawn on top ??) of a regular method entry.
Title: Re: codecompletion suggestion list
Post by: blueshake on August 30, 2009, 02:16:46 am
i just upload the parserthead files.i apply them in normal version.
but the parserthread files are got from cc-branch,added some patches
(which i have upload in the forum before).


[attachment deleted by admin]
Title: Re: codecompletion suggestion list
Post by: blueshake on August 30, 2009, 01:18:56 pm
i found the reason why the operator+ not show in suggestion list.
the operator+ token's variable m_IsOperator is true and in the fucntion
NativeParser::FindAIMatches,
the codes
Code
        if (token->m_IsOperator)
            continue;


so the operator+ will be ignored.
my question is :
can i turn it on?
Title: Re: codecompletion suggestion list
Post by: MortenMacFly on August 30, 2009, 05:52:52 pm
Code
        if (token->m_IsOperator)
            continue;
I don't recall who did it (but we can checkout svn blame for that) but IIRC it was to hide the operators as a lot of (base) classes have tons of operator overloads which usually don't matter because you just use them like: A + B and not "A.operator+()B" So CC makes no sense in most of the cases and just clutters the "interesting" methods. So if you enable it, please make it an option.