Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/languages/src/yaml/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "YAML"
grammar = "yaml"
path_suffixes = ["yml", "yaml", "pixi.lock", "clang-format"]
path_suffixes = ["yml", "yaml", "pixi.lock", "clang-format", "clangd"]
line_comments = ["# "]
autoclose_before = ",]}"
brackets = [
Expand Down
1 change: 1 addition & 0 deletions docs/src/languages/c.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ C support is available natively in Zed.
Clangd out of the box assumes mixed C++/C projects. If you have a C-only project you may wish to instruct clangd to treat all files as C using the `-xc` flag. To do this, create a `.clangd` file in the root of your project with the following:

```yaml
# yaml-language-server: $schema=https://json.schemastore.org/clangd.json
CompileFlags:
Add: [-xc]
```
Expand Down
4 changes: 3 additions & 1 deletion docs/src/languages/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ You can pass any number of arguments to clangd. To see a full set of available o
By default Zed will use the `clangd` language server for formatting C++ code. The Clangd is the same as the `clang-format` CLI tool. To configure this you can add a `.clang-format` file. For example:

```yaml
# yaml-language-server: $schema=https://json.schemastore.org/clang-format-21.x.json
---
BasedOnStyle: LLVM
IndentWidth: 4
Expand Down Expand Up @@ -106,7 +107,8 @@ You can trigger formatting via {#kb editor::Format} or the `editor: format` acti

In the root of your project, it is generally common to create a `.clangd` file to set extra configuration.

```text
```yaml
# yaml-language-server: $schema=https://json.schemastore.org/clangd.json
CompileFlags:
Add:
- "--include-directory=/path/to/include"
Expand Down
Loading