IkoLogs
IkoLogs

Reputation: 59

Enable intellisense for inactive code region

Looking for tips regarding doing C# with visual studio.

I need a way to enable intellisense for code between pre-processor #if/#endif.

Normally such code is greyed out, How can i disable this greying out.

Even though the code is not being compiled i still need intellisense on the code.

Cheers

Upvotes: 0

Views: 656

Answers (1)

Mr Qian
Mr Qian

Reputation: 23808

Actually, if you want to get the intellisense for the gray part, you only have to make the condition of the gray part to be true. And there is no other way to realize it.

If you use the pre-processor in a specific configuration, you can try the following two suggestions to get the intellisense.

Suggestion

In my side, the test is defined under DefineConstant of Debug.

enter image description here

1) change the condition of the two parts and when you modiy the first part, make the condition of it to true.

enter image description here

2) or create a new Configuration called Test which does not have such pre-processor and when you modify the gray part, just change to Configuration to Test, and then you can modify the gray part.

Upvotes: 1

Related Questions