SuperMongo Language Support
VS Code extension for SuperMongo (.sm) files.
What Is SuperMongo?
SuperMongo (SM) is an interactive plotting package for drawing graphs, widely used in scientific workflows.
This extension targets .sm scripts and macros to improve editing productivity in VS Code.
Official references:
Notes:
- SuperMongo was written by Robert Lupton and Patricia Monger.
- Princeton also hosts the SM reference manual and tutorial linked from the main SM page.
Features
- Syntax highlighting for core SuperMongo keywords and commands
- Go to Definition for user macros across indexed
.sm files (Ctrl/Cmd+Click)
- Hover info for user macros:
- signature (
name nargs)
- header comment
- definition location (
file:line)
- short body preview
- Highlighting for:
- comments (
# ...)
- strings (
"...", '...')
- variable references (
$1, $$1, $name, $?name, $!name, !name)
- control flow and plotting commands
- math/system functions from the SM parser token list
- Basic language configuration (line comments and bracket auto-close)
Macro Indexing
By default, the extension indexes all .sm files in the workspace.
You can configure indexing with VS Code settings:
{
"supermongo.indexing.enabled": true,
"supermongo.indexing.include": ["**/*.sm"],
"supermongo.indexing.exclude": [
"**/node_modules/**",
"**/.git/**",
"**/build/**",
"**/dist/**",
"**/out/**"
],
"supermongo.indexing.maxFiles": 5000
}
Optional project file in workspace root: .supermongo-index.json
{
"include": ["rfmacro/**/*.sm", "DOCS/**/*.sm"],
"exclude": ["**/legacy/**"],
"maxFiles": 2000
}
Precedence:
- VS Code settings (
supermongo.indexing.*)
.supermongo-index.json
- Extension defaults
Local test
- Open this folder in VS Code:
vscode-supermongo-language
- Press
F5 to launch an Extension Development Host.
- Open any
.sm file in the new window.
Build VSIX
npm install
npm run package
Install from VSIX in VS Code via Command Palette:
Extensions: Install from VSIX...