A code editor for the browser, written in Rust
Ctrl+Space completes, F12 goes to a definition, F2 renames a local, Ctrl+Shift+O lists the symbols.
Ctrl+Space completes, F12 goes to a definition, F2 renames a local, Ctrl+Shift+O lists the symbols.
Against Monaco 0.57 on the same files, Rustaco loads as fast and its cost per keystroke does not grow with the file. In that comparison it still spent about one and a half times Monaco's main-thread time per keystroke, most of it in drawing the frame.
Multiple cursors and column selection, folding from the syntax tree, word wrap, a minimap, sticky scroll, find and replace with regular expressions, snippets with tab stops, IME input and a screen reader mirror. Keymaps use VS Code's command ids; a JetBrains preset is included.
Every bundled grammar also runs as a language server: completion from the grammar's keywords and the file's names, go to definition, references and rename within the file. Real language servers connect over a WebSocket through the LSP client, which is written in Rust and runs in the editor's WebAssembly module.
Side by side or inline, both sides editable, with char-level changes and moved blocks.
The text model, the layout, the highlighting and the LSP client are separate crates on crates.io and build without a browser. A native frontend on winit draws the same frames; it is younger than the web one and stays at version 0.x.
npm install rustaco
import { createEditor } from 'rustaco';
const editor = await createEditor(document.getElementById('editor'), {
value: 'fn main() {}\n',
language: 'rust',
});
cargo add rustaco-core rustaco-view rustaco-syntax rustaco-lsp
Only monospace fonts are supported: text sits on a grid of equal cells. Right-to-left text and touch input do not work yet. The guides for embedding in a page or a native application are in the repository, under https://github.com/object-pl/rustaco/tree/main/docs.
GitHub Sponsors takes monthly or one-time payments.