MCPcopy Index your code
hub / github.com/cmyr/RustPlayground

github.com/cmyr/RustPlayground @v0.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.1 ↗ · + Follow
189 symbols 396 edges 25 files 22 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rust Playground for MacOS

status: experimental / pre-release / guaranteed buggy

The Rust Playground for MacOS is a standalone native mac application that allows quickly editing and testing rust snippets.

Rust Playground Screenshot

installation

You can download a disk image of a recent build on the releases page.

requirements

The playground requires rustup, and allows code to be run with any installed toolchain. note: Rustup must currently be in the default directory, $HOME/.rustup.

install from source (requires Xcode)

  • clone this repository
  • cd in to the RustPlayground directory
  • run xcodebuild from the command line
  • copy build/Release/Rust Playground.app to your Applications directory

About

This project is based on a fork of the xi-editor core. It is intended largely as an experimental offshoot of xi; a narrowly scoped editor frontend that can be used to experiment with various design decisions.

Document state is handled in rust; the swift frontend interfaces with the rust code via FFI.

Features

  • syntax highlighting
  • font selection
  • auto-indent
  • comment toggling
  • line breaking
  • extern crates (with a hacky custom syntax for declaring imports)
  • use any installed toolchains

Known issues

  • Performance is not great; it is expected that documents are only ever a few hundred lines.
  • Drawing is hacky. We may draw ghost selections.

TODO

  • ~export to gist / web playground~
  • export to new cargo project?
  • rustfmt / clippy
  • multiple documents, saving snippets?
  • ASM / IR output

One day, maybe

Thanks

to the xi-editor contributors, to Jake Goulding for the excellent play.rust-lang.org implementation, and to the Rust community at large.

Extension points exported contracts — how you extend this code

Handler (Interface)
(no doc) [2 implementers]
xi-modal-input/src/input_handler.rs

Core symbols most depended-on inside this repo

offset_of_line
called by 14
xi-modal-input/src/view.rs
do_movement
called by 12
xi-modal-input/src/mac.rs
do_core_event
called by 12
xi-modal-input/src/input_handler.rs
build
called by 12
xi-modal-input/src/update.rs
get_line_str
called by 9
xi-modal-input/src/view.rs
count_lines
called by 8
xi-modal-input/src/view.rs
add_undo_group
called by 7
xi-modal-input/src/undo.rs
set_mode
called by 6
xi-modal-input/src/vim.rs

Shape

Method 93
Function 51
Class 37
Enum 7
Interface 1

Languages

Rust97%
C++3%

Modules by API surface

xi-modal-input/src/view.rs37 symbols
xi-modal-input/src/lines.rs18 symbols
xi-modal-input/src/vim.rs15 symbols
playground-utils/src/compile.rs14 symbols
xi-modal-input/src/undo.rs12 symbols
xi-modal-input/src/input_handler.rs12 symbols
xi-ffi/src/lib.rs10 symbols
xi-modal-input/src/update.rs9 symbols
playground-utils/src/rustup.rs9 symbols
xi-modal-input/src/highlighting.rs8 symbols
xi-modal-input/src/mac.rs7 symbols
xi-modal-input/src/core.rs7 symbols

For agents

$ claude mcp add RustPlayground \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact