feat: full compile-and-run flow for .rizz files in VS Code#1
Draft
feat: full compile-and-run flow for .rizz files in VS Code#1
Conversation
- Add rizzLsp.runFile command with play-button in editor title bar - Add getRizzocCommand() helper: checks user setting, then local dune build (_build/default/src/bin/main.exe), then falls back to opam - Add getRuntimePath() helper: checks bundled runtime/ in extension, falls back to ../../src/runtime for dev mode - Add runCurrentFile(): saves file, chains rizzoc → gcc → ./output in an integrated terminal - Validate rizzLsp.compiler.cc to prevent shell injection - Add rizzLsp.compiler.command and rizzLsp.compiler.cc settings - Add scripts/copy-runtime.js to copy C headers into extension for VSIX - Update vscode:prepublish to run copy:runtime before bundling - Add vscode-rizz-lsp/out/ and vscode-rizz-lsp/runtime/ to .gitignore - Add rizz: run file task to .vscode/tasks.json - Fix npm run transpile/rizz in root package.json (-o output, ./output) - Document full flow in README Co-authored-by: PatrickMatthiesen <43612965+PatrickMatthiesen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Start implementation for bundling runtime in extension
feat: full compile-and-run flow for .rizz files in VS Code
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The extension only provided LSP features; running a
.rizzfile required manually chaining three shell commands. This adds a one-click end-to-end pipeline:.rizz→rizzoc→output.c→gcc→ binary → run.VS Code extension (
vscode-rizz-lsp)rizzLsp.runFilecommand — registered as a$(play)button ineditor/title/run, visible only for.rizzfiles. Saves the file, compiles, and runs in a dedicated integrated terminal.getRizzocCommand()— resolves the compiler in priority order:rizzLsp.compiler.commandsetting →_build/default/src/bin/main.exe(local dune build) →opam exec -- dune exec rizzoc --.getRuntimePath()— resolves C headers: bundledruntime/dir (VSIX install) →../../src/runtime(dev/repo mode).rizzLsp.compiler.ccis validated against an allowlist before use in the terminal command.rizzLsp.compiler.command(rizzoc path, auto-detected if empty) andrizzLsp.compiler.cc(C compiler, defaultgcc).Runtime bundling
scripts/copy-runtime.js— copiessrc/runtime/*.hintovscode-rizz-lsp/runtime/and removes stale headers from previous builds.vscode:prepublishnow runscopy:runtimefirst, so the VSIX is self-contained and works without the full repo structure.vscode-rizz-lsp/out/andvscode-rizz-lsp/runtime/added to.gitignore(generated artefacts).Other
npm run transpile/npm run rizzfixed to use-o output/./output(was relying ona.out)..vscode/tasks.jsongets arizz: run filetask.Original prompt
Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.