From 63918b8955d0ac846a1c1d2058b026d4d9d122f5 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Mon, 15 Dec 2025 08:16:48 +0100 Subject: [PATCH] docs: Document implemented `clangd` extensions (#44308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zed currently doesn’t support all protocol extensions implemented by `clangd`, but it does support two: - `textDocument/inactiveRegion` - `textDocument/switchSourceHeader` Release Notes: - N/A --------- Co-authored-by: Kunall Banerjee --- docs/src/languages/cpp.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/src/languages/cpp.md b/docs/src/languages/cpp.md index c20dd58335caca45a6923cc0527605d6cc4b5564..629a0ab640e245bdfec41370fa966589728c2c94 100644 --- a/docs/src/languages/cpp.md +++ b/docs/src/languages/cpp.md @@ -158,3 +158,26 @@ You can use CodeLLDB or GDB to debug native binaries. (Make sure that your build } ] ``` + +## Protocol Extensions + +Zed currently implements the following `clangd` [extensions](https://clangd.llvm.org/extensions): + +### Inactive Regions + +Automatically dims inactive sections of code due to preprocessor directives, such as `#if`, `#ifdef`, or `#ifndef` blocks that evaluate to false. + +### Switch Between Source and Header Files + +Allows switching between corresponding C++ source files (e.g., `.cpp`) and header files (e.g., `.h`). +by running the command {#action editor::SwitchSourceHeader} from the command palette or by setting +a keybinding for the `editor::SwitchSourceHeader` action. + +```json [settings] +{ + "context": "Editor", + "bindings": { + "alt-enter": "editor::SwitchSourceHeader" + } +} +```