Skip to content

Commit

Permalink
update zed lsp settings (#95)
Browse files Browse the repository at this point in the history
Revert to clangd-18 as clangd-19 appears to not work very well.

Change-Id: If375d3f6fdbee26a4d53255a680b57966e0b60a2
  • Loading branch information
oliverlee authored Oct 3, 2024
1 parent b4d998e commit c32739e
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 15 deletions.
16 changes: 9 additions & 7 deletions .zed/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@
"lsp": {
"clangd": {
"binary": {
"path": "./external/llvm19_toolchain_llvm/bin/clangd",
"path": "./external/llvm18_toolchain_llvm/bin/clangd",
"arguments": [
"--function-arg-placeholders=0",
"--completion-parse=always",
"--parse-forwarding-functions",
"--use-dirty-headers",
"--include-ineligible-results",
"--header-insertion-decorators",
"--all-scopes-completion",
"--clang-tidy",
"--debug-origin",
"--header-insertion=iwyu",
"--header-insertion-decorators",
"--include-ineligible-results",
"--import-insertions",
"--limit-references=0",
"--limit-results=0",
"--rename-file-limit=0",
"--enable-config"
"--rename-file-limit=0"
]
}
},
Expand All @@ -66,6 +66,8 @@
"autoImportCompletions": "true",
"typeCheckingMode": "off",
"logLevel": "trace",
// create with:
// bazel fetch @python3_fake_venv//...
"extraPaths": ["./external/python3_fake_venv/pypi/site-packages"]
},
"pyright": {
Expand Down
23 changes: 23 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,29 @@ load("@llvm19_toolchain//:toolchains.bzl", "llvm_register_toolchains")

llvm_register_toolchains()

llvm_toolchain(
name = "llvm18_toolchain",
cxx_flags = {
"": [
"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
"-stdlib=libc++",
"-Wshadow",
] + COMMON_CXX_WARNINGS + CXX_STANDARD,
},
# Link UBSan C++ runtime libraries if the `ubsan` feature is enabled
# https://github.com/bazelbuild/bazel/issues/12797#issuecomment-980641064
# use `link_libs` to prevent overriding default `link_flags`
# https://github.com/grailbio/bazel-toolchain/blob/ceeedcc4464322e05fe5b8df3749cc02273ee083/toolchain/cc_toolchain_config.bzl#L148-L150
link_libs = {
"": ["-fsanitize-link-c++-runtime"],
},
llvm_version = "18.1.8",
)

load("@llvm18_toolchain//:toolchains.bzl", llvm18_register_toolchains = "llvm_register_toolchains")

llvm18_register_toolchains()

BAZEL_BOOTLIN_COMMIT = "d15e4b4c3a984668d1d6bd5f3ca032efecae5cb1"

http_archive(
Expand Down
4 changes: 2 additions & 2 deletions rigid_geometric_algebra/blade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ class blade
///
/// @{

template <class F = detail::wedge_fn>
friend constexpr auto operator^(const blade& lhs, const auto& rhs)
template <class T, class F = detail::wedge_fn>
friend constexpr auto operator^(const blade& lhs, const T& rhs)
-> decltype(std::declval<F>()(lhs, rhs))
{
return F{}(lhs, rhs);
Expand Down
4 changes: 2 additions & 2 deletions rigid_geometric_algebra/multivector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ class multivector
/// ~~~
/// if `(b1...)` and `(b2...)` were valid ranges.
///
template <class F = detail::wedge_fn>
friend constexpr auto operator^(const multivector& lhs, const auto& rhs)
template <class T, class F = detail::wedge_fn>
friend constexpr auto operator^(const multivector& lhs, const T& rhs)
-> decltype(std::declval<F>()(lhs, rhs))
{
return F{}(lhs, rhs);
Expand Down
4 changes: 2 additions & 2 deletions rigid_geometric_algebra/wedge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class wedge_blade_fn
template <detail::blade B1, detail::blade B2>
requires has_common_algebra_type_v<B1, B2> and
(not unique_factors_v<B1, B2>)
static constexpr auto
operator()(B1&&, B2&&) -> zero_constant<common_algebra_type_t<B1, B2>>
static constexpr auto operator()(const B1&, const B2&)
-> zero_constant<common_algebra_type_t<B1, B2>>
{
return {};
}
Expand Down
4 changes: 2 additions & 2 deletions rigid_geometric_algebra/zero_constant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ struct zero_constant : detail::derive_subtraction<zero_constant<A>>
/// * T1 is `zero_constant` xor T2 is `zero_constant`
/// @returns `zero_constant` value
///
template <class F = detail::wedge_fn>
friend constexpr auto operator^(zero_constant lhs, const auto& rhs)
template <class T, class F = detail::wedge_fn>
friend constexpr auto operator^(zero_constant lhs, const T& rhs)
-> decltype(std::declval<F>()(lhs, rhs))
{
return F{}(lhs, rhs);
Expand Down

0 comments on commit c32739e

Please sign in to comment.