Skip to content

Code Editor

noodle includes a built-in code editor with Tree-sitter syntax highlighting and code folding for JSON and XML bodies and YAML request files.

JSON request bodies stay visible in the editor while browsing and editing. Press Return on the body field to edit it. The editor provides syntax highlighting with line numbers. Variable references ($var) are highlighted with color-coded states: resolved variables in your active theme’s primary color, and missing variables in your theme’s error color.

Invalid JSON shows an inline validation notice with a source line and column. When environment variables are substituted, errors still map back to the request source and identify an invalid variable value when applicable.

XML request bodies use the same editor with Tree-sitter XML highlighting, code folding, line numbers, and variable completion. Noodle does not reformat or schema-validate XML; it sends the substituted source unchanged.

Response bodies use the same editor in read-only mode. JSON responses support keyboard and gutter folding, while XML responses use XML highlighting. The viewer keeps original source line numbers beside folded rows and shows a themed scrollbar when the body overflows. Copying across a folded row returns the complete original source rather than the collapsed text.

Press Ctrl+Alt+E to edit the raw YAML of the selected request or folder.yml. The editor validates the appropriate file type before saving. It provides:

  • Syntax highlighting for YAML keys, values, strings, and comments
  • $variable highlighting (resolved and missing)
  • Code folding for nested blocks
  • Variable autocompletion

Typing an opening {, [, (, quote, or < inserts its closing pair and keeps the cursor between them. With a selection, the editor wraps the selected text. Typing a closing character over an existing one moves past it instead of inserting another.

Fold and unfold blocks of code to focus on what matters:

A folded JSON response in Noodle’s code editor

Key Action
Ctrl+G Toggle fold at the current line
Ctrl+Z Undo editor change
Ctrl+Shift+Z Redo editor change

Bulk fold and unfold actions are configurable in Settings under Shortcuts and are unbound by default. F5 opens the collection Runner.

When you edit inside a folded region, the fold auto-expands. Fold state is preserved across content changes.

Shift+Return inserts a newline in the code editor. Standard Return behavior (commit edit, send request, etc.) is preserved; use Shift+Return when you need multi-line input.

Type $ in the code editor to trigger the variable autocompletion popup. Navigate suggestions with up/down, accept with Tab or Return, dismiss with Escape. The popup lists available environment variables filtered by your typed prefix.

Environment variable suggestions in the code editor

The editor registers Tree-sitter parsers for JSON, YAML, and XML. It uses Tree-sitter highlights when available, then falls back to local JSON or YAML tokenizers when parsing fails or yields no highlights. This fallback keeps $variable references usable in JSON bodies before send-time substitution.

Syntax highlight colors are synced with your active theme. Changing themes with Ctrl+T instantly updates the editor’s colors.