a74b9e3083
Check if the provided argument is really a string. Shields against: ``` java.lang.ClassCastException: class org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj cannot be cast to class java.lang.String (org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @2415a13c; java.lang.String is in module java.base of loader 'bootstrap') at org.enso.tools.enso4igv.EnsoRootProject$LogicalView.findPath(EnsoRootProject.java:74) at org.netbeans.modules.project.ui.ProjectsRootNode.findNode(ProjectsRootNode.java:185) at org.netbeans.modules.project.ui.ProjectTab$2.run(ProjectTab.java:552) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018) Caused: org.openide.util.RequestProcessor$SlowItem ``` looks like the `findPath` argument doesn't have to be `String` as previously (and too optimistically) expected by the code. |
||
---|---|---|
.. | ||
nbproject | ||
src | ||
.gitignore | ||
.vscodeignore | ||
IGV.md | ||
package-lock.json | ||
package.json | ||
pom.xml | ||
README.md | ||
tsconfig.json | ||
webpack.config.js |
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:
Outline View
Since version 1.40 the extension fills content of Outline View on supported platforms (Linux amd64, Mac, Windows):
Debugging a Single Enso File
Open any .enso
files. Click left editor gutter to place breakpoints. Then
choose Run/Start Debugging. If asked, choose debug with Java+ (Enso is
Java virtual machine friendly). A prompt appears asking for path to bin/enso
binary:
Locate bin/enso
executable in the Enso engine download. If binding from source
code, the executable is located at root of
Enso repository in
./built-distribution/enso-engine-*/enso-*/bin/enso
. The .enso
file gets
executed and output is printed in the area below editor:
Workspace Debugging
To work with all Enso code base 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:
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:
It is now possible to place breakpoints into the Vector_Spec.enso
file. Let's
place one on line 120:
To debug the test/Base_Tests/src/Data/Vector_Spec.enso
file with the root of
Enso repository opened in the VSCode workspace, choose preconfigured Launch
Enso File debug configuration before Run/Start Debugging.:
The rest of the workflow remains the same as in case of individual (without any
project ).enso
file case.
Attach Debugger to a Process
Let's do a bit of debugging. Select "Listen to 5005" debug configuration:
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...
...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
:
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:
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.
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.