SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => SlickEdit® Core for Eclipse™ => Topic started by: terryarno on July 29, 2010, 10:31:08 pm

Title: Activate Preprocessor directives for languages other than C/C++
Post by: terryarno on July 29, 2010, 10:31:08 pm
We use in-house languages here at work and we have those set up and running fine with SE Core. The languages use the standard C preprocessor directives so we would like to have the "Preprocessor directives" activated in Display/Selective Display... for our languages.

Is there a way to do that?

Thanks,
Terry
Title: Re: Activate Preprocessor directives for languages other than C/C++
Post by: Ryan on July 30, 2010, 02:37:39 pm
I think so.  Try this...

Open up ECLIPSEDIR/plugins/com.slickedit.windows.libs_3.5.1/slickedit/macros/seldisp.e in Eclipse with the SlickEdit editor.  The path might be slightly different based on what platform you are on, and what version of Core you are running.  Find the function _preprocessing_supported...it should be about on line 357.  Change the return statement in that function from what it is:

Code: [Select]
return(lang=='c' || lang=='cs' || lang=='pas' || ('.'lang==_macro_ext));

to something like this:

Code: [Select]
return(lang=='c' || lang=='cs' || lang=='pas' || ('.'lang==_macro_ext) || lang=='mylang');

where 'mylang' is the p_LangId value for your in house language.  Now load the macro with F12.  Now if you open one of your in-house language files and go to Display > Selective Display, is the "Preprocessor directives" option enabled?

- Ryan
Title: Re: Activate Preprocessor directives for languages other than C/C++
Post by: terryarno on July 30, 2010, 06:17:38 pm
Hey, that works great!

Thanks, Ryan
Title: Re: Activate Preprocessor directives for languages other than C/C++
Post by: Ryan on July 31, 2010, 03:38:22 am
Awesome!  Glad to hear it.

- Ryan