MORE DETAIL PLEASE REFER GITHUB PAGE.
This extension adds support for Scheme(r6rs standard) to VS Code. With the help of scheme-langserver, we're proud to say that Magic Scheme is much better than many counterparts, which includes even Racket extensions.
NOTE: PLEASE ALWAYS USE LATEST VERSION SCHEME-LANGSERVER.
Zero-config for Linux x64: Magic Scheme can now automatically download and install
scheme-langserveron first activation. No manual setup required for most Linux users.For macOS, Windows, ARM Linux, and NixOS users, please see platform-specific notes below.
You can click this Patreon page or Aifadian to donate monthly, or just donate 10 USD just once time with the following paypal link.
0.0.10 Type inference enabled by default; custom enum values in config wizard (e.g. S7, goldfish).
0.0.9 Interactive config wizard for .vscode/magic-scheme.json; supports arbitrary properties; multi-root workspace aware.
0.0.8 Unified project-level config via .vscode/magic-scheme.json; auto-update for scheme-langserver; removed legacy VS Code settings for LSP parameters.
0.0.7 Compatible with scheme-langserver 2.1.0 (workspace/symbol, improved diagnostics, .sld support); comprehensive syntax highlighting improvements.
0.0.6 Be compatible with new Scheme-langserver[<=2.0.0] !
0.0.5 OK, at least I removed the annoying surrounding pair with "'" and also, 0.0.4 works now!
0.0.4 Try to notice programmers when LSP is initializing.
0.0.3 Replace grammer configuration.
0.0.2 Fix: comment.
0.0.1 Start!
Magic Scheme does
- Support Scheme LSP through scheme-langserver, which brings jump to definition, auto complete, type inference(early stage) and more. Especially, Magic Scheme can handle local identifiers and partial evaluation technique, which are not provided by many counterparts.
- Support Scheme project with through AKKU, which make you possible to load project depdendencies in REPL or directly run scheme script in terminal.
- Support highlighting of nearly all of the r6rs standard functions and Chez Scheme functions.
- Status bar indicator shows LSP initialization state.
serverPathandlogPathsupport relative paths and~expansion.- Auto-downloads
scheme-langserveron first activation for Linux x64. - The flag used when running scripts, e.g.
--script, can be customized in settings viamagicScheme.scheme.scriptFlag.
Magic Scheme now supports scheme-langserver. The current features are:
- Jump to definition
Especially, I must first recommend you with scheme-langserver's magic local identifier handling. Because in many other counterparts, you can never goto local binding's definition like the a in following:
(let ([a 1])
a
)- Auto complete
In further, thorough scheme-langserver, Magic Scheme can auto complete a with a-full-name-identifier in such cases:
(let ([a-full-name-identifier 1])
a
)Scheme-langserver truly responds with results, however, VS Code doesn't always display them.
I'm working on providing more details in this section: stay tuned!
You can directly run scheme script with project environment after typing Alt+Enter, or you may Ctrl+Shift+P and input command magic-scheme.runSchemeScript; The result shows scheme --script ${currentFile}:
You can directly load scheme project environment in REPL after typing Alt+Shift+Enter, or you may Ctrl+Shift+P and input command magic-scheme.runSchemeREPL; The result shows an REPL and you may import AKKU managed environemnts without further configurations.
The followings are mainly focus on x64-based linux operating system. As for other OSs, you may notice the following tips:
- If you're using nixos, you may directly search scheme-langserver here. it will directly install an executable binary file. And this file is softly linked in bash $PATH as
scheme-langserver. - If you're using MacOS, Windows or any other related environments, I suppose you're an advanced user and you may refer scheme-langserver's documentation in order to compile scheme-langserver manually.
- Chez Scheme has Windows and MacOS version, but I've never tested them. So, I mean for Windows, you'd better use WSL/WSL2; for MacOS, it seems not very different from Linux.
- AKKU is not native on Windows.
- For nixos, you may be able to directly install all your needs.
- Any other corner cases, you may refer softwares' documentations.
NixOS users should install scheme-langserver via nixpkgs (e.g., akkuPackages.scheme-langserver) rather than downloading the generic Linux release binary from GitHub. The generic glibc-linked binary crashes on NixOS with a SIGSEGV. The extension will automatically fall back to scheme-langserver in $PATH or a local ./run file.
I'm so sorry Magic Scheme has some conflicts with Chez-Scheme-VsCode plugin. So, maybe you need to disable it.
Magic Scheme will automatically download and install scheme-langserver on first activation if:
- You are on Linux x64
scheme-langserveris not already on your$PATHmagicScheme.scheme-langserver.autoDownloadis enabled (default:true)
The binary is downloaded to VS Code's global storage (~/.config/Code/User/globalStorage/...) and is reused across workspaces.
Note on Settings Sync: The auto-discovered path is written to your workspace settings, not global settings. This prevents machine-specific paths from being synced to other computers via VS Code Settings Sync.
If automatic installation is not available for your platform, you can manually download the latest executable from the scheme-langserver releases page and set magicScheme.scheme-langserver.serverPath to its path.
| Platform | Support | Notes |
|---|---|---|
| Linux x64 | ✅ Auto-download | Automatically downloaded on first use. |
| NixOS | ✅ Auto-download | Generic Linux binary; if it fails, install via nix-shell -p akkuPackages.scheme-langserver. |
| macOS | ❌ Manual only | No prebuilt binary. Install via Nix or build from source. |
| Windows | ❌ Manual only | No prebuilt binary. Use WSL2 or build from source. |
| Linux ARM | ❌ Manual only | No prebuilt binary. Build from source. |
Magic Scheme supports r6rs standard scheme. But apparently I can't fully tests all implementations. As myself, I recommend with Chez Scheme, and you may install it as following:
wget https://github.com/cisco/ChezScheme/releases/download/v10.0.0/csv10.0.0.tar.gz
tar -xf csv10.0.0.tar.gz && cd csv10.0.0
# Install dependencies: `libncurses5-dev`
./configure --threads --kernelobj --disable-x11
make && sudo make installAKKU is a package manager for Scheme. It grabs hold of code and shakes it vigorously until it behaves properly. Magic Scheme facilitates AKKU to manage scheme projects. To install AKKU, you may follow:
wget https://gitlab.com/-/project/6808260/uploads/094ce726ce3c6cf8c14560f1e31aaea0/akku-1.1.0.amd64-linux.tar.xz
tar -xf akku-1.1.0.amd64-linux.tar.xz && cd akku-1.1.0.amd64-linux
bash installIf Magic Scheme automatically downloaded scheme-langserver for you, it will periodically check for newer releases and offer to update.
| Setting | Behavior |
|---|---|
notify (default) |
Status bar shows scheme-langserver X.Y.Z available; click it or use the notification to update |
auto |
Downloads and installs updates silently in the background, then restarts the language server |
off |
Never checks for updates |
Only applies to auto-downloaded binaries. If you installed
scheme-langservermanually (via PATH, Nix, or a local./runfile), Magic Scheme will never touch it.
The check runs at most once every 24 hours and uses GitHub's release redirect (not the API), so it is not affected by GitHub API rate limits.
Magic Scheme uses .vscode/magic-scheme.json as the sole configuration source for scheme-langserver runtime parameters.
The easiest way to configure your project is through the built-in wizard:
- Open your Scheme project in VS Code.
- Press Ctrl+Shift+P (or Cmd+Shift+P) and run
Configure Magic Scheme Project. - A QuickPick panel shows the current settings:
topEnvironment: R6RS (default) multiThread: enable (default) typeInference: enable (default) logPath: ~/scheme-langserver.log (default) + Add new property... ✓ Done - Click any field to change it:
topEnvironment— choose fromR6RS,R7RS, or select Custom value... to enter any other environment (e.g.S7,goldfish).multiThread/typeInference— chooseenableordisable.logPath— type any path (supports~for home directory).
- Click + Add new property... to add arbitrary scheme-langserver parameters not listed above.
- Click ✓ Done to save.
The wizard automatically creates .vscode/magic-scheme.json (and .vscode/ if needed) and restarts the language server.
You can also edit .vscode/magic-scheme.json by hand. On first activation, Magic Scheme automatically creates this file with default values:
{
"topEnvironment": "R6RS",
"multiThread": "enable",
"typeInference": "enable",
"logPath": "~/scheme-langserver.log"
}All fields are optional — omitted fields fall back to the defaults above.
| Field | Description | Default |
|---|---|---|
topEnvironment |
Scheme top environment: R6RS, R7RS, or any value your scheme-langserver supports (e.g. S7, goldfish) |
R6RS |
multiThread |
Enable/disable multi-threading: enable or disable |
enable |
typeInference |
Enable/disable type inference: enable or disable |
enable |
logPath |
Path to scheme-langserver log file (supports ~ expansion) |
~/scheme-langserver.log |
When you save changes to this file, Magic Scheme automatically restarts the language server to apply them.
- For Nixos, after install yo and generator-code, should
export PATH=$PATH:./node_modules/.bin/The project has a 3-layer test suite:
| Suite | File | Description |
|---|---|---|
| Unit | src/test/utils.test.ts, src/test/download.test.ts |
Tests pure logic: getOrDefault, quoteWindowsPath, config defaults, download progress, and platform detection. |
| Mock LSP | src/test/lifecycle.test.ts |
Uses a mock Node.js LSP server (src/test/mock-server/server.ts) to test extension activation, completions, and hover without a real scheme-langserver. |
| E2E | src/test/e2e.test.ts |
Tests against a real scheme-langserver binary. Auto-detects the binary from .vscode-test/scheme-langserver, ./run, or $PATH. |
Run all tests:
npm run testRun a specific label:
npx @vscode/test-cli --label unit
npx @vscode/test-cli --label mock-lifecycle
npx @vscode/test-cli --label e2e$/setTracewarning: VS Code's LSP client sends$/setTrace(a standard LSP 3.16+ notification to adjust server trace verbosity).scheme-langserverdoes not implement this and returnsinvalid request. This is harmless and does not affect completions, hover, or any other LSP feature.- NixOS
scheme-langserverbinary: The generic Linux glibc-linked release binary may crash on NixOS. If this happens, install vianixpkgs(nix-shell -p akkuPackages.scheme-langserver) instead. - Test
sleep(2000):src/test/helper.tsuses a fixed 2-second delay after opening a document to wait for LSP initialization. This is stable but could be improved by listening forState.Running. - Mock server edge cases: The mock LSP server does not handle
stdinend/errorevents. This is acceptable for current test scenarios.




