News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

codecompletion suggestion list

Started by blueshake, August 28, 2009, 01:35:52 PM

Previous topic - Next topic

blueshake

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.

#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]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

ollydbg

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
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

MortenMacFly

...another gotcha (I just found out):

If you open: filemanager.cpp
You'll realise that the CC stops parsing at:
LoaderBase* FileManager::Load(const wxString& file, bool reuseEditors)
All other functions like e.g.:
bool FileManager::ReplaceFile(const wxString& old_file, const wxString& new_file)
...are not in the list in the toolbar
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

blueshake

Quotebool FileManager::ReplaceFile(const wxString& old_file, const wxString& new_file)
this function is in my toolbar.see my attachment.

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

MortenMacFly

Quote from: blueshake on August 29, 2009, 06:47:12 AM
Quotebool 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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

It's there for me in cc-branch and trunk.

MortenMacFly

Quote from: blueshake on August 29, 2009, 06:47:12 AM
Quotebool 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]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

Quote from: MortenMacFly on August 29, 2009, 08:34:49 PM
Quote from: blueshake on August 29, 2009, 06:47:12 AM
Quotebool 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.

killerbot

QuoteSometimes 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.

blueshake

#9
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]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

blueshake

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
        if (token->m_IsOperator)
            continue;



so the operator+ will be ignored.
my question is :
can i turn it on?
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

MortenMacFly

Quote from: blueshake on August 30, 2009, 01:18:56 PM
        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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]