ladybird/Documentation/HelixConfiguration.md
Valtteri Koskivuori 427ca284f1 Documentation: Update Helix editor documentation
Helix 23.10 made breaking changes to the way lsp configuration works, so
update documentation to reflect the new structure.
2023-11-15 06:49:48 -05:00

862 B

Helix Configuration

Helix comes with support for clangd and clang-format out of the box! However, a small bit of configuration is needed for it to work correctly with SerenityOS.

The following .clangd should be placed in the project root:

CompileFlags:
  CompilationDatabase: Build/x86_64 # Or whatever architecture you're targeting, e.g. aarch64
  Add: [-D__serenity__]

You also need to configure the clangd server to detect headers properly from the Serenity toolchain. To do this, create a .helix/languages.toml file in the project root:

[language-server.serenity]
command = "clangd"
args = ["--query-driver=/path/to/serenity/Toolchain/Local/**/*", "--header-insertion=never"]

[[language]]
name = "cpp"
language-servers = ["serenity"]

Make sure to replace /path/to/serenity with the actual path in the snippet above!