This repo is my running contributions and personal changes to clangd
and clang-tidy
. I'll try to merge as many of my updates as are accepted upstream to https://github.com/llvm/llvm-project.
testing.cpp.-.llvm-customizations.WSL_.Ubuntu.2024-01-25.10-18-04.mp4
modernize-use-views-enumerate
: transform index-based for loops with end condition of.size()
that use the index and also use the value at the index to range-based for loops with| std::views::enumerate
modernize-use-views-iota
: transform index-based for loops that start from an integralstart
and go to an integralend
to range-based for loops withstd::views::iota(start, end)
modernize-use-views-zip
: transform index-based for loops with end condition of.size()
that use the value from two rangesr1
andr2
at the index to range-based for loops withstd::views::zip(r1, r2)
modernize-use-views-concat
: transform consecutive range-based for loops with the same element type to a single for loop withstd::views::concat(r1, r2)
modernize-use-ctad
: transformmake_
functions to class-template-argument-deduction:std::make_optional(2)
->std::optional(2)
- With config option to use braced-init or paren-init
misc-use-static-or-inline-constexpr
: suggest transforming globalconstexpr
variables in header files toinline constexpr
and global variables in source files or function-level variables tostatic constexpr
performance-use-array
: In cases with compile-known length of std::vector, change type to array insteadbugprone-move-reference-capture
: Suggest move captures for vars captured by reference which are later moved in the lambda iff the lambda is not immediately-invokedbugprone-use-midpoint
: Suggest to usestd::midpoint(x, y)
instead of manualx + y / 2
performance-initializer-list
: In cases where vector is instantiated with the initializer-list ctor and the type is not trivially copyable, suggest using emplace back instead:std::vector<T> vec{t1, t2, t3}
->std::vector<T> vec = [&]{std::vector<T> out{}; out.emplace_back(t1); out.emplace_back(t2); out.emplace_back(t3); return out;}()
- Add "swap parameters" code action to clangd
- Add "extract constraints to concept" code action to clangd
- Add "move concept to requires clause" code action to clangd
- Add code action to convert include to forward-declarations
- Extract to lambda instead of function
- Inlay hints for size of included file
- Inlay hints for implicit default initialization
- Inlay hints for deduced template parameters
- Inlay hints for default arguments (and template args)
- Only publish block inlay hints for blocks bigger than a configurable line length
- Convert block comment to multiline comment & vice versa
- Convert member function qualifiers into explicit
this
parameter - Convert eager monadic functions to lazy versions
- Autocomplete for #include should use fuzzy path finder
- Compute comptime enum underlying values on hover
- For instance, see
llvm/include/llvm/ADT/SparseBitVector.h
, and hover over the enum valuesBITS_PER_ELEMENT
- For instance, see
- Proper schema-based autocomplete for config.yaml
- Make "add missing includes" use the same path for the includes as autocomplete's "from _.h" functionality
- Make
-Wunused-but-set-variable
suggest removing the only-ever-set variable