This page is announcing the creation of the extension, it might not be up-to-date. Please see the GitHub repository for more information.
Here, we are detailing how to set-up VSCode to use the extension, then we present the main features of the extension, and future features.
Five steps are required to install the plugins.
- Install VSCode
- Install the Pharo extension
- Download a Pharo Language Server image or install the server in a pre-existing image
- Download a VM (headless or not) for the image
- Set up the Pharo extension property
pharo.pathToVM: is the path to the VM executable
pharo.pathToImage: is the absolute path to the image
We present here the existing features
- Code highlighting
Supported Language Server feature
- Code formatting
When moving a cursor over a class, it shows the comment of the class. The hover popup supports markdown. So it can be use to print nice comment from Pharo 9.
We used the completion engine of Pharo to compute the entries.
Not that for keywords with several symbols, it is possible to use the
<Tab> key to move from one argument to another.
The additional feature can be access using the command palette of VSCode
- Save the Pharo image
- Execute and show the result
- Execute and print the result
- Keep variable state
- Show the current server version
- Saving a tonel file in VSCode, save the corresponding methods/class in the Pharo image
Three major features are coming (and will require time).
- From Pharo to VSCode
- From VSCode to Pharo
- Debug Adapter Protocol
- Notebook (VSCode preview)
We plan to add commands to VSCode to allow synchronization between Pharo and VSCode. The idea is to be able to install a set of classes from the VSCode editor inside the opened Pharo Image. A typical use case is then:
- Clone from git a Pharo project
- Open the project in VSCode
- Synchronize the project with the image
Another possibility will be to synchronize a project already present in the image with a ongoing VSCode session. A typical use case is then:
- Open VSCode
- Install a project using Metacello with a VSCode command
- Synchronize the interesting projects inside the VSCode editor
Debug Adapter Protocol
Debug Adapter Protocol (DAP) is a generic protocol that can be used to control debugger. We plan to add support of the DAP over our extension. With this extension, it will be possible to debug Pharo application using several editors (VSCode, Emacs, Vim, Eclipse, …).
VSCode is currently testing a Notebook feature (as Jupyter). We already have most of the required material to implement a Pharo Notebook using the VSCode API. This will be our priority as soon as the stable VSCode notebook API will be released.