-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute and debug .enso
files with bin/enso
in VSCode
#8923
Conversation
if (lkp.lookup(EnsoDataObject.class) != null) { | ||
return true; | ||
} else { | ||
var fo = lkp.lookup(FileObject.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be simpler to do just lookup(EnsoDataObject.class) != null
, but that doesn't work currently. I needs apache/netbeans#7011 (comment) fix first which is going to be part of NetBeans 21 only. E.g. we need to keep this lookup(FileObject.class).getLookup().lookup(EnsoDataObject.class))
workaround.
To witness what has been done so far follow these instructions: Get NetBeans sources at
at least that's a commit known to work. Follow instructions in VSCode extension BUILD. E.g. netbeans$ ant build
netbeans$ cd java/java.lsp.server
java.lsp.server$ ant build-vscode-ext In parallel follow Enso instructions to build VSIX file $ENSO_REPO_ROOT/tools/enso4igv$ mvn clean package nbm:cluster -Pvsix
...
[INFO]Created NetBeans module cluster(s) at /home/devel/NetBeansProjects/enso/enso/tools/enso4igv/target/netbeans_clusters
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
... and then execute everything as:
once the JVM based LSP is started also launch VSCode with:
then you'll be able to open After locating and pasting the enso executable there (for example Or (rather than building the extension yourself), download the .vsix file from here and install |
</dependencies> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<netbeans.version>RELEASE113</netbeans.version> | ||
<netbeans.version>RELEASE140</netbeans.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While working on this code base, I am trying to make sure the code works as:
- VSCode extension
- NetBeans module
- IGV module
The biggest challenge is support for IGV as it is not being updated to run on latest NetBeans version too frequently.
However for this PR I need DialogDisplayer.notifyFuture (thank you, @sdedic) which is only available since NetBeans 14 - e.g. we have to upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With oracle/graal#8290 the Enso IGV Plugin version 1.31.129 can be installed into IGV:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like it could make sense to also allow to choose to run using the launcher. Not necessarily in this PR, but I think it would be a neat improvement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very cool!
.enso
files with bin/enso
in VSCode.enso
files with bin/enso
in VSCode
private final ExplicitProcessParameters params; | ||
private final Future<String> computeAddress; | ||
|
||
DebugAndLaunch(FileObject script, ProcessBuilder builder, ExplicitProcessParameters params) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got debugging working. Execute VSCode with empty directories:
$ code --extensions-dir /tmp/ext --user-data-dir /tmp/usr
install the .vsix
1.31.138 extension and open some .enso
file
Right now the debugging seems to work when there is no workspace opened - opening root of Enso repository as workspace prevents the debugging to work. Still investigating how to fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great - nice to have a more official way than my quick solution :)
I have done manual testing VSCode extension enso4vscode-1.33.29.vsix and I think it works. @ola-lis, can you please upload the |
I am not using launcher myself, but it should be fairly trivial to update the extension to work with it. The code should be somewhere here, if you want to enhance it to also work with the launcher. |
Turns out that #8923 isn't enough to support debugging of `Vector_Spec.enso` when root of Enso repository is opened as a folder/workspace. To allow debugging of `Vector_Spec.enso` two changes are needed. One is provided in this PR, the other one will be integrated as apache/netbeans#7105
Pull Request Description
Let's untie the VSCode Enso extension from
sbt
commands. Let's open any Enso file in the editor and then use F5 or Ctrl-F5 to execute it. Let the user choose whichbin/enso
script to use for execution completely skipping the need forsbt
.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Java,
style guides.
--dump-graphs
- done in 2fb11ac