SML Environment is an extension for
Visual Studio Code, allowing short executions
like EMACS sml-mode and
providing a text-highlight with some auto-complete features.
This project was originally developed by Vinícius Julião
(@vrjuliao), but the text-highlight is an
updated version of
Standard ML extension
by Darin Morrison (@freebroccolo). I incorporated some changes suggested by user shwestrick to fix some syntax highlighting issues.
Features
Short Execution:
Open a sml file (or change your Language Mode for sml by Ctrl+K M)
Select a piece of SML code.
Press Ctrl+Enter (Linux, Windows) or Cmd+Enter (Mac).
See the result on Output console.
Text Highlight:
use statement:
To import a file to the environment, specify the filepath considering the
workspace root directory as the starting point.
For instance, if you have opened the folder my_codes/workdir/, and want to
import my_codes/workdir/foo.sml, then type:
use "foo.sml"
Run current File: This option will restart the REPL environment
Press Ctrl+Shift+P (Linux, Windows) or Cmd+Shift+P (Mac) open Command Palette.
Type sml.
Select "SML Environment: Execute current file".
Requirements
SML/NJ
This extension needs of SML/NJ for short execution.
After install that, add the sml bin directory in your $PATH
Linux WARNING: smlnj not work well in WSL.
To use this extension on Windows, it is preferable install it directly in
Windows.
Search for smlnj in your package manager.
For instance, on Ubuntu terminal, type:
Instead of add the sml interpreter to the $PATH, you can specify a binary for
the sml interpreter.
Just setting the sml-environment-interpreter-path attribute on your
settings.json file.
Release Notes
0.0.2
use statement:
Adding the capability for import files.
Bug fixed: Now, all syntax errors will be reported instantly.