summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaoimhe <caoimhebyrne06@gmail.com>2023-06-03 00:04:11 +0100
committerAndreas Kling <kling@serenityos.org>2023-06-03 12:20:40 +0200
commit9ed9a95c15edcca9f8310aad2f16c9e377954b60 (patch)
tree5460bf6b924b1fd0f8f6472fa6f4ed689da63deb
parent052ca0a246a35a3e6646684bb9a7c6866dd36c04 (diff)
downloadserenity-9ed9a95c15edcca9f8310aad2f16c9e377954b60.zip
Documentation: Add instructions for configuring the Helix editor
-rw-r--r--Documentation/HelixConfiguration.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/HelixConfiguration.md b/Documentation/HelixConfiguration.md
new file mode 100644
index 0000000000..baf5117572
--- /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!