> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LSP and static analyzers

> Enable language servers and static analyzers, give them the right build configuration, and run project-wide checks.

Enable static analyzers so Inlay checks each file it edits and can run project-wide checks, such as MISRA or CERT reports. Language servers also let Inlay jump to definitions, find references, list symbols, and follow callers and callees.

## Enable an analyzer

In VS Code:

1. Run `/static-analyzer`. `/lsp` and `/analyzers` open the same **Static Analysis** panel, on the **Installed** tab.
2. Select the **Browse** tab, select the analyzer you want, then choose **Enable**. Perforce QAC shows **Set Up with Agent** instead.
3. Open the analyzer from the **Installed** tab and check its status.
4. Work through the **Setup** list, then set the fields under **Settings**. Choose **This Project** to save settings for the current project, or **All Projects** to save them as your default.
5. Before a full scan, try a small one: ask Inlay to run the diagnostics on one folder. See [Run project diagnostics](#run-project-diagnostics).

In the terminal UI:

1. Run `/static-analyzer` to open **Installed Static Analyzers**.
2. Press `m` to open **Static Analyzer Marketplace**. Press `Space` to select each analyzer you want enabled, then press `Enter`.
3. In the installed list, select an analyzer and press `i` to see its status and settings. Press `p` to edit this project's settings or `g` to edit your defaults, then press `Space` or `Enter` to change the highlighted setting. Press `r` to reset the project settings.
4. To turn an analyzer on or off, select it in the installed list and press `Enter` or `d`.

In either client, turning an analyzer on or off applies to all your projects. Its settings can differ for each project.

### Check the analyzer's status

In VS Code, each analyzer shows a status that tells you what to do next:

| Status | Meaning | Next step |
| - | - | - |
| **Ready** | The analyzer is on, its executable was found, and its configuration checks out. The status can also show **Analyzing**, **No problems**, or a count of errors and warnings. | Run a check. |
| **Needs setup** | Inlay found a problem with the analyzer's configuration. | Review the **Setup** list and **Settings** in the analyzer's details. |
| **Setup incomplete** | Perforce QAC only. Some of its setup checks aren't ready; the status shows how many are. | Open the analyzer and work through **Setup**. |
| **Downloading** | Inlay is downloading a managed analyzer. | Wait for the download, then choose **Check Again**. |
| **Not installed** | Inlay can't find the executable on your `PATH`. | Install the tool, using **Get Installer** or the install commands in the analyzer's details, then choose **Check Again**. |
| **Off** | The analyzer is turned off. | Turn on its toggle on the **Installed** tab or in its details. |

In the terminal UI, the installed list shows `ready`, `setup required` (the same as **Needs setup**), `missing` (**Not installed**), or `disabled` (**Off**).

Enabling an entry doesn't install every tool it needs. Use the status and the **Setup** list to confirm the analyzer can run. To stop an analyzer's diagnostics without removing it, turn off its toggle.

## Choose the tool

Inlay downloads managed analyzers for you. Install the others yourself and make them available on your `PATH`.

| Analyzer | Type | Languages | Installation |
| - | - | - | - |
| clangd | Language server | C, C++ | Managed |
| rust-analyzer | Language server | Rust (Cargo projects) | Managed |
| ccls | Language server | C, C++ | Install yourself |
| neocmakelsp | Language server | CMake | Managed |
| devicetree-language-server | Language server | Devicetree | Managed |
| kconfig-lsp | Language server | Kconfig | Install yourself |
| cppcheck | Command-line analyzer | C, C++ | Install yourself |
| clang-tidy | Command-line analyzer | C, C++ | Install yourself (LLVM) |
| shellcheck | Command-line analyzer | Shell scripts | Managed |
| Perforce QAC | Command-line analyzer | C, C++, Rust | Install and license yourself |
| Parasoft C/C++test | Command-line analyzer | C, C++ | Install and license yourself |
| Coverity | Command-line analyzer | C, C++, Rust, Java, C#, Go | Install and license yourself |

For an analyzer you install yourself, its details show an install hint and a **Get Installer** link once you enable it. Commercial analyzers need your installed product and a valid license. See [Static analysis integrations](/docs/integrations/static-analysis.md) for their workflows.

## Use the correct build inputs

For C and C++, supply a current `compile_commands.json` for the target and build variant you're working on. A compilation database from another board can produce misleading errors or hide real issues.

Point each analyzer at the database:

| Analyzer | Field | Value |
| - | - | - |
| clangd | **Compile database directory** | Folder that contains `compile_commands.json`. Leave it empty to auto-detect. |
| cppcheck | **Compile database** | Path to `compile_commands.json`, such as `build/compile_commands.json`. |
| clang-tidy | **Compile database directory** | Folder that contains `compile_commands.json`. Leave it empty to auto-detect. |

If you build with an embedded cross-compiler, set clangd's **Cross-compiler locations** to the compiler paths, for example `/opt/toolchains/**/arm-none-eabi-*`, so it finds the target headers.

For a CMake project, turn on the compilation-database export with your normal configuration options:

```bash theme={"theme":"css-variables"}
cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build build
```

Keep any toolchain, board, or preset options your project needs.

For other languages, follow the analyzer's setup checklist. rust-analyzer needs a Cargo project. Commercial tools may need a controlled project or a build capture.

## Review findings after edits

When Inlay edits a file, enabled analyzers check it. The edit shows a **Static analysis** card with the number of findings. Expand it to see each finding's line, rule, and message. Ask Inlay to explain or fix a finding, then let the check run again.

To check a coding standard on every edit, open cppcheck and set **Per-file compliance** to a standard, such as **MISRA C:2012** or **CERT C:2016**. After each C or C++ edit, the card shows the per-file gate result:

| Result | Meaning |
| - | - |
| **PASS** | The file was checked after the edit and the configured check found nothing. It doesn't mean every requirement of the standard was assessed. |
| **FAIL** | The check reported findings. Inlay starts a repair pass and tracks it in the task list. |
| **NOT RUN** or **INCOMPLETE** | The file wasn't validated. Fix the analyzer setup, then edit the file again so the check reruns. |

## Run project diagnostics

To check more than the files Inlay edits, ask for a project run:

```text theme={"theme":"css-variables"}
Assess the non-vendored C and C++ source scope, check the compilation database,
then run the enabled diagnostics. Report findings, files not checked, and
configuration problems separately.
```

Name a module or folder when you want a smaller scope. For a whole-project result, ask Inlay to confirm what was actually analyzed. Don't accept a partial scan as complete.

## End-to-end MISRA and CERT workflows

For a whole-project MISRA or CERT report, run `/validate-MISRA` or `/validate-CERT`.
See [Static analysis integrations](/docs/integrations/static-analysis.md) for the setup, the run, and how to read the report, with cppcheck, clang-tidy, or a commercial analyzer.

## Keep settings reusable

Inlay saves project settings in `.inlay/lsp.json` and your defaults in `~/.inlay/lsp.json`. Edit them through the manager, and use project scope for target-specific inputs such as the compilation database.

Inlay can't change analyzer settings in Plan mode. To have Inlay enable or configure an analyzer for you, switch to Act mode first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.