-
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
Downloadable VSCode extension #7861
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0b0f1f8
Archive VSCode extension
JaroslavTulach 1456304
Dedicated documentation page for VSCode extension
JaroslavTulach 2473055
Updating changelog with a note about VSCode extension
JaroslavTulach cd1ef38
Prepare standard Enso+Java debugging configuration
JaroslavTulach e438761
Adding configuration for DAP
JaroslavTulach e6ae16d
Better image name
JaroslavTulach cdb0ba9
Merge branch 'develop' into wip/jtulach/BuildVsixExtension
JaroslavTulach 15b82f5
Applying prettier formatting
JaroslavTulach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Listen to 5005", | ||
"type": "java+", | ||
"request": "attach", | ||
"listen": "true", | ||
"hostName": "localhost", | ||
"port": "5005" | ||
}, | ||
{ | ||
"name": "Debug Adapter Protocol", | ||
"type": "node", | ||
"debugServer": 4711, | ||
"request": "attach" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
<artifactId>enso4igv</artifactId> | ||
<packaging>nbm</packaging> | ||
<name>Enso Language Support for NetBeans & Ideal Graph Visualizer</name> | ||
<version>1.13-NAPSHOT</version> | ||
<version>1.15-SNAPSHOT</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the "major and minor" version of the |
||
<build> | ||
<plugins> | ||
<plugin> | ||
|
@@ -224,6 +224,18 @@ | |
<goal>install</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>version</id> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<command>version</command> | ||
<args> | ||
<arg>${project.version}</arg> | ||
</args> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>vsix</id> | ||
<phase>post-integration-test</phase> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Enso Language Support for VSCode | ||
|
||
[![Enso Language Support for VSCode](https://github.com/enso-org/enso/actions/workflows/enso4igv.yml/badge.svg)](https://github.com/enso-org/enso/actions/workflows/enso4igv.yml) | ||
|
||
## Downloading | ||
|
||
**Download** _"VSCode Extension" artifact_ from the | ||
[latest actions run](https://github.com/enso-org/enso/actions/workflows/enso4igv.yml), | ||
unzip, install into VSCode: | ||
|
||
![Install from VSIX file](https://github.com/enso-org/enso/assets/26887752/9d7c35d6-44b2-4157-b451-bb27980425c7) | ||
|
||
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](https://github.com/enso-org/enso/assets/26887752/7dcfc0a0-8e7f-4aa6-ae67-99c3f875a658) | ||
|
||
## Using & Debugging | ||
|
||
Once installation is over let's continue with choosing _File/Open Folder..._ and | ||
opening root of [Enso Git Repository](http://github.com/enso-org/enso) | ||
(presumably already built with | ||
[sbt buildEngineDistribution](../../docs/CONTRIBUTING.md#running-enso)). | ||
Following set of projects is opened and ready for use: | ||
|
||
![Enso Projects](https://github.com/enso-org/enso/assets/26887752/7919d2ee-4bcd-4b7b-954a-e2dc61f7c01a) | ||
|
||
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](https://github.com/enso-org/enso/assets/26887752/0d182fc8-4ff9-48d7-af63-35cad5fb75cc) | ||
|
||
It is now possible to place breakpoints into the `Vector_Spec.enso` file. Let's | ||
place one on line 120: | ||
|
||
![Breakpoint](https://github.com/enso-org/enso/assets/26887752/b6ae4725-49ef-439f-b900-3e08724e3748) | ||
|
||
Let's do a bit of debugging. Select _"Listen to 5005"_ debug configuration: | ||
|
||
![Listen to 5005](https://github.com/enso-org/enso/assets/26887752/1874bcb1-cf8b-4df4-92d8-e7fb57e1b17a) | ||
|
||
And then just | ||
[execute the engine distribution](../../docs/CONTRIBUTING.md#running-enso) in | ||
debug mode: | ||
|
||
```bash | ||
sbt:enso> runEngineDistribution --debug --run test/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](https://github.com/enso-org/enso/assets/26887752/54ae4126-f77a-4463-9647-4dd3a5f83526) | ||
|
||
...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](https://github.com/enso-org/enso/assets/26887752/db3fbe4e-3bb3-4d4a-bb2a-b5039f716c85) | ||
|
||
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](https://github.com/enso-org/enso/assets/26887752/98eb0bb7-48c2-4208-9d9a-5b8bacc99de2) | ||
|
||
## Building VSCode Extension | ||
|
||
To build thisVSCode 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...](https://user-images.githubusercontent.com/26887752/210131513-8c729f9b-5ddc-43aa-9ad5-420b7d87d81d.png) | ||
|
||
Once the `.vsix` file is created, it can be installed into VSCode. Select | ||
_Extension perspective_ and choose _Install from VSIX..._ menu item. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Every build of
enso4igv.yml
github action produces extension with a unique version. The major and minor numbers are specified by human and are taken from thepom.xml
. The "micro" version is the$GITHUB_RUN_NUMBER
.To avoid the "micro" version to reach the sky, feel free to bump the minor version and then decrease the
$GITHUB_RUN_NUMBER
by a constant (currently1666
) to start counting from zero again.