AComputer
AComputer

Reputation: 529

Ctr Space in delphi

In a Delphi Project CTRL + Space not working. Before "uses" when I Press CTRL + Space the code completion is appeared but after "uses" does not appear. I use Delphi 2009. I install Fastreport and raize components and vcl Skin.

Upvotes: 3

Views: 3551

Answers (4)

AngelsGR
AngelsGR

Reputation: 1

I had the same problem I press Ctrl+Space to all units in uses section and I see one unit Delphi can't recognize. I delete it and type it again with Ctrl+Space; after that everything is ok.

another reason is if exists a special character like a tab character in your unit.

Upvotes: 0

Gregg
Gregg

Reputation: 1

The "So watch out for {$IFDEF ...} in your code." had this. Temporarily did a Ctrl-X on it and then did Ctrl+Spacebar and pasted the code back in. Then... it worked again. Delphi XE10.1 Update 2. Other reasons why it sometimes doesn't work still remain a mystery. Can be very frustrating indeed.

Upvotes: -1

Disillusioned
Disillusioned

Reputation: 14842

Something that in general wreaks havoc with Code Insight (Ctrl+Space) is conditional compilation.
So watch out for {$IFDEF ...} in your code.

I prefer to avoid conditional compilation in anything except library code that needs to support multiple Delphi versions. However, if you must use it, consider inverting the logic so you can use {$IFNDEF ...}.

Also, the feature doesn't always work if your code cannot compile. This depends on what dependencies are unable to compile at the point where you press Ctrl+Space.

However, in my experience the feature does sometimes just "break". If you're lucky closing and re-opening the project fixes it. But usually I have to close and re-open Delphi and do a full rebuild of the project.

Upvotes: 2

SilverWarior
SilverWarior

Reputation: 8396

The most probable cause for your problem is that you have some smal syntactical error like missing semicolom, invalid name, etc. somewhere between the point where CTRL+Space works and where no longer works. This is due the way how Code Insight is checking the code structure.

So I recomend you go to menu Project and then chose Syntax Check.

Another cause for CTRL+Space not working is that your are still debuging your program. Do nte that while debugging sesion is in progress both Code Insight and Error Insight are disabled.

Upvotes: 4

Related Questions