Step 5 of 7

Diagnostics

Diagnostics

A server reports problems as it finds them — a syntax error, an unused variable, a type that doesn’t match — and Helix shows each one as a diagnostic: an underline on the offending text, a mark in the gutter, and a count of errors and warnings on the statusline. The stand-in here treats every TODO as a warning and every FIXME as an error.

Two motions walk through them, and a picker lists them:

  • ]d and [d — the next and previous diagnostic
  • Space-d — a picker of every diagnostic in the buffer
  • Space-D — the same, across every buffer the server has open

Both motions select the diagnostic they land on, so the message is easy to read and d or c act on exactly the flagged text. The picker earns its place when a project has dozens of problems; for one file the motions are usually enough.

The buffer below has two problems. Jump to the first with ]d, reach the second through the picker, then come back with [d.

  1. Jump to the first problem with ]d From the top of the file, the next diagnostic is the FIXME on line 5.
  2. Open the diagnostics picker and pick the TODO Space-d lists both; type todo to narrow it to one, then Enter.
  3. Go back up to the FIXME with [d The same motion in the other direction.
Jump to the first problem with ]d From the top of the file, the next diagnostic is the FIXME on line 5.

Next: Open the diagnostics picker and pick the TODO

Loading editor…