Meta: Remove configure-clangd.sh

This script:
1. Hasn't get up with our build directory structure.
2. Only works on macOS due to the way it invokes sed.
3. Arguably takes longer to figure out how to run the script than it
   does to just edit .clangd's build path.
This commit is contained in:
Timothy Flynn
2026-04-23 10:29:02 -04:00
committed by Tim Flynn
parent f30f959f68
commit 59d320a1d3
Notes: github-actions[bot] 2026-04-23 16:50:17 +00:00
2 changed files with 5 additions and 61 deletions

View File

@@ -71,16 +71,10 @@ Some OS distributions don't ship bleeding-edge clang-format binaries. Below are
## Clangd Configuration
Clangd will automatically look for configuration information in files
named `.clangd` in each of the parent directories of the file being
edited. The Ladybird source code repository has a top-level `.clangd`
configuration file in the root directory. One of the configuration
stanzas in that file specifies the location for a compilation database.
Depending on your build configuration (e.g., Debug, default, Sanitizer,
etc.), the path to the compilation database in that file may not be
correct. The result is that `clangd` will have a difficult time
understanding all your include directories. To resolve the problem, you
can use the `Meta/configure-clangd.sh` script.
The repository has a `.clangd` configuration file in the root directory. One of the configuration stanzas in that file
specifies the location for a compilation database. Depending on your build configuration (e.g. Release, Debug, Sanitizer),
the path to the compilation database in that file may not be correct. You may edit the `.clangd` file to point at your
build directory.
## Clang Plugins
@@ -111,7 +105,7 @@ builds, and to configure the Flathub repo. The Ladybird Flatpak manifest at
```bash
flatpak-builder --user --force-clean --install-deps-from=flathub \
--ccache --repo=Build/repo --install Build/flatpak \
Meta/CMake/flatpak/org.ladybird.Ladybird.json
Meta/CMake/flatpak/org.ladybird.Ladybird.json
```
This command will build the Flatpak bundle and install it into the local Flatpak repository at `Build/repo`. Expect this

View File

@@ -1,50 +0,0 @@
#!/usr/bin/env bash
function usage {
echo "$0 <.clangd file path> [release|debug]"
echo "Update local clangd configuration with the proper"
echo "compilation database according to the selected build type."
}
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
cd "${script_path}/.." || exit 1
# Check if the user has sed.
if ! which sed >/dev/null 2>&1; then
echo "Error: No sed found. Cannot configure .clangd automatically."
exit 1
fi
# Check if the user specified the right number of parameters.
if [ $# -ne 2 ]; then
usage
exit 1
fi
clangd_file_path=$1
if [ ! -f "$clangd_file_path" ]; then
echo "Error: ${clangd_file_path} is not a regular file."
echo
usage
exit 1
fi
build_type=""
case $2 in
Debug)
build_type="debug"
;;
default)
build_type="release"
;;
Sanitizer)
build_type="sanitizers"
;;
*)
echo "Invalid build configuration specified: $2"
usage
exit 1
esac
sed -i '' "s/\(^[ ]*CompilationDatabase:\).*$/\1 Build\/${build_type}/" "$clangd_file_path"