News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Code completion trouble

Started by spoofer, December 31, 2005, 03:52:07 PM

Previous topic - Next topic

spoofer

class foo
{
   public:
      foo(int, float);
      void bar(const char *);
};

int main()
{
   foo var(    // <-
   var.        // <-

   return 0;
}


I get nothing on those marked spots. I have following option checked: [follow global, follow local, parse preprocessor]. Plugin is checked to be loaded. Class explorer is working.

thomas

"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

spoofer

I know about that. I saved after typing int main(), doesn't work.

thomas

I tried, it works just fine.

If you did save your file and it still does not work for you, then you very likely have no project.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

spoofer

#4
This is strange, functions works:

class foo
{
   public:
      foo(int);
      void bar(float);
};

void func(double);

// <- file saved at this point

int main()
{
   func(       // <- works
   foo var(    // <- doesn't work
   var.        // <- doesn't work

   return 0;
}


EDIT: I'll try installing latest SVN from Ceniza. Should I manually remove some files (configuration)?

thomas

SVN uses an entirely different config than RC2, so nothing to do.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

killerbot

#6
I quickly tried this also :

class foo
{
   public:
      foo(int);
      void bar(float);
};

void func(double);

// <- file saved at this point

int main()
{
   func(       // <- works
   foo var(    // <- doesn't work  <------------------------- so I only have problems here
   var.        // <- works

   return 0;
}


I am using latest svn code (windows xp sp2)

EDIT :  probably the code completion does not know yet var is of type foo (maybe it updates only after a line has ended ?? I am not sure)

rickg22

Apparently it confuses bar with a function, but I'd need to check. Anyway this is a very special case, where on declaration of the variable, you invoke the constructor. This is not a fault of the parser, but of the codecompletion module, because it does a different kind of parsing. So it's very probable this case hasn't been coded yet.

spoofer

I messed around plugin settion; by disabling SmartSense I get:

class foo
{
   public:
      foo(int);
      void bar(float);
};

void func(double);

int main()
{
   foo var(    // <- doesn't work (explained)

   foo(        // <- works ???
   var.        // <- works
   func(       // <- works

   return 0;
}

rickg22

If anybody fixes this bug or problem or whatever, please tell me so i can merge the changes in my to-be-optimized copy.

Michael

Quote from: killerbot on December 31, 2005, 07:17:45 PM
class foo
{
   public:
      foo(int);
      void bar(float);
};

void func(double);

// <- file saved at this point

int main()
{
   func(       // <- works
   foo var(    // <- doesn't work  <------------------------- so I only have problems here
   var.        // <- works

   return 0;
}

I have also tried this code and saved where killerbot did.

foo var( did not work, but if I pressed ctrl+space bar, I get a list of possibilities:

Quote
class foo
function func(double):void

I have also remarked that sometimes I do not get the list of possibilities when I type e.g., var.. Or, the first time I get it (if not, I simply press ctrl+space bar), but if I skip and try a second time it does not work (even ctrl+space bar does not work) :?. But if I save the file and then retry, it works.

I use C::B SVN rev1648 (windows XP SP2).

Michael

PS.: It seems to me that the code between tt tags is now small again (babylon theme). Did something change?
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

K.I.L.E.R

I have a suggestion.
I solved most of my code completion troubles by disabling cache but leaving the option enabled that always updates cache.

Michael

Quote from: K.I.L.E.R on January 07, 2006, 12:43:00 PM
I have a suggestion.
I solved most of my code completion troubles by disabling cache but leaving the option enabled that always updates cache.
Interesting :). Anyway, not a long-term solution, because if you disable the cache, why you need to update it?

Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

K.I.L.E.R

Just in case. :)

Quote from: Michael on January 07, 2006, 01:42:10 PM
Quote from: K.I.L.E.R on January 07, 2006, 12:43:00 PM
I have a suggestion.
I solved most of my code completion troubles by disabling cache but leaving the option enabled that always updates cache.
Interesting :). Anyway, not a long-term solution, because if you disable the cache, why you need to update it?

Michael