PDA

View Full Version : Delphi code completion



Dan
11-05-2007, 02:40 PM
I think most people who used Delphi know about code completion feature.
that is for example if you put a full stop after a class or a record variable you get a list of available variables and methods of the class/record. Now Delphi assumes that it's doing a good job by verifying the variable type in the context of the expression and filters out inappropriate types. For instance:


type
TVec3 = record
x, y, z: single;
end;
...
var
v: Vec3;
s: string;
...

Now if I type "s := v." and press CTRL+SPACE the code completion will not give me a list of variables available in TVec because Delphi thinks that type "single" is not appropriate for assigning to a string but I actually want it to show me a complete list of variables in TVec3. Does anyone know if there is a way to disable the type verification in Delphi, specifically in BDS2006?

jasonf
11-05-2007, 02:48 PM
I would also like to know this...

I think Delphi assumes a particular coding style.. one which I somtimes fall out with.
I belive that if TVec3 has a string member, it would appear. But then, only the string member.

It does make you think about the types though, which is useful.. however it would be nice to cave a way to configure the amount of hand holding the IDE actually does as sometimes I just want to see everything which is exposed by the object regardless of the type I'm assigning it to.

Clootie
13-05-2007, 11:20 AM
In that case I usually type something like "; v." - and Delphi shows all members as it thinks that I'm going to asign values to them. :)

Or you can just go somewhere after existing "; " and press the same CTRL+SPACE - and Delphi will show up all variables, types available at this point and with this drop-down box open just type "v." to see members of "v" record.

In both cases you will have some unwanted text in editor, but... :)

Nitrogen
13-05-2007, 06:35 PM
That doesnt necessarily work every time,
because BDS2006 has a built in check-errors-while-you-type thing, and if you leave



S := ; v.


It will complain that S is not getting assigned to anything, and therefore shuts down ALL of the code completion. :?

Dan
13-05-2007, 08:55 PM
I think Borland or CodeGear should have made an option to disable type verification in code completion... I was hoping that there was one, just hidden somewhere :roll:

jaky2509
10-06-2008, 12:58 AM
good

arthurprs
10-06-2008, 01:21 AM
install CnWizards,
http://cnpack.org/index.php?lang=en

believe me,
delphi + CnWizards is more productive than python :shock:

JernejL
10-06-2008, 05:21 PM
I think Borland or CodeGear should have made an option to disable type verification in code completion... I was hoping that there was one, just hidden somewhere :roll:

Hex editor with $C3 or $90 data is your friend.