From 0944c73716e39c3c930fa8514e556b644072de86 Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Tue, 16 Apr 2024 08:19:58 -0400 Subject: [PATCH] Recommend LSP's in development docs (#3370) * Recommend LSP's in development docs Per conversation in #3338. There are already a lot of documented compile options so I think we're better off suggesting that everybody create a compile_commands.json whether or not they're using an LSP because it doesn't cost much. While I was at it it seemed reasonable to mention rust LSP too. Now that rls is deprecated I'm not sure there is any competitor to rust-analyzer worth mentioning. * Export compile commands by default. Thanks to @felixschurk for the idea and telling me how to do it. It took me a minute to figure out that this places the compile_commands.json in the build directory rather than the root of the project. But clangd still finds it there and that's a better place for it anyway. --- CMakeLists.txt | 2 ++ doc/devel/contrib/development.md | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca546d417..17f9c564c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required (VERSION 3.22) +set (CMAKE_EXPORT_COMPILE_COMMANDS ON) + project (task VERSION 3.0.0 DESCRIPTION "Taskwarrior - a command-line TODO list manager" diff --git a/doc/devel/contrib/development.md b/doc/devel/contrib/development.md index b6261d495..ff6ff5d98 100644 --- a/doc/devel/contrib/development.md +++ b/doc/devel/contrib/development.md @@ -12,9 +12,13 @@ See the [TaskChampion CONTRIBUTING guide](../../../taskchampion/CONTRIBUTING.md) * CMake 3.0 or later * gcc 7.0 or later, clang 6.0 or later, or a compiler with full C++17 support * libuuid (if not on macOS) - * python 3 (optional, for running the test suite) * Rust 1.64.0 or higher (hint: use https://rustup.rs/ instead of using your system's package manager) +## Install Optional Dependencies: + * python 3 (for running the test suite) + * clangd or ccls (for C++ integration in many editors) + * rust-analyzer (for Rust integration in many editors) + ## Obtain and Build Code: The following documentation works with CMake 3.14 and later. Here are the minimal steps to get started, using an out of source build directory and calling the underlying build tool over the CMake interface. @@ -24,7 +28,7 @@ See the general CMake man pages or the [cmake-documentation](https://cmake.org/c ```sh git clone https://github.com/GothenburgBitFactory/taskwarrior cd taskwarrior -cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo +cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build build ``` Other possible build types can be `Release` and `Debug`.