From 9ed9a95c15edcca9f8310aad2f16c9e377954b60 Mon Sep 17 00:00:00 2001 From: Caoimhe Date: Sat, 3 Jun 2023 00:04:11 +0100 Subject: [PATCH] Documentation: Add instructions for configuring the Helix editor --- Documentation/HelixConfiguration.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/HelixConfiguration.md diff --git a/Documentation/HelixConfiguration.md b/Documentation/HelixConfiguration.md new file mode 100644 index 00000000000..baf5117572b --- /dev/null +++ b/Documentation/HelixConfiguration.md @@ -0,0 +1,18 @@ +# 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: +```yaml +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: +```toml +[[language]] +name = "cpp" +language-server = { command = "clangd", args=["--query-driver=/path/to/serenity/Toolchain/Local/**/*", "--header-insertion=never"] } +``` + +> Make sure to replace `/path/to/serenity` with the actual path in the snippet above!