Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Class Completion    [ Add a report in this area ]  
Report #:  101556   Status: Reported
Class completion don't work
Project:  Delphi Build #:  16.0.4316.44803
Version:    16.2 Submitted By:   Pierre Yager
Report Type:  Basic functionality failure Date Reported:  12/5/2011 6:27:32 AM
Severity:    Infrequently encountered problem Last Updated: 12/6/2011 5:46:45 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
In my current project, CTRL+SHIFT+C to autocomplete classes dont work at all in no unit.
It does not work on my main project (848 000 LOC using tons of third part code so I cannot send it to you) and this problem seems to be related to QC#98928 (I have image resources added to my project)

So I have to do everything by hand, I hope that the class completion could help but since Delphi 2010 where I tested this, it don't work and is a productivity pain.

In the implementation section when you want to implement manuallty functions from the interface section, I completes code with useless things that have to be rewritten by hand. See steps to reproduce.
Steps to Reproduce:
1) Create a new VCL Application
2) Add a new unit
3) Paste this :

unit Unit2;

interface

type
  TSimpleObject = class
  private
    function DoSomething(WithThisValue: Integer): Boolean;
    procedure SoSomethingMore(const WithThisOtherValue: string);
  public
    constructor Create;
    destructor Destroy; override;
  end;

implementation

end.

4) Don't press CTRL+SHIFT+C

5) Go to implementation section

6) Type "function" and press CTRL+SPACE

7) Choose "TSimpleObject" (double click or press ENTER) this code is created :

function TSimpleObject;
begin

end;

8) Move the cursor after TSimpleObject, press "." (dot) the code completion box opens, select "DoSomething(WithThisValue: Integer)", press ENTER (or Double Click), the code is now :

function TSimpleObject.TSimpleObject;
begin

end;;
begin

end;

9) Move the cursor after TSimpleObject, add a left parenthesis "(", press CTRL+SPACE : nothing interresting happens.

10) Now you have to type the function paramaters by hand, or copy-paste from interface section.

11) And to delete the useless two lines

end;;
begin

12) You can try the same by typing constructor, destructor or procedure at step 6 instead of "function"




Workarounds
1) Copy the function / procedure declaration line from interface section
2) Paste the line in the interface section
3) Add the class name (here TSimpleObject) between the keyword and the method name (you can type TSimpl... let the code completion add the rest for you, it will work !)

4) Press "." (dot)

5) BUT DON'T PRESS ENTER when the code completion pops up or your code will be broken !

function TSimpleObject.DoSomething;
begin

end;DoSomething(WithThisValue: Integer): Boolean;
Attachment
None
Comments

Tomohiro Takahashi at 12/5/2011 6:19:50 PM -
> [Description]
> In my current project, CTRL+SHIFT+C to autocomplete classes dont work at all in no unit.
> ...
> [Steps]
> 4) Don't press CTRL+SHIFT+C
'CTRL+SHIFT+C' does not work in the sample unit? In my environment, it works fine.

Pierre Yager at 12/6/2011 12:48:49 AM -
Tomohiro Takahashi said - "> [Description]
> In my current project, CTRL+SHIFT+C to autocomplete classes dont work at all in no unit.
> ...
> [Steps]
> 4) Don't press CTRL+SHIFT+C
'CTRL+SHIFT+C' does not work in the sample unit? In my environment, it works fine.

Of course CTRL+SHIFT+C works with this sample unit!

But it don't work on my main project (848 000 LOC using tons of third part code so I cannot send it to you) and this problem seems to be related to QC 98928 (I have image resources added to my project)

What I wanted to show you is that when you cannot use CTRL+SHIFT+C, the code completion mecanism don't help you, at all, to create implementation declarations!

Tomohiro Takahashi at 12/6/2011 6:11:01 AM -
> ... it don't work on my main project ...
ok, if possible, could you please contact technical support service for more investigation? Sorry for inconvenience.
http://support.embarcadero.com/

Pierre Yager at 12/6/2011 6:40:20 AM -
What do you mean by "contact technical support" at http://support.embarcadero.com ? The right bottom square "Product Support" ?

Tomohiro Takahashi at 12/6/2011 5:46:31 PM -
Please visit
  Support Offerings - Single Incident
  http://support.embarcadero.com/incident

Pierre Yager at 12/7/2011 7:41:41 AM -
Sorry, I won't pay for that.

Markus Humm at 12/26/2012 2:51:14 AM -
Are you on SA? If yes you've got some incidents for free. Otherwise afaik there's the option to provide EMBT with your big project under NDA.

Pierre Yager at 12/6/2011 6:38:16 AM -
Willl you fix the code completion bug when one want to write implementation code without using CTRL+SHIFT+C ?

Server Response from: ETNACODE01