Author Topic: Code completion trouble  (Read 8635 times)

spoofer

  • Guest
Code completion trouble
« on: December 31, 2005, 03:52:07 pm »
Code
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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Code completion trouble
« Reply #1 on: December 31, 2005, 03:55:20 pm »
Save the file.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

spoofer

  • Guest
Re: Code completion trouble
« Reply #2 on: December 31, 2005, 06:05:25 pm »
I know about that. I saved after typing int main(), doesn't work.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Code completion trouble
« Reply #3 on: December 31, 2005, 06:15:05 pm »
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

  • Guest
Re: Code completion trouble
« Reply #4 on: December 31, 2005, 06:22:04 pm »
This is strange, functions works:

Code
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)?
« Last Edit: December 31, 2005, 06:24:52 pm by spoofer »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Code completion trouble
« Reply #5 on: December 31, 2005, 07:11:18 pm »
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."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Code completion trouble
« Reply #6 on: December 31, 2005, 07:17:45 pm »
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)
« Last Edit: December 31, 2005, 07:19:46 pm by killerbot »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Code completion trouble
« Reply #7 on: January 02, 2006, 11:55:56 pm »
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

  • Guest
Re: Code completion trouble
« Reply #8 on: January 04, 2006, 09:56:10 am »
I messed around plugin settion; by disabling SmartSense I get:

Code
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;
}

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Code completion trouble
« Reply #9 on: January 04, 2006, 05:44:20 pm »
If anybody fixes this bug or problem or whatever, please tell me so i can merge the changes in my to-be-optimized copy.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Code completion trouble
« Reply #10 on: January 04, 2006, 07:47:01 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?

K.I.L.E.R

  • Guest
Re: Code completion trouble
« Reply #11 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.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Code completion trouble
« Reply #12 on: January 07, 2006, 01:42:10 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

K.I.L.E.R

  • Guest
Re: Code completion trouble
« Reply #13 on: January 07, 2006, 01:45:05 pm »
Just in case. :)

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