Racket
Sublime Text plugin for the Racket programming Language
Details
Installs
- Total 11K
- Win 4K
- Mac 4K
- Linux 3K
| Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| Linux | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Racket
A Sublime Text 4 plugin for the Racket programming language.
Supported extensions: .rkt, .rktl, .rktd (Racket syntax) and .scrbl
(Scribble syntax: prose text with @-expressions, sharing every rule with
the Racket syntax). .rkt files understand @-expressions anywhere in the
file, matching #lang at-exp racket semantics.
Current features include:
- syntax definition and highlighting: every Racket form and literal is scoped
- build system: run, test, compile and format from command palette
- symbol indexing:
Goto Symbollists defined functions and structs - comment settings:
Toggle Commentuses;and#| |# - bracket handling: auto-indent after an open bracket, outdent on close
- REPL:
Racket: Open REPL,Racket: Run File in REPLandRacket: Send Selection to REPLfrom command palette; send selection sends the current line when nothing is selected and starts a REPL if none is running (needs the Terminus package; setracket_executablein the Racket syntax settings ifracketis not onPATH)
No completion or language-server integration is available. For those, use the LSP package with racket-langserver.

Installation
Via Package Control: Package Control: Install Package, then choose
Racket.
Features
Syntax definition
The syntax is a .sublime-syntax written from scratch for the Sublime
Text 4 engine.
- Complete generated identifier lists. All 413 special
forms, 2135 procedures and 125 values exported by the
racketmodule (v9.3) are recognised; the lists are produced by a script that queries Racket itself, so they can be regenerated for any future Racket version. - Works with Sublime's editing features.
Goto Symbol(Ctrl/Cmd+R) lists everydefined function andstructin the file.Toggle Comment(Ctrl/Cmd+/) inserts;and block comment inserts#| |#. Pressing Enter after an open bracket indents; typing a close bracket outdents. Double-clickingstring->listselects the whole identifier, notstringalone, and?or!at the end of a name is part of the word. - Scopes depend on position, not just on the word. The operator of a
form is scoped as a special form (
define,let), a builtin procedure (map), an operator (+), or a user function call (my-fn), while the same identifier used as an argument is scoped as a value. Binding sites are distinguished too: the name in(define (add x y) …)is a definition andx,yare parameters;xin(let ([x 1]) …)is a binding;point,x,yin(struct point (x y))are a type name and fields. - Every kind of literal Racket can read is recognised. Comments in all
three forms:
; line,#| block |#(which may nest), and#;followed by one expression, which comments out exactly that expression, however many lines it spans. Strings of every flavour:"plain",#"bytes",#rx"regexp",#px"regexp", and#<<EOFhere-strings. Characters like#\a,#\space,#\x41. Keywords like#:name. Numbers with prefixes such as#x1F,#b101,#e1.5, fractions1/3, and+inf.0. Quote marks',`,,,,@,#',#,. Vector and hash literals#(1 2),#hash((a . 1)).
Known limitations can be found in the dev docs.
Build system
A build system is included (Tools > Build With...):
- Run (
racket): runs the current file and shows its output - Test and Test Directory (
raco test): runstestsubmodules andrackunittests in the current file, or in every file under its directory - Compile (
raco make): compiles to bytecode without running, so it reports syntax and unbound-identifier errors quickly - Format (
raco fmt -i, needsraco pkg install fmt): reformats the current file in place - Expand (
raco expand): prints the fully macro-expanded program, useful for seeing what a macro produces - Check Requires (
raco check-requires): reportsrequired modules that are unused or could be narrowed
Error locations in the output panel are clickable.
racket and raco must be on the PATH Sublime sees; on macOS that is the
login shell's PATH when launched from the Dock.