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 is been developed by Vinícius Julião
(@vrjuliao
), but the text-highlight is an
updated version of
Standard ML extension
by Darin Morrison (@freebroccolo
)
-
Short Execution:
- Open a sml file (or change your Language Mode for
sml
byCtrl+K M
) - Select a piece of SML code.
- Press
Ctrl+Enter
(Linux, Windows) orCmd+Enter
(Mac). - See the result on Output console.
- Open a sml file (or change your Language Mode for
-
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 foldermy_codes/workdir/
, and want to importmy_codes/workdir/foo.sml
, then type:use "foo.sml"
-
Run current File:
- Press
Ctrl+Shift+P
open Command Palette. - Type
sml
. - Select "SML Environment: Execute current file".
- Press
-
This extension needs of SML/NJ for short execution. After install that, add the
sml
bin directory in your$PATH
-
Windows
Download msi file here -
Linux
WARNING:smlnj
not work well in WSL. To use this extension on Windows, it is preferable install it directly in Windows.
Search forsmlnj
in your package manager. For instance, on Ubuntu terminal, type:foo@bar:~$ sudo apt install smlnj
-
MacOs
Via Brew:foo@bar:~$ brew install --cask smlnj
-
Or else
Follow the steps in SML/NJ download page for you operating system.
-
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.
-
use
statement:
Adding the capability for import files. -
Bug fixed: Now, all syntax errors will be reported instantly.
-
Syntax highlight fixes.
Initial release
The code for this extension is available on github at: https://github.com/vrjuliao/sml-vscode-extension
- 😄 Star this project on GitHub and Visual Studio Marketplace
- 😊 Leave a comment