文件最后提交记录最后更新时间
[clangd] Add new IncludeDirective to IncludeHeaderWithReferences The IncludeDirective contains both Include (the current behavior) and Import, which we can use in the future to provide #import suggestions for Objective-C files/symbols. Differential Revision: https://reviews.llvm.org/D1284573 年前
[clangd/index/remote]NFC: Adapt code to newer grpc/protobuf versions It seems newer grpc / protobuf versions renamed Status::error_message() and Status::error_code() to message() and code() to prepare for replacement with absl::Status with the same names. As far as I can tell the new names are already available in the grpc-1.36 version mentioned in the README file. Differential Revision: https://reviews.llvm.org/D1445993 年前
[Support] Move raw_ostream::tie to raw_fd_ostream (#97396) Originally, tie was introduced by D81156 to flush stdout before writing to stderr. 030897523 reverted this due to race conditions. Nonetheless, it does cost performance, causing an extra check in the "cold" path, which is actually the hot path for raw_svector_ostream. Given that this feature is only used for errs(), move it to raw_fd_ostream so that it no longer affects performance of other stream classes.1 年前
cmake: add missing dependencies on ClangDriverOptions tablegen The modules build trips over this frequently because there is no textual include of the tablegen output, but the module includes it. Differential revision: https://reviews.llvm.org/D1571192 年前
[clangd] Use clang_target_link_libraries() for clang libs (#94937) Use clang_target_link_libraries() instead of LINK_LIBS when linking clang libraries. This ensures that in CLANG_LINK_CLANG_DYLIB mode we link against libclang-cpp.so (instead of linking against both it and the static libraries). Most places were already doing this correctly, there were just a handful of leftovers.1 年前
[clangd] Rename Features.h -> Feature.h to avoid confilct with libstdc++ Fixes https://github.com/clangd/clangd/issues/835 Differential Revision: https://reviews.llvm.org/D1076244 年前
Revert: [clangd] Replace an include with a forward declaration (#97082) Reverting due to failures on several buildbots.1 年前
[clangd] Add new IncludeDirective to IncludeHeaderWithReferences The IncludeDirective contains both Include (the current behavior) and Import, which we can use in the future to provide #import suggestions for Objective-C files/symbols. Differential Revision: https://reviews.llvm.org/D1284573 年前
[clangd] Add basic monitoring info request for remote index server This allows requesting information about the server uptime and start time. This is the first patch in a series of monitoring changes, hence it's not immediately useful. Next step is propagating the index freshness information and then probably loading metadata into the index server. The way to test new behaviour through command line: $ grpc_cli call localhost:50051 Monitor/MonitoringInfo '' connecting to localhost:50051 uptime_seconds: 42 index_age_seconds: 609568 Rpc succeeded with OK status Reviewed By: kadircet Differential Revision: https://reviews.llvm.org/D982465 年前
[clangd] Bump recommended gRPC version (1.33.2 -> 1.36.3) Context: https://github.com/clangd/clangd/pull/783 Reviewed By: kadircet Differential Revision: https://reviews.llvm.org/D1033934 年前
[clangd] Add basic monitoring info request for remote index server This allows requesting information about the server uptime and start time. This is the first patch in a series of monitoring changes, hence it's not immediately useful. Next step is propagating the index freshness information and then probably loading metadata into the index server. The way to test new behaviour through command line: $ grpc_cli call localhost:50051 Monitor/MonitoringInfo '' connecting to localhost:50051 uptime_seconds: 42 index_age_seconds: 609568 Rpc succeeded with OK status Reviewed By: kadircet Differential Revision: https://reviews.llvm.org/D982465 年前
README.md

Clangd remote index

Clangd uses a global index for project-wide code completion, navigation and other features. For large projects, building this can take many hours and keeping it loaded uses a lot of memory.

To relieve that burden, we're building remote index — a global index served on a different machine and shared between developers. This directory contains code that is used as Proof of Concept for the upcoming remote index feature.

Building

This feature uses gRPC and Protobuf libraries, so you will need to install them. There are two ways of doing that.

However you install dependencies, to enable this feature and build remote index tools you will need to set this CMake flag — -DCLANGD_ENABLE_REMOTE=On.

System-installed libraries

On Debian-like systems gRPC and Protobuf can be installed from apt:

apt install libgrpc++-dev libprotobuf-dev protobuf-compiler-grpc

Building from sources

Another way of installing gRPC and Protobuf is building from sources using CMake (we need CMake config files to find necessary libraries in LLVM). The easiest way of doing that would be to choose a directory where you want to install so that the installation files are not copied to system root and you can easily uninstall gRPC or use different versions.

# Get source code.
$ git clone -b v1.36.3 https://github.com/grpc/grpc
$ cd grpc
$ git submodule update --init
# Choose directory where you want gRPC installation to live.
$ export GRPC_INSTALL_PATH=/where/you/want/grpc/to/be/installed
# Build and install gRPC to ${GRPC_INSTALL_PATH}
$ mkdir build; cd build
$ cmake -DgRPC_INSTALL=ON -DCMAKE_INSTALL_PREFIX=${GRPC_INSTALL_PATH} -DCMAKE_BUILD_TYPE=Release ..
$ make install

This guide goes into more detail on how to build gRPC from sources.

By default, CMake will look for system-installed libraries when building remote index tools so you will have to adjust LLVM's CMake invocation. The following flag will inform build system that you chose this option — -DGRPC_INSTALL_PATH=${GRPC_INSTALL_PATH}.

Running

You can run clangd-index-server and connect clangd instance to it using --remote-index-address and --project-root flags.