www.digitalmars.com         C & C++   DMDScript  

D - class / struct properties and intellisense

reply Ant <Ant_member pathlink.com> writes:
so how should the properties be displayed on an intellisence list?

class Hat
{
  private int _color;
  public int color();
  public void color(int newColor);
  public void f();
  public void f1();
}

hat.< what now? >
show "color","f","f1"?

how does the user know it's a property?

all overloaded methods with 0 or 1 argumens are properties?
how to differenciate from a method and a read only property?
how... I think I'm changing my mind again (from my the last post)

anyways for sure this will have a very low priority for leds.

Ant
http://dui.sourceforge.net
http://leds.sourceforge.net
Apr 26 2004
parent reply "Erik Charlebois" <echarleb uwaterloo.ca> writes:
I don't think there's really good solution to this without a language
construct to indicate its a property.
You'll always be guessing. I'd just show properties as methods unless such a
construct came along.

Out of curiosity, did you write an incremental D parser to do this?

erik


"Ant" <Ant_member pathlink.com> wrote in message
news:c6jnml$14ac$1 digitaldaemon.com...
 so how should the properties be displayed on an intellisence list?

 class Hat
 {
   private int _color;
   public int color();
   public void color(int newColor);
   public void f();
   public void f1();
 }

 hat.< what now? >
 show "color","f","f1"?

 how does the user know it's a property?

 all overloaded methods with 0 or 1 argumens are properties?
 how to differenciate from a method and a read only property?
 how... I think I'm changing my mind again (from my the last post)

 anyways for sure this will have a very low priority for leds.

 Ant
 http://dui.sourceforge.net
 http://leds.sourceforge.net
Apr 26 2004
parent Ant <Ant_member pathlink.com> writes:
In article <c6jstk$1df8$1 digitaldaemon.com>, Erik Charlebois says...
I don't think there's really good solution to this without a language
construct to indicate its a property.
You'll always be guessing. I'd just show properties as methods unless such a
construct came along.
that's what I'll do.
Out of curiosity, did you write an incremental D parser to do this?
I did write a parser. I've no idea about the incremental thing :( note that the parser is (almost) not interested on the body of the functions, so it's relativelly simple. Ant
Apr 26 2004