- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Syntax Highlighting
Does anyone have a list of all internal functions and constants used in JSL, or better yet a Lexer or similar file for syntax highlighting?
I use git and gitlab for version control of JSL scripts and would like to see syntax highlighting on the web interface for JSL scripts like for other languages. Gitlab uses Rogue for syntax highlighting so it is possible to submit highlighting rules (similar to these) to be included in future releases.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Syntax Highlighting
Here's a way to get the Function Names and Object (mostly platform) Constructors from the Scripting Index. There's also the Show Commands() function to get a list of all functions (even a few that are not in the SI).
Main Menu( "Scripting Index" );
cmb = Window( "Scripting Index" )[Combo Box( 1 )];
lb1 = Window( "Scripting Index" )[ListBoxBox( 1 )];
lb2 = Window( "Scripting Index" )[ListBoxBox( 2 )];
cmb << Set( Contains( cmb << get Items(), "Functions" ) );
lb1 << Set Selected( 1 );
functionNames = lb2 << get items;
cmb << Set( Contains( cmb << get Items(), "Objects" ) );
objectConstructorNames = lb1 << get items;
// clean up the extra spaces
For( i = 1, i <= N Items( objectConstructorNames ), i++,
objectConstructorNames[i] = Trim( objectConstructorNames[i] )
);
show( functionNames, "", objectConstructorNames );
Let me know if you get something working!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Syntax Highlighting
Here's a way to get the Function Names and Object (mostly platform) Constructors from the Scripting Index. There's also the Show Commands() function to get a list of all functions (even a few that are not in the SI).
Main Menu( "Scripting Index" );
cmb = Window( "Scripting Index" )[Combo Box( 1 )];
lb1 = Window( "Scripting Index" )[ListBoxBox( 1 )];
lb2 = Window( "Scripting Index" )[ListBoxBox( 2 )];
cmb << Set( Contains( cmb << get Items(), "Functions" ) );
lb1 << Set Selected( 1 );
functionNames = lb2 << get items;
cmb << Set( Contains( cmb << get Items(), "Objects" ) );
objectConstructorNames = lb1 << get items;
// clean up the extra spaces
For( i = 1, i <= N Items( objectConstructorNames ), i++,
objectConstructorNames[i] = Trim( objectConstructorNames[i] )
);
show( functionNames, "", objectConstructorNames );
Let me know if you get something working!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Syntax Highlighting
Along related lines, does anyone have the necessary customization file so that Notepad++ displays JSL files with the proper syntax colorization?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Syntax Highlighting
Here's a Notepad++ syntax highlighter I just threw together using Notepad++'s built-in tool. It obviously won't work as well as the regular JSL Script Editor, but it might do the job.
Here's a preview:
I had to zip the file since the User Community does not allow uploading XML files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Syntax Highlighting
Nice idea @pmroz and thank you @Justin_Chilton! I didn't even think all the time I spend in Notepad++. Now I finally have syntax highlighting for .jmpcust and .def files too!
If I ever find myself with a free evening I will work on a Lexer for Rogue. If I submit something I will let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Syntax Highlighting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Syntax Highlighting
Old thread, but just an update that @Justin_Chilton updated Rogue to have some basic jsl and it got integrated into Gitlab in 12.5+.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Syntax Highlighting
Than you @Justin_Chilton, as usual you rock!!!