Jump to content
Ian Branch

{$Defines xxxx} not working at design time..

Recommended Posts

Hi Team,

Win 11, D12.1.

They used to, but I have just noticed that if I disable a DEFINE, {.DEFINE XXXXX}, the code between the {$IFDEF XXXXX} & {$ENDIF} no longer greys out the code inbetween.

It used to.

If I create a new project and do that, it works.

Is there somewhere in my projects that I may have inadvertantly switched off that would cause this?

This is an actual example where the code isn't being greyed out:

image.png.802b0de556998523290da7ba0ffafd6e.png

Regards & TIA,

Ian

Share this post


Link to post

I have noted something like this by the {$IFDEF DEBUG} switch in D11.3.

When switching the "Build Configurations" from Debug to Release nothing happens.

When staying in the Unit and do Compile or Build nothing happens.

but

When I switch in the editor from that source/unit tab to another source and back it  works and

the editor will gray-out the proper sourcecode.

Share this post


Link to post
Posted (edited)
16 minutes ago, Die Holländer said:

When I switch in the editor from that source/unit tab to another source and back it  works and

the editor will gray-out the proper sourcecode.

Nope.  Didn't work.

The IDE knows about the {.$DEFINE  XXXXX} because further down code that was enabled by the Define shows as an error in the Structure.

At run time all is as it should be.

 

I have also noticed Conditionals from the Project aren't being handled correctly at Design time either.  😞

Edited by Ian Branch

Share this post


Link to post
54 minutes ago, Ian Branch said:

but I have just noticed that if I disable a DEFINE, {.DEFINE XXXXX}, the code between the {$IFDEF XXXXX} & {$ENDIF} no longer greys out the code inbetween.

As this feature is driven by LSP, it looks like the code contains a construct LSP is stumbling about. Do you notice any other problems with Ctrl-Click navigation, error insight or code insight?

Share this post


Link to post
Posted (edited)

Hi Uwe,

Ctrl-Click works fine.

CodeInsight doesn't throw anything up.

ErrorInsight doesn't show anything.

 

Ian

Edited by Ian Branch

Share this post


Link to post

FWIW, it is doing it on all my projects, even ones I haven't touched in a while.  😞

Share this post


Link to post

I just checked an old Console App and it is doing the same thing there.  😞

Share this post


Link to post

I can create a new project and it all works fine/as expected.

Share this post


Link to post

The IDE can be strange from time to time. I have a unit that I cannot edit it. If you try to add a property the editor will jump to another line. The only way to edit is to paste the text from another editor. I have tried to create a sample project to reproduce the bug and report it and failed. When I copy the class that fails in the text project I cannot reproduce the bug.

Share this post


Link to post

Thank you to all for your input so far.  Appreciated.

The fact that I can create a New project and it works fine suggests that the functionality itself is still there and working.

I opened a project that I hadn't touched for months, it worked fine....

Which suggests something related to ALL my current projects.

I tried adding a new form to a current project and testing, same result. 😞

 

Share this post


Link to post

Found it!!!

Seems somehow all my current .dproj files have been corrupted. 😞

Deleted and rebuild, all good.

Very strange.

Thanks to all for your inputs, appreciated.

Ian 

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

×