Scilab Backend to Cantor: Syntax Highlight and Tab Complete

I bring in this post some news about the Scilab backend to Cantor, my Google Summer of Code project in this year.

After the last weeks of work, two interesting features were implemented in the Scilab backend: syntax highlighting and tab complete for predefined functions and variables. These features are cool because they are present in most IDEs, and they, together with other features, are what make us want to write lines of code in IDEs, no in conventional text editors. :-)

These features were developed based on how they are implemented in Maxima backend: using XML file that lists all predefined functions and variables.

Some screenshots to demonstrate the operation of them. Below is the syntax highlighting in SciNotes, the Scilab default editor:

Syntax highlight in SciNotes

To find all the keywords of predefined functions names and variables, I used getscilabkeywords, a function that lists all the Scilab keywords. With it in hand, I could create the XML file with these data. Below is the syntax highlighting in Cantor:

      Syntax highlight in Cantor

There’s one detail to complete this feature: the highlight of predefined variables. But I’m talking with Alex Rieder to finish it.

Below, as a curiosity, the Scilab syntax highlighting in Cantor and SciNotes, side by side:

Syntax Highlight in Cantor and SciNotes

The other feature is the tab complete, which makes the Cantor suggest names of predefined functions or variables for the developer writing the code. In Cantor, simply enter any character and press the TAB key (default for this feature in this software).

In the picture below we have the autocomplete function names suggested for the word “plot” (the function of generating graphics in Scilab):

      Tab complete in action!

Unlike the syntax highlighting, the autocomplete is also working to predefined variables.

The code for this is Cantor repository, currently in scilab-backend branch. Feel free to test, but do not forget: you must compile Scilab also for try this backend!

Well, that’s it for now! The project is well advanced and, perhaps, we will support the Scilab in Cantor in KDE SC 4.8 version? ;-)

And who goes to Berlin we’ll see you there!

2 thoughts on “Scilab Backend to Cantor: Syntax Highlight and Tab Complete

Leave a Reply

Your email address will not be published. Required fields are marked *