Author Topic: codecompletion suggestion list  (Read 12451 times)

Offline blueshake

  • Regular
  • ***
  • Posts: 459
codecompletion suggestion list
« 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]
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?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: codecompletion suggestion list
« Reply #1 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
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: codecompletion suggestion list
« Reply #2 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
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: codecompletion suggestion list
« Reply #3 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]
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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: codecompletion suggestion list
« Reply #4 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?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: codecompletion suggestion list
« Reply #5 on: August 29, 2009, 05:17:35 pm »
It's there for me in cc-branch and trunk.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: codecompletion suggestion list
« Reply #6 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]
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: codecompletion suggestion list
« Reply #7 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.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: codecompletion suggestion list
« Reply #8 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.

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: codecompletion suggestion list
« Reply #9 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]
« Last Edit: August 30, 2009, 02:29:06 am by blueshake »
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?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: codecompletion suggestion list
« Reply #10 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?
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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: codecompletion suggestion list
« Reply #11 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ