Guide: Code Editor
August 28, 2026 by Leszek
This guide describes the current code editor in sCADman.xyz in detail — what each part does and how to use it effectively.
Editor-related settings live in Settings → Code editor and are remembered in your browser.
Layout
The toolbar sits directly under the code area and is divided into two groups.
Left side – display & repair
| Control |
What it does |
How to use |
| Line wrap |
Long lines wrap instead of requiring horizontal scrolling. |
Click the wrap icon, or enable Line wrap in Settings → Code editor. |
| Whitespace |
Makes spaces and tabs visible. |
Click the pilcrow icon, or enable Show whitespace in Settings. |
| Repair code (wand) |
Applies automatic fixes suggested by the live linter (for example trailing or double commas). Issues that cannot be fixed automatically remain listed. |
Click when the wand is active. The tooltip shows issue counts. |
Right side – file & compile
| Control |
What it does |
How to use |
| Save |
Writes the current buffer to Storage. The first save asks for a project and filename. |
Click Save, or use the chevron for Save as. A highlight indicates unsaved changes. |
| Clear geometry cache |
Clears OpenSCAD’s internal geometry cache (sometimes useful after unexpected compile results). |
Click the cache icon. |
| Preview |
Fast compile with a reduced $fn for a quick visual check. |
Play icon, main toolbar Preview, or keyboard shortcut P. |
| Render |
Full-quality compile that respects your $fn / $fa / $fs values. |
Box icon or main toolbar Render. |
Language support
The editor treats the buffer as OpenSCAD. Keywords, primitives, transformations, comments and strings are syntax-highlighted. Matching brackets {} [] () are colour-paired and auto-close.
The colour theme follows the application setting (dark or light). The font is a fixed-width stack that prefers JetBrains Mono, Fira Code or Cascadia Code when available.
Autocomplete
As you type, the editor offers context-aware suggestions:
- Built-in modules and functions (
cube, translate, sin, …) insert name() and place the cursor between the parentheses.
- Modules and functions you defined in the current file.
- Variables assigned in the current file.
- After
translate(, rotate(, scale(, mirror( or resize(: ready-made vector snippets [0, 0, 0] and [x, y, z].
- After
$fn =, $fa = or $fs =: common values such as 32, 64, 128.
- Inside
color("…"): CSS and OpenSCAD colour names (with a colour preview).
- After a function name and
( or a comma: known parameter names in the form param =.
Suggestions you accept more frequently rise higher in the list during the same session.
How to use
Start typing a name or one of the trigger characters (, [, ", =, ,, $. Navigate with the arrow keys and accept with Enter or Tab.
You can disable autocomplete entirely under Settings → Code editor → Autocomplete.
Parameter hints
When you type name(, a popup appears showing the official signature and which argument you are currently editing. This works for built-in OpenSCAD functions, including overloads (for example sphere(r) versus sphere(d)).
The hint updates as you move between arguments.
Disable it in Settings → Code editor → Parameter hints if you prefer a cleaner view.
Hover documentation
Resting the mouse pointer on a name shows a short reference card:
- For built-ins: signature, brief description, parameter notes and a short example when available.
- For your own modules and functions: the definition header taken from the current file (
module name(a, b=…)).
Hover and wait a moment for the card to appear.
Turn the feature off under Settings → Code editor → Hover docs.
Go to definition
You can jump straight to the definition of a user-defined module, function or variable inside the current file.
- Press
F12 while the cursor is on a name, or
Ctrl+Click (Windows/Linux) / Cmd+Click (macOS).
Built-in names such as cube or sin do not jump. Jumping into files loaded with use / include is not yet supported (the editor currently works with a single buffer).
Disable the feature in Settings → Code editor → Go to definition.
Live lint
Approximately 0.6 seconds after you stop typing, the editor analyses the code without compiling and underlines problems. Two layers of checks run:
- Syntax – unmatched brackets, double commas, trailing commas, etc. Some of these can be fixed automatically with the wand button.
- Static analysis (Tree-sitter) – performed before OpenSCAD itself runs:
- Undefined variable
- Unused variable (names beginning with
_ are ignored)
- Wrong number of arguments or unknown named argument
- Deprecated calls (
assign(), child(), dxf_linear_extrude(), dxf_rotate_extrude(), import_dxf(), import_stl(), …)
Syntax problems also appear once in the compile console. Static warnings remain visible only as editor underlines and gutter marks.
Open the Problems panel or simply hover an underline to see details. Use the wand to apply automatic repairs.
The whole idle-lint system can be switched off under Settings → Code editor → Live lint.
Compile markers
After a Preview or Render, any OpenSCAD message that mentions a specific line number is turned into an editor marker (error or warning). These markers sit alongside the live-lint marks.
Click a marker or scan the gutter to navigate to the reported location. Markers are refreshed on every new compile.
You can disable them in Settings → Code editor → Compile markers.
Customizer and multi-file compile
Assignments that carry Customizer annotations (for example size = 20; // [5:50]) automatically appear in the Customizer panel. Values you set there override the source at compile time; they do not have to be written back into the editor buffer.
When the current file is saved inside a Storage project, include and use statements that refer to other .scad files in the same project are resolved and made available to the WebAssembly compiler.
Editor settings summary
All options below are simple on/off switches. Display-related ones also have corresponding icons on the editor toolbar.
| Setting |
Default |
Effect |
| Line wrap |
Off |
Wrap long lines instead of horizontal scrolling. |
| Show whitespace |
Off |
Render spaces and tabs as visible marks. |
| Autocomplete |
On |
Context-aware code completions. |
| Hover docs |
On |
Signature and short documentation on mouse hover. |
| Go to definition |
On |
F12 and Ctrl/Cmd+Click navigation. |
| Parameter hints |
On |
Signature popup while typing inside a function call. |
| Live lint |
On |
Idle syntax and static-analysis warnings. |
| Compile markers |
On |
OpenSCAD line-based errors and warnings after compile. |
The code editor is designed to feel familiar to anyone who has used a modern programming editor while staying tightly focused on OpenSCAD. All of the features of code editor; autocomplete, hints, live lint, go-to-definition works entirely on the client side and updates as you type, giving immediate feedback before you even press Preview or Render.