slim-vscode-tools
is a Visual Studio Code extension designed to provide comprehensive support for the SLiM simulation package. This extension includes features such as syntax highlighting, snippets, IntelliSense, and commands to enhance the development experience for SLiM scripts.
✨ Features
Syntax Highlighting
Provides syntax highlighting for SLiM scripts using a TextMate grammar. This includes:
- Line and block comments
- Double and single-quoted strings with escape sequences
- Control keywords (
if
, else
, for
, while
, function
, return
, break
, continue
)
- SLiM-specific keywords (
initialize
, sim
, initializeSLiMOptions
, etc.)
- Numeric constants
- Language variables (
this
, self
)
- Function definitions and parameters

Will show a tooltip with the function signature and complete documentation for the function for the SLiM help system.

Auto-completion
Provides auto-completion for SLiM keywords, functions, and variables.
Will show a tooltip with the function signature and description.

Syntax Checking
Provides real-time syntax validation for SLiM scripts:
- Brace matching and block structure validation
- Semicolon checking for statements
- SLiM-specific block structure validation (initialize, early, late, fitness)
- Generation-prefixed block validation (e.g., "1000 late()")
- Function parameter validation
- Smart error reporting with inline diagnostics
- Support for multi-line code blocks
Snippets
Includes a set of useful snippets to speed up the development process. For example:
initWF
: Initializes a basic Wright-Fisher model.
initSel
: Initializes a model with selection.
IntelliSense
Provides basic IntelliSense features such as auto-completion for keywords, functions, and variables.
Commands
Adds a custom view in the activity bar with a command to run SLiM scripts:
- Run SLiM: Executes the currently open SLiM script using the SLiM interpreter.
Documentation Tree View
Offers a tree view to the sidebar that shows the full hierarchy of classes, methods, properties, etc.,
as presented in the native SLiMgui
help system.
The documentation pages are displayed in a heirarchical, tree view format, where opening
subsequent tabs shows the documentation for the selected item.
Clicking on indivual items in the tree view such as methods or properties opens the corresponding
section of the slim documentation in a webview.

Status Bar Integration
Adds a status bar button to quickly run the SLiM script in the active editor.
Also adds a command to run the SLiM script in Activity Bar.

Requirements
- Visual Studio Code version 1.98.0 or higher
- SLiM interpreter installed and accessible in your system's PATH or configured in the extension settings
Installation
Currently this extension is not published to the marketplace, so you will need to install it manually.
There are a few ways to do this:
You can build from source:
- Clone the repository
- Run
npm install
to install the dependencies
- Run
npm run package
to package the extension
- Install the resulting package with
code --install-extension slim-vscode-tools-<current-version-number>-.vsix
(this assumes you've installed the vscode
command line tool)
You can use the prepackaged package from the releases:
- get the latest version from the GitHub repository
- Install the
.vsix
file manually with code --install-extension slim-vscode-tools-<current-version-number>-.vsix
Optionally you can install the .vsix
file from within vscode
by:
- Open
vscode
.
- Go to Extensions View by pressing Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac).
- Click on the More Actions (⋮) menu at the top right of the Extensions panel.
- Select "Install from VSIX...".
- Locate and select the .vsix file from your system.
- Click Install and wait for it to complete.
Extension Settings
This extension contributes the following settings:
slimTools.slimInterpreterPath
: Path to the SLiM interpreter (e.g., /usr/local/bin/slim
or C:\\Users\\YourName\\slim.exe
).
Diagnostic Features
The extension provides real-time diagnostic feedback for:
- Syntax errors (mismatched braces, missing semicolons)
- SLiM-specific block structure issues
- Function parameter validation
- Code style recommendations
Diagnostics are displayed as:
- 🔴 Errors: Critical issues that need to be fixed
- 🟡 Warnings: Potential issues or style recommendations
Known Issues
Release Notes
0.0.1-beta
Added new features:
- Real-time syntax checking and validation
- SLiM-specific block structure validation
- Enhanced error reporting with inline diagnostics
- Support for generation-prefixed blocks
0.0.1
Initial release of slim-tools
with the following features:
- Syntax highlighting for SLiM scripts
- Snippets for common SLiM patterns
- Basic IntelliSense support
- Custom view and command to run SLiM scripts
- Status bar integration
0.0.2
- Full, auto-parsed SLiM documentation now appears in an object-oriented aware way
- Hover / autocomplete for Classes, their properties and methods, etc.
0.0.3
- Documentation Tree view now shows the full hierarchy of classes, methods, properties, etc.
- Clicking on document item in the tree view opens the corresponding section of the slim documentation in a webview
- Improvements in semicolon handling to be more C++ like
0.0.4
- this is only a number bump to include a better icon on the marketplace
Development notes
- First install the dependencies with
npm install
- Build the project with
npm run compile
- If you want to clean up and remove the compiled files, run
npm run clean
- To build the
.vsix
file, run npm run package
- To run the extension in development mode, press
F5
to open a new VS Code window with the extension loaded.
Enjoy!