Jump to content
Jud

Not greying out inactive code

Recommended Posts

Delphi 13 is not greying out inactive code in IFDEFs that are not on.  I looked for an option for this but I couldn't find it.

 

Is there an option for greying out inactive code?

Share this post


Link to post

No options, It is automatic. Try to close the Unit and reopen it again. Somtimes you must close the Project and reopen again.

Another options is to do a build: I see that after the build "normally" all things works.

 

All of this depends where the "definition" is declared: is it in Project options ? Or in one unit of the Project ? Or in one unit outisde the Project ?

 

There is this topic too: https://en.delphipraxis.net/topic/13722-define-conditional-symbol-in-dpr/?do=findComment&comment=105371

Share this post


Link to post

Thanks.  I tried closing the project.  I looked in two other projects.  I did a build.  Nothing fixed it.  The other two projects had the same problem.  I think it was working the other day.

 

The DEFINEs are in the source code of the unit.

 

It does ignore the code, but it doesn't grey it out.

Edited by Jud

Share this post


Link to post
On 10/3/2025 at 12:10 PM, Jud said:

I think it was working the other day.

So you are saying it was working the other day in 13 and now its not? Or, were you using an older version before and then upgraded to 13 and it stopped working?

Share this post


Link to post

I thought it was working the other day, but I'm not certain.  I just noticed that it wasn't working yesterday.

 

I was using 12.3 and installed 13.0.  It is still working in 12.3 (same computer).

Share this post


Link to post

Greying out suppressed code is working as expected in D13 for the ICS component library.  ICS has a lot of defines and optional code, greying is a very useful feature.  

 

Angus

 

Share this post


Link to post

It does not work when the Code Insight Manager is set to Classic Code Insight, but that is expected.

Share this post


Link to post
7 hours ago, Uwe Raabe said:

It does not work when the Code Insight Manager is set to Classic Code Insight, but that is expected.

Thanks, that was the problem!  I had "none" selected.  I turned off a lot of this stuff because it is so annoying for it to add "True then" every time I type "if".

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×