BookmarkSubscribeRSS Feed

As a heavy macro programmer, it would be very helpful if macro variable references had their own syntax highlighting rules.

 

Currently macro variable references are considered macro text within a macro definition, and I think they are considered normal text outside of a macro definition.

4 Comments
RikkeSBrandt
Calcite | Level 5

I totally agree. I would also like to add that I would find it useful if the 'normal' highlighting rules for datasteps and procs that exist outside of a macro, could be displayed inside the macro too. Often it is difficult to debug code, once it has been converted into a macro. Since all calls are in black text. 

 

Please consider this. 

 

Perhaps code could be highlighted with a different color in the EG when inside a macro, but following the same rules as outside. This way you could still distinguish macro syntax from other syntax even inside a long macro.

Casey_SAS
SAS Employee
Status changed to: Under Consideration

Thank you for submitting the suggestion. I agree that this would be a nice feature and we are reviewing the suggestion for a future release of SAS Enterprise Guide.

paulkaefer
Lapis Lazuli | Level 10

@Treyand @RikkeSBrandt: there is a way to get code within a macro function highlighted. See this tip on sasCommunity.org, which came about because of a similar thread here. There are two options, and what's nice is that you can use them or not, depending on your needs.

 

cc @Casey_SAS: from the tip discussion and what @Rick_SAS said in the original thread, there are good reasons the code SHOULDN'T be highlighted. But if you are debugging or expect your macro contents to be readable code, the linked tip can be useful.

Peter_L
Quartz | Level 8

This syntax highlighting would be useful in Display Manager too.

To clarify what is meant:

 

/* ----- some sample code ----- */
%include %unquote(&open.gtestit&close);

 

would look like this:

/* ----- some sample code ----- */

%include %unquote(&open.gtestit&close);

Where the orange highlighting shows the macro variable references. Your colour preferences may vary.

Other syntax highlighters can do this, for example the SAS mode delivered with jEdit.