Skip to content
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

Enso Integration with Ideal Graph Visualizer #3533

Merged
merged 23 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
057aa6c
Ideal Graph Visualizer and NetBeans support for Enso language
JaroslavTulach Jun 16, 2022
75b5ba4
GitHub Actions workflow that builds enso4igv using Maven
JaroslavTulach Jun 16, 2022
b1eb32b
Specify path to the LICENSE file
JaroslavTulach Jun 16, 2022
8eaee7a
Upload .nbm file as a ZIP artifact
JaroslavTulach Jun 16, 2022
16bfe00
Describing download steps
JaroslavTulach Jun 17, 2022
52ebbf2
One needs to be logged into GitHub
JaroslavTulach Jun 17, 2022
e828675
Set the version based on GitHub run number
JaroslavTulach Jun 17, 2022
9d4aed6
Screenshots guiding thru the installation process
JaroslavTulach Jun 17, 2022
0559799
Example of using IGV with Enso integration to analyze sieve.enso program
JaroslavTulach Jun 20, 2022
4255973
Highlight locations of the toolbar icons
JaroslavTulach Jun 20, 2022
342b43e
Only trigger rebuild when Enso for IGV files project are changed
JaroslavTulach Jun 20, 2022
f2fcfd4
Prettier formatting of enso4igv documents
JaroslavTulach Jun 20, 2022
03d462b
Formatting
JaroslavTulach Jun 20, 2022
870ef47
Set working directory
JaroslavTulach Jun 20, 2022
d651c83
IGV and Enso language support are operating system neutral
JaroslavTulach Jun 20, 2022
e95041c
Note in CHANGELOG.md
JaroslavTulach Jun 20, 2022
a6ecd23
Don't include large png snapshots in the repository
JaroslavTulach Jun 20, 2022
b7a797d
npx prettier
JaroslavTulach Jun 20, 2022
3f92169
Launchers have to recognize --dump-graphs option
JaroslavTulach Jun 22, 2022
45e51f0
Cross linking with runtime-guide.md
JaroslavTulach Jun 22, 2022
c49c766
Updating README according to Hubert's review comments
JaroslavTulach Jun 22, 2022
1aab449
Correcting a simpler typo seems to fix the script for Windows 11
JaroslavTulach Jun 22, 2022
7d04edf
Merge branch 'develop' into wip/jtulach/enso4igv-182388312
mergify[bot] Jun 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/enso4igv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Enso Language Support for IGV

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop]
JaroslavTulach marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:

runs-on: ubuntu-20.04
strategy:
matrix:
java: [ '8' ]

steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: maven
- name: Build with Maven
run: mvn -B package --file tools/enso4igv/pom.xml
JaroslavTulach marked this conversation as resolved.
Show resolved Hide resolved
- name: Archive NBM file
uses: actions/upload-artifact@v3
with:
name: Enso IGV Plugin
path: tools/enso4igv/target/*.nbm
33 changes: 33 additions & 0 deletions tools/enso4igv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Enso Language Support for NetBeans & Ideal Graph Visualizer
JaroslavTulach marked this conversation as resolved.
Show resolved Hide resolved
JaroslavTulach marked this conversation as resolved.
Show resolved Hide resolved

[![Enso Language Support for IGV](https://github.com/enso-org/enso/actions/workflows/enso4igv.yml/badge.svg)](https://github.com/enso-org/enso/actions/workflows/enso4igv.yml)

[Enso language](http://enso.org) runtime engine is built on top of
[GraalVM](http://graalvm.org) and its _Truffle framework_. Enso,
as a good citizen of the GraalVM ecosystem, benefits from polyglot
capabilities of GraalVM as well as its rich tooling offering. One
of such tools is _IGV_ - the _Ideal Graph Visualizer_ - an excellent
tool to get insights into behavior of Graal compiler.

This document shows how to use _IGV_ with the _Enso language_.

## Installation
JaroslavTulach marked this conversation as resolved.
Show resolved Hide resolved

Visit [GraalVM.org](http://graalvm.org) download page and continue
towards _enterprise edition_ option. There is an _Ideal Graph Visualizer_
option. After clicking thru the confirmation dialogs you should get a ZIP -
I've just got `idealgraphvisualizer-22.1.0.zip` and then:

```bash
$ unzip idealgraphvisualizer-22.1.0.zip
$ ./idealgraphvisualizer/bin/idealgraphvisualizer --userdir /tmp/emptyuserdir
```

launches the _IGV_ application. One doesn't have to use the `--userdir` option,
but doing so ensures the newly running _IGV_ process is isolated from any settings
left around by previous usage of _IGV_.

Now download [Enso Language Support module](https://github.com/enso-org/enso/actions/workflows/enso4igv.yml)
ZIP file. Unzip it and get `enso*.nbm` file. This file can be installed into
_IGV_ (or any other [NetBeans](http://netbeans.apache.org) based application).
Go to _Tools_/_Plugins_/_Downloaded_ and install the NBM file.
111 changes: 111 additions & 0 deletions tools/enso4igv/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.enso.tools</groupId>
<artifactId>enso4igv</artifactId>
<packaging>nbm</packaging>
<name>Enso Language Support for NetBeans &amp; Ideal Graph Visualizer</name>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.netbeans.utilities</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<extensions>true</extensions>
<version>4.7</version>
<configuration>
<useOSGiDependencies>true</useOSGiDependencies>
<author>Enso.org</author>
<licenseName>Apache 2.0</licenseName>
<licenseFile>../../LICENSE</licenseFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-api-annotations-common</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-textmate-lexer</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-api-templates</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-filesystems</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-loaders</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-nodes</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-lookup</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-ui</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-windows</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-text</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-core-multiview</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-awt</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-dialogs</artifactId>
<version>${netbeans.version}</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netbeans.version>RELEASE113</netbeans.version>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package org.enso.tools.enso4igv;

import java.io.IOException;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.MIMEResolver;
import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.loaders.MultiFileLoader;
import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.TopComponent;

@Messages({
"LBL_Enso_LOADER=Files of Enso"
})
@MIMEResolver.ExtensionRegistration(
displayName = "#LBL_Enso_LOADER",
mimeType = "application/x-enso",
extension = {"enso"}
)
@GrammarRegistration(mimeType = "application/x-enso", grammar = "enso.tmLanguage.json")
@DataObject.Registration(
mimeType = "application/x-enso",
iconBase = "org/enso/tools/enso4igv/enso.png",
displayName = "#LBL_Enso_LOADER",
position = 300
)
@ActionReferences({
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "System", id = "org.openide.actions.OpenAction"),
position = 100,
separatorAfter = 200
),
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "Edit", id = "org.openide.actions.CutAction"),
position = 300
),
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"),
position = 400,
separatorAfter = 500
),
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"),
position = 600
),
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "System", id = "org.openide.actions.RenameAction"),
position = 700,
separatorAfter = 800
),
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"),
position = 900,
separatorAfter = 1000
),
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"),
position = 1100,
separatorAfter = 1200
),
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "System", id = "org.openide.actions.ToolsAction"),
position = 1300
),
@ActionReference(
path = "Loaders/application/x-enso/Actions",
id = @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"),
position = 1400
)
})
public class EnsoDataObject extends MultiDataObject {

public EnsoDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
super(pf, loader);
registerEditor("application/x-enso", true);
}

@Override
protected int associateLookup() {
return 1;
}

@MultiViewElement.Registration(
displayName = "#LBL_Enso_EDITOR",
iconBase = "org/enso/tools/enso4igv/enso.png",
mimeType = "application/x-enso",
persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
preferredID = "Enso",
position = 1000
)
@Messages("LBL_Enso_EDITOR=Source")
public static MultiViewEditorElement createEditor(Lookup lkp) {
return new MultiViewEditorElement(lkp);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@TemplateRegistration(folder = "Other", content = "EnsoTemplate.enso")
package org.enso.tools.enso4igv;

import org.netbeans.api.templates.TemplateRegistration;
4 changes: 4 additions & 0 deletions tools/enso4igv/src/main/nbm/manifest.mf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Manifest-Version: 1.0
OpenIDE-Module-Layer: org/enso/tools/enso4igv/layer.xml
OpenIDE-Module-Localizing-Bundle: org/enso/tools/enso4igv/Bundle.properties

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Localized module labels. Defaults taken from POM (<name>, <description>, <groupId>) if unset.
#OpenIDE-Module-Name=
#OpenIDE-Module-Short-Description=
#OpenIDE-Module-Long-Description=
#OpenIDE-Module-Display-Category=
#Thu May 12 10:04:24 CEST 2022
EnsoLanguage=Enso
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from Standard.Base import all

fac : Number -> Number
fac n =
facacc : Number -> Number -> Number
facacc n v = if n <= 1 then v else @Tail_Call facacc n-1 n*v

facacc n 1

main = IO.println (here.fac 6)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading