How to work with this extension:
- After cloning run
npm i. This repository contains a submodule, keep that in mind when cloning.
- Change to the visualizer directory, run
npm ci and
npm run build afterward.
- Press F5 select VS Extension Developement (preview).
- In the new VSC Window open the VSC
Command Palette (cntrl + shift + p) and type Visualizer to view all commands.
- Make sure to set the right paths in the Extension Settings.
This is an extension for the AlDeSCo Spoon Prototype. You will need to have the Prototype within your Project to access all features of this extension.
All features can be accessed via the
Command Palette (Ctrl + Shift + P). Make sure to check the Settings to use all commands properly.
When running commands which generate output an
aldesco-output Folder will be created at the top level of the currently opened Project Directory.
1. Open Visualizer: Opens a new or shows the current Visualizer Webview without a vis file.
2. Open Most Recent: Opens the most recently created or changed vis file inside a Visualizer Webview from the
3. Duplicate Visualizer: Duplicates the last used Visualizer Webview and syncs actions from the other Visualizer and vice versa. This command will only appear once a Visualizer Webview has been created.
4. Open File in Visualizer: A vis file can be either right-clicked and opened inside the Visualizer Webview or with a vis file opened and focused in the editor, the command can be run in the Command Palette.
5. Visualize Spoon AST: Open a file to be visualized and either run the command in the
Command Palette to visualize the entire file or select an element and right-click it, be sure to only select the element you want to visualize and not any additional whitespaces. An element can be a method, an entire class, an assignment or just a data type.
6. Set a Chain and Match Folder: A Chain can be set by either right-clicking a CLASS File in the VS Code Explorer or by running the command in the
Command Palette and choosing a CLASS File in the File Explorer. Additionally, a JAVA File can be right clicked automatically compiled and set as Chain or set as Chain without comiling. The Chain can also be set by directly by providing the absolute path of a Chain inside the aldesco-extension Settings. To view the current Chain, run the Show current Chain command in the
Command Palette. Lastly, right-click or select a folder with the Match Folder with Chain command and match the folder with the currently selected Chain.
7. Start Match Loop From Test (Experimental): When working with aldesco, you might have already implemented a test for a pattern. Execute this command on an existing test, where a Pattern Chain is provided (variable must be called CHAIN, i.e Palindrome.CHAIN). The command will continuously execute the test, when changing something in the Pattern file. Feedback will be displayed in the Activity Bar. This might not work too well, it's still experimental.
8. Start Match Loop From Pattern: Starts a Match Loop from a Pattern and will match with the
MatchInputs Folder within the Output Folder. Input Resources can be added to the
MatchInputs Folder with the
Add Match Loop Input command (right click a java file). For generating the results in the Activity Bar, there will be a
match-loop-results.json created within the aldesco-output folder.
Full Command List
The most important commands have been described above. Here is a list of all the commands available.
- AlDeSCo: Open Visualizer
- AlDeSCo: Open Log File in Visualizer
- AlDeSCo: Open Most Recent Log File in Visualizer
- AlDeSCo: Visualize Spoon AST
- AlDeSCo: Set as Chain
- AlDeSCo: Compile and set as Chain
- AlDeSCo: Show current Chain
- AlDeSCo: Match Folder with Chain
- AlDeSCo: Duplicate Visualizer
- AlDeSCo: Start Match Loop From Test (Experimental)
- AlDeSCo: Start Match Loop From Pattern
- AlDeSCo: Add Match Loop Input
- AlDeSCo: Stop Match Loop
- AlDeSCo: Open Match Tree
- AlDeSCo: Clear Match Input Folder
When executing some commands an Output Folder will be created within your Project. The Output Folder is Structured as followed:
.visualizer-logs: log files, which can be opened by the included Visualizer.
MatchInputs: A Folder which includes all files added with the
Add Match Loop Input command. And when the
Start Match Loop From Pattern command is run. The files within this folder will be matched.
result.json: The result json file generated by the match folder commands. From these files a Match Tree can be generated by right clicking and selecting the
Open Match Tree command.
Most of the time setting the paths manually is not necessary and can be done through commands or are set automatically by the extension.
A reload is required after changing settings!
aldesco-extension.prototype.sourceSetBuildLocation: Sets the location of the Source Set within the Build Folder (absolute Path). For example, for gradle the location path should look like this 'D:\User\MyGradleProject\build\classes\java\main' or for maven 'D:\User\MyMavenProject\target\classes'. You only have to set this if you don't use the standard maven or gradle build or the extension can not find your build path automatically (Error: The build folder doesn't exist or could not be found!).
aldesco-extension.prototype.chainLocation: Sets the location of the Chain used for matching (absolute path). This does not have to be set manually and can be accessed via commands.
Sometimes the Visualizer does not load properly.
Fix: Click Hide/Show view or reload the same file.
Initial release of this extension