diagnostics.md

 1# Diagnostics
 2
 3Zed gets its diagnostics from the language servers and supports both push and pull variants of the LSP which makes it compatible with all existing language servers.
 4
 5# Regular diagnostics
 6
 7By default, Zed displays all diagnostics as underlined text in the editor and the scrollbar.
 8
 9Editor diagnostics could be filtered with the
10
11```json [settings]
12"diagnostics_max_severity": null
13```
14
15editor setting (possible values: `"off"`, `"error"`, `"warning"`, `"info"`, `"hint"`, `null` (default, all diagnostics)).
16
17The scrollbar ones are configured with the
18
19```json [settings]
20"scrollbar": {
21  "diagnostics": "all",
22}
23```
24
25configuration (possible values: `"none"`, `"error"`, `"warning"`, `"information"`, `"all"` (default))
26
27The diagnostics could be hovered to display a tooltip with full, rendered diagnostic message.
28Or, `editor::GoToDiagnostic` and `editor::GoToPreviousDiagnostic` could be used to navigate between diagnostics in the editor, showing a popover for the currently active diagnostic.
29
30# Inline diagnostics (Error lens)
31
32Zed supports showing diagnostic as lens to the right of the code.
33This is disabled by default, but can either be temporarily turned on (or off) using the editor menu, or permanently, using the
34
35```json [settings]
36"diagnostics": {
37  "inline": {
38    "enabled": true,
39    "max_severity": null, // same values as the `diagnostics_max_severity` from the editor settings
40  }
41}
42```
43
44# Other UI places
45
46## Project Panel
47
48Project panel can have its entries coloured based on the severity of the diagnostics in the file.
49
50To configure, use
51
52```json [settings]
53"project_panel": {
54  "show_diagnostics": "all",
55}
56```
57
58configuration (possible values: `"off"`, `"errors"`, `"all"` (default))
59
60## Editor tabs
61
62Similar to the project panel, editor tabs can be colorized with the
63
64```json [settings]
65"tabs": {
66  "show_diagnostics": "off",
67}
68```
69
70configuration (possible values: `"off"` (default), `"errors"`, `"all"`)