enso/tools/enso4igv
2024-01-17 16:19:19 +01:00
..
src More robust against debris in the repository (#8596) 2023-12-20 15:24:55 +01:00
.gitignore Icon and documentation for Enso VSCode extension (#8051) 2023-10-15 04:43:26 +00:00
.vscodeignore Basic VSCode support for Enso language and development (#4014) 2023-01-06 14:18:20 +00:00
IGV.md Icon and documentation for Enso VSCode extension (#8051) 2023-10-15 04:43:26 +00:00
package-lock.json Bump webpack from 5.75.0 to 5.76.0 in /tools/enso4igv (#7057) 2023-07-19 19:52:19 +03:00
package.json Icon and documentation for Enso VSCode extension (#8051) 2023-10-15 04:43:26 +00:00
pom.xml Icon and documentation for Enso VSCode extension (#8051) 2023-10-15 04:43:26 +00:00
README.md Rename Tests to Base_Tests to be more descriptive (#8781) 2024-01-17 16:19:19 +01:00
tsconfig.json Basic VSCode support for Enso language and development (#4014) 2023-01-06 14:18:20 +00:00
webpack.config.js Basic VSCode support for Enso language and development (#4014) 2023-01-06 14:18:20 +00:00

Enso Language Support for VSCode

Enso Language Support for VSCode

Downloading

Enso Tools for VSCode is available from VSCode marketplace. Simply install it from there.

It is possible to download the latest development version of the "VSCode Extension" artifact from the latest actions run. After downloading the ZIP file unzip a .vsix from it and install the .vsix file into VSCode.

Your Enso files will get proper syntax coloring. You'll be able to debug Java/Enso code interchangeably.

After installing the Enso .vsix file (and reloading window) we can find following two extensions in the system:

Installed VSCode extensions

Using & Debugging

Once installation is over let's continue with choosing File/Open Folder... and opening root of Enso Git Repository (presumably already built with sbt buildEngineDistribution). Following set of projects is opened and ready for use:

Enso Projects

With the workspace opened, you can open any Enso or Java file. Let's open for example Vector_Spec.enso - a set of unit tests for Vector - a core class of Enso standard library:

Openning Vector

It is now possible to place breakpoints into the Vector_Spec.enso file. Let's place one on line 120:

Breakpoint

Let's do a bit of debugging. Select "Listen to 5005" debug configuration:

Listen to 5005

And then just execute the engine distribution in debug mode:

sbt:enso> runEngineDistribution --debug --run test/Base_Tests/src/Data/Vector_Spec.enso

After a while the breakpoint is hit and one can inspect variables, step over the statements and more...

Breakpoint in Enso

...as one can seamlessly switch to debugging on the Enso interpreter itself! One can place breakpoint into Java class like PanicException.java and continue debugging with F5:

Breakpoint in Java

Should one ever want to jump back from Java to Enso one can use the "Pause in GraalVM Script" action. Select it and continue with F5 - as soon as the code reaches a statement in Enso, it stops:

Pause in GraalVM

Read more on Enso & Java Debugging

Building VSCode Extension

To build this VSCode extension and obtain Enso syntax coloring as well as support for editing and debugging of engine/runtime sources in VSCode:

enso/tools/enso4igv$ mvn clean install -Pvsix
enso/tools/enso4igv$ ls *.vsix
enso4vscode-*.vsix

one needs to have npm, Java and mvn available to successfully build the VSCode extension.

Install from VSIX...

Once the .vsix file is created, it can be installed into VSCode. Select Extension perspective and choose Install from VSIX... menu item.

Reference

There are extensions for NetBeans and also for IGV. Read more here.