We recently upgraded to SlickEdit 2017.
However, the Macro 'GenComment' by Gary Ash doesn't work anymore.
I already contacted him, but he doesn't have SE 2017, so I (and he) was hoping someone here can help us further with getting GenComment working again on SE 2017.
Some background information about the Macro if you don't know it: it is able to create a comment-box above a function with a fixed layout. It can extract ingoing and outgoing parameters and the function name so a nice comment-box is created with a fixed style. In the fixed box you can of course enter additional comment after the parameter variable names to explain the parameters and the complete function.
We are using it for a couple of years now and it's really handy.
After some research by myself I got it working now, but it's not as flexible as it should be.
Gary Ash also gave a reaction and he says the so called 'lexer' system has changed, which is indeed true. However, I have no knowledge about this 'lexer' system so it would take me a lot of time to adjust the current GenComment to the new 'lexer' system.
Hope someone can help me (and of course others) by adjusting GenComment to be compatible with SlickEdit 2017.
I have it working now, but not very flexible.
It works for us because we only do C programming and only need a commentbox above the functions in a .C file.
What I have done is disabled searching for the ‘Lexer’ files like this in 'gc_comment.e':
//g_VslickLexerFile = slick_path_search(SYSTEM_LEXER_FILENAME);
//g_UsersLexerFile = slick_path_search(USER_LEXER_FILENAME);
//g_UserStateFile = slick_path_search(STATE_FILENAME);
And I removed ‘MB_DEFBUTTON2’ from an option list, SE 2017 doesn’t known that, so:
_message_box("Are you sure?", "Delete GenComment Configuration", MB_YESNO|MB_ICONQUESTION) == IDYES)
Loading the macro file ‘gc_comment.e’ does work after that and an .ex is created.
What doesn’t work is the macro ‘gc-configure’. It fails.
However, what does work is ‘gc-edit’ what we use to get the correct commentbox above a function which we need.
I have searched for another, SE included macro, how they now do the Lexer system, but it’s too difficult for me to simply adjust it without any knowledge of what it exactly does.
Here an example on the an old Lexer system in an older file (SE v11) and the new SE 2017.
I took the included ‘enum.e’
In SE v11:
--
_str lexer_name=p_lexer_name;
p_buf_id=old;
if (lexer_name!="") {
_str filename=usercfg_path_search(USER_LEXER_FILENAME);
typeless status=1;
_str styles="";
if (filename!="") {
status=_ini_get_value(filename,lexer_name,"styles",styles,"");
}
filename=get_env('VSROOT'):+(SYSTEM_LEXER_FILENAME);
if (filename!="") {
// IF there was an error and it wasn't because the string did not exist in the section
if (status && status!=STRING_NOT_FOUND_RC) {
_ini_get_value(SYSTEM_LEXER_FILENAME,lexer_name,"styles",styles,"");
}
}
if (pos("xhex",styles,1,"i")) {
gleading="0x";
} else if (pos("amphhex",styles,1,"i")) {
gleading="&H";
} else if (pos("hexh",styles,1,"i")) {
gtrailing="H";
} else if (pos("dollarhex",styles,1,"i")) {
gleading="$";
}
}
if (gleading=="" && gtrailing=="") {
gleading="0x";
}
--
==
In SE 2017:
--
_str lexer_name=p_lexer_name;
p_buf_id=old;
if (lexer_name!="") {
styles:=_plugin_get_property(VSCFGPACKAGE_COLORCODING_PROFILES,lexer_name,'styles');
if (pos("xhex",styles,1,"i")) {
gleading="0x";
} else if (pos("amphhex",styles,1,"i")) {
gleading="&H";
} else if (pos("hexh",styles,1,"i")) {
gtrailing="H";
} else if (pos("dollarhex",styles,1,"i")) {
gleading="$";
}
}
if (gleading=="" && gtrailing=="") {
gleading="0x";
}
--
Hope someone can help me/us further.