-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[bazel] Add clangd as a library support #81556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e2b83f0
Add bazel support for clangd as a library.
josh11b 9dc8c8e
Implement suggestions from review
josh11b 3fa3242
Merge branch 'main' into main
josh11b ca0ab60
Checkpoint progress.
josh11b 86b82c8
Incorporate more feedback
josh11b 8b70021
Merge branch 'main' into main
josh11b File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This file is licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
package(default_visibility = ["//visibility:public"], | ||
features = ["layering_check"]) | ||
|
||
licenses(["notice"]) | ||
|
||
# TODO: Pick up other files for more complete functionality, to match | ||
# clangd/CMakeLists.txt. This might look something like | ||
# glob(["*.cpp", "dir/**/*.cpp", ...]). | ||
cc_library( | ||
name = "ClangDaemon", | ||
srcs = [ | ||
"JSONTransport.cpp", | ||
"Protocol.cpp", | ||
"URI.cpp", | ||
"index/SymbolID.cpp", | ||
"support/Logger.cpp", | ||
"support/Trace.cpp", | ||
"support/MemoryTree.cpp", | ||
"support/Context.cpp", | ||
"support/Cancellation.cpp", | ||
"support/ThreadCrashReporter.cpp", | ||
"support/Shutdown.cpp", | ||
], | ||
hdrs = [ | ||
"Transport.h", | ||
"Protocol.h", | ||
"URI.h", | ||
"LSPBinder.h", | ||
"index/SymbolID.h", | ||
"support/Function.h", | ||
"support/Cancellation.h", | ||
"support/ThreadCrashReporter.h", | ||
"support/Logger.h", | ||
"support/Trace.h", | ||
"support/MemoryTree.h", | ||
"support/Context.h", | ||
"support/Shutdown.h", | ||
], | ||
includes = ["."], | ||
deps = [ | ||
"//llvm:Support", | ||
"//clang:basic", | ||
"//clang:index", | ||
], | ||
) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clangd/CMakeLists.txt lists many other files needed by the clangDaemon target.
I think this is totally fine to submit as-is, as maybe this is the minimal set of files that one needs for basic clangd functionality, but we should probably have a TODO to pick up other files (e.g.
glob(["*.cpp", "dir/**/*.cpp", ...])
) for more complete functionality. (I'm not a clangd expert, so I'm not sure what the implication of leaving out all those other files is).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a # TODO comment.