Page 1 of 1

Code completion future

Posted: Tue May 04, 2010 11:37 am
by PAVLVS
Hello Irfan,
Firstly, I want to report a mismatch with Code Completion when you use modificators in function arguments, e.g.:

Code: Select all

void func(unsigned int a, unsigned int b) { /* body */ }
void func(unsigned int a, unsigned int b, int c) { /* body * / }
Both unsigned arguments are ignored and functions seems like void func() and void func(int c) to parser.

The next thing is whether you are planning to add full preprocessor/macros evaluation? E.g. for evaluating this code

Code: Select all

#define PROPERTY(T, V) \
protected: \
  T V; \
public: \
  void set##V(T _##V) { V = _##V; } \
  T get##V() { return V; }

class Object
{
  PROPERTY(wxString, Name)
  PROPERTY(float, Mass)
};
to the following:

Code: Select all

class Object
{
protected:
  wxString Name;
public:
  void setName(wxString _Name) { Name = _Name; }
  wxString getName() { return Name; }
protected:
  float Mass;
public:
  void setMass(float _Mass) { Mass = _Mass; }
  float getMass() { return Mass; }
};
IDE with such functionality support is (besides Visual Studio) Qt Creator, but I'd prefer Code Lite (Qt Creator is strongly oriented on Qt developping, especially from vesion 2.0 with QML).
So, what do you think about this feature? Is there a chance to have it in Code Lite?
Thanks for your work.

Re: Code completion future

Posted: Wed May 05, 2010 9:14 am
by eranif
PAVLVS wrote:Both unsigned arguments are ignored and functions seems like void func() and void func(int c) to parser.
This seems like a bug to me. I will look at it (thanks for reporting this & providing a use-case)
PAVLVS wrote:So, what do you think about this feature? Is there a chance to have it in Code Lite?
Probably yes, but not in the coming future

Eran

Re: Code completion future

Posted: Wed May 05, 2010 10:38 pm
by eranif
Hi again,

I played with the sample that you gave in the first post and it seems that it works perfectly fine here.

Attached is a screenshot that shows the result I am getting here:
completion.png
Can you please explain what else I need to do in order to reproduce the problem?

Eran

Re: Code completion future

Posted: Mon May 10, 2010 11:40 am
by PAVLVS
Hello Eran,
Sorry for a bad use case. I didn't check that code completion works in this case.
Here you find my original code where it doesn't:

Code: Select all

class Tetrahedron
{
public:
  Tetrahedron()
  { //n.n.
  }
  void set(short int i_1, short int i_2, short int i_3, short int i_4)
  { //n.n.
  }
  void set(short int i_1, short int i_2, short int i_3, short int i_4, bool out)
  { //n.n.
  }
};
int main(int argc, char** argv)
{
  Tetrahedron t;
  t.set(0, 1, 2, 3, false);
  return 0;
}
And below screen shots if you don't believe me ;)
Image
Image
(Here are links to images if are not displayed correctly:
http://w153.wrzuta.pl/obraz/8eGHlAldI96/prtsc1
http://w153.wrzuta.pl/obraz/aD4j5pZRcNS/prtsc2)
Cheers,
Paweł

Re: Code completion future

Posted: Mon May 10, 2010 11:43 am
by eranif
PAVLVS wrote:Sorry for a bad use case
sure thing, the new example provides the same error here. The first use case was missleading.

I will have a look at it

Eran

Re: Code completion future

Posted: Mon May 10, 2010 11:51 am
by eranif
Update:
Fixed in trunk

Eran