Version 2020.2 is out

The new 2020.2 release of the Wolfram Language Plugin (WLP) is out, and some of you might wonder if they missed the post about the 2020.1 version. No, you did not. I had a draft of this post ready for a long time but then, something unexpected happened to all of us which had a substantial effect on our daily routines. Therefore, let’s call this the “Wolfram Language Plugin version 2020 post” that had to wait until version 2020.2. I’d like to highlight some old and new features that you might not know did exist.

Firstly, the 2020 release comes with support for the Wolfram Language 12.1 and includes all its functions, options and documentation right at your fingertips. The extraction of all this information from a new version of Mathematica is always a challenge since you need to access options, usages, and attributes for thousands of built-in symbols and bring everything into a consistent format. My friend Szabolcs Horvát helped quite a bit in this endeavor, and we were able to almost completely rewrite how we can automatically extract information about Mathematica’s symbols. The package is available on GitHub and if you’re interested how you can turn a Mathematica usage message into HTML, you should have a look at it.

If you haven’t seen it already, you can display the usage message of your own functions by using “Quick Documentation” (Ctrl + Q on Linux and Windows) when your cursor is over any usage of the function. Note that the package-wide (and across packages) resolution of symbols also relies on the existence of usage messages. So when you have defined a function with a usage message in file A and you are using it in a file B, you can navigate to the definition by pressing Ctrl + B.

Another feature that is mostly unknown is that Wolfram introduced an alternative and especially for beginners easier way to define which symbols in a package are private, which are package-wide symbols, and which will be exported for direct use to the end-user. I’m not going into details here, but you can read this StackExchange post or look into the package SystemFiles/Components/HTTPHandling/Main.m in your Mathematica 12.1 installation for examples. To give you the gist: It simplifies the handling of contexts inside packages by introducing static directives Package, PackageScope, and PackageExport that you can use to define which symbols are package-private or exported. The plugin recognizes this new package format and provides highlighting, autocompletion and resolving of the arguments you provide to the new package directives.

New Package Style

Another thing you might have missed is that the WLP integrates into IntelliJ’s markdown capabilities and lets you use fenced codeblocks that are tagged with wl or mathematica. That means, you get syntax highlighting for Wolfram Language code directly within a markdown file. As you can see in the screenshot below, it supports advanced syntax highlighting like coloring of local variables.

Markdown Support

Have you tried the “Show Parentheses” feature you find in the Wolfram Language menu entry? It displays your code with additional parentheses and lets you quickly see the order of evaluation. This is a temporary display that you can exit by pressing Esc.

Markdown Support

Other small improvements include that you can now open notebooks directly from within IDEA, and it will use your operating system to find the Mathematica installation used for opening the file. The folding of code was also extended to more places since users seem to love folding their code.

In the end, I would like to clear things about licencing up once more since I heard that a few users were disappointed that the WLP is not open-source anymore. Since last year, the WLP is available on the Jetbrains Marketplace, and you need a free, or a paid license to use it. That was a step I planned for a long time and I explained in detail why it was necessary:

why change the Wolfram Language Plugin from a free, open-source project to a paid service? Back in 2012, I was hoping it can be a community project with several people working on the code. However, it is 2019, I’m still working alone, and it’s safe to say that this plan has failed. Maintaining code, developing new features, and taking care of the website and user communication takes a good portion of my free time. If the revenue from the subscriptions helps me to pay the bills, I can set apart more official time to work on the plugin. If this works out, the users will benefit because when more time is spent on the plugin, the quality of features and documentation will increase.

With over 80k downloads, and the plugin working on 16 of Jetbrain’s major IDEs, it should be obvious maintaining the WLP is more than just a small side-project.

Also, some users have been confused, because there was no need for a license until the end of 2019 although the plugin was already on the Jetbrains Marketplace. The reason is that the Marketplace wasn’t ready for IntelliJ Community products, and there were two choices: Give the WLP for free for the time being or don’t allow it on IntelliJ Community products. I decided for the first option so that users of, e.g. Community IDEA could use the WLP on an “extended trial”.

The WLP specifically targets package developers who build polished packages that they usually want to distribute either open-source or professionally. Open-source developers, students, people from academia, or teachers working in a classroom can get a free license for the WLP. Therefore, the paid licenses are for professionals or companies who make money with their work. By sharing some of their revenue, I get something back for my time and with paying customers, it’s my obligation to set aside time for maintaining the plugin. It’s a win-win for everyone.