Skip to content

v1.7.0

Choose a tag to compare

@github-actions github-actions released this 08 Sep 13:38
· 8 commits to main since this release

v1.7.0

This release adds editor diagnostics so you can find mistakes before running a request. It also makes variable errors easier to locate, fixes editing and display of Unicode text, and changes the default shortcuts for splitting responses.

Editor diagnostics

The editor now underlines errors and warnings in .http, .rest, and unnamed request buffers. The status bar shows ERR <n> and WARN <n> counts beside the current status message.

Diagnostics cover unknown directives, mistyped option names, missing values, repeated or conflicting options, and placeholders with missing closing braces.

For example, both mistakes below are marked:

# @nmae health
GET https://example.com/{{id}

Diagnostics refresh when you leave insert mode, without saving the file or changing the selected request. They do not refresh while you type or pause in insert mode. Undo, redo, and other edits in normal mode refresh them after a short delay.

In editor normal mode:

  • Press Shift+k to see errors and warnings on the current line. Issues under the cursor appear first, with errors before warnings. On a line without diagnostics, it opens contextual help as before.
  • In the popup, Enter opens related documentation when available. PgUp / PgDown scroll long messages. Esc or moving the cursor closes it.
  • Press ] d to move to the next problem or [ d to move to the previous one. Navigation wraps at the beginning and end of the file. You can also use :diagnostics next and :diagnostics prev.
  • Use :diagnostics or g . to see the full list.

For ] d, [ d, and g ., press the keys in sequence. The new diagnostic shortcuts can be changed in your bindings file and give way to existing custom bindings that use those keys.

When there is no text to underline, the line number is marked instead. If the editor is too small for the popup, the details open in the full list.

Diagnostics check the request file's syntax. Variables and expressions are still checked when you run the request.

Diagnostic settings

Diagnostics are enabled by default. Use :diagnostics off or :diagnostics on to change this for the current session.

To disable them at startup, add this to settings.toml in your Resterm config directory:

[editor]
diagnostics = false

For settings.json, use:

{"editor":{"diagnostics":false}}

Themes can set the warning and error styles with [styles.editor_diagnostic_warning] and [styles.editor_diagnostic_error]. The defaults use different colors and ordinary terminal underlines.

Variable and expression errors

  • Undefined variables in URLs, headers, and request bodies now point to the placeholder with its file, line, and column. This includes bodies read from a file when template expansion is enabled.
  • A failing {{= ... }} expression keeps its script error details and points to the expression's actual location.
  • Body error locations account for comment lines in the request file.
  • Error excerpts mask known secrets. Errors in external body files show the location without printing the file contents.

A placeholder such as {{token} now produces a warning about the missing }}. It is still sent as literal text. A complete placeholder with an undefined variable still blocks the request.

Unicode text

  • Cursor movement, word motions, search, and mouse selection now keep accented letters and emoji.
  • Deleting or changing these characters removes the whole character, without leaving stray accent marks or parts behind.
  • Fixed character widths and wrapping so Unicode text keeps pane borders, cursor positions, and terminal output aligned. This also applies to built-in help and release notes.

Response split shortcuts

The default response split shortcuts have changed:

  • Alt+v replaces Ctrl+v for side-by-side responses.
  • Alt+h replaces Ctrl+u for stacked responses.

Repeat the same shortcut to close the split. When the editor is focused, use these shortcuts in normal mode. Custom bindings for the split actions still apply.

Other improvements

  • Errors in multiline directives point to the offending option on its source line. Unfinished workflow directives point to the directive that needs fixing.
  • Contextual help recognizes continuation lines in multiline directives and no longer treats directive-like text inside script bodies as request directives.
  • Faster diagnostic checks for large files and long directives with many errors or warnings.
  • The keyboard cheat sheet now distinguishes key combinations from key sequences and explains which shortcuts work in insert mode.