-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support clangd for code completion, navigation and insights (#30)
Uses [bazel-compile-commands-extractor](https://github.com/hedronvision/bazel-compile-commands-extractor) to generate the compilation database from our bazel build. Other minor improvements include: - simplify .bazelrc - move buildifier and compile-commands-extractor targets to separate `tools/` to make downstream integrations easier (else they fail on loading these deps) - bump bazel to 6.4.0 (for `--noenable_bzlmod` option)
- Loading branch information
1 parent
5f6a0b9
commit 10a2ac0
Showing
10 changed files
with
98 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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,18 @@ | ||
// Configure clangd | ||
"clangd.detectExtensionConflicts": true, | ||
"clangd.restartAfterCrash": true, | ||
"clangd.onConfigChanged": "restart", | ||
"clangd.arguments": [ | ||
"--malloc-trim", | ||
"--pretty", | ||
"--pch-storage=disk", | ||
"--background-index", | ||
"--header-insertion=never", | ||
"--compile-commands-dir=${workspaceFolder}/", | ||
"--query-driver=**", | ||
"-j=4" | ||
], | ||
// Disable conflicting settings of the ms-vscode.cpptools extension | ||
"C_Cpp.intelliSenseEngine": "Disabled", | ||
"C_Cpp.autocomplete": "Disabled", | ||
"C_Cpp.errorSquiggles": "Disabled", |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,5 @@ | ||
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier") | ||
|
||
buildifier( | ||
name = "buildifier", | ||
) |
This file contains 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,26 @@ | ||
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands") | ||
|
||
refresh_compile_commands( | ||
name = "refresh_compile_commands", | ||
|
||
# Keep this list updated by running the following query: | ||
# bazel query 'kind("(cc.*) rule", //...)' | ||
targets = [ | ||
"//:Pipeline", | ||
"//:StablehloToTcp", | ||
"//:TcpConversionPasses", | ||
"//:TcpConversionPassesIncGen", | ||
"//:TcpDialect", | ||
"//:TcpDialectPasses", | ||
"//:TcpDialectPassesIncGen", | ||
"//:TcpInitAll", | ||
"//:TcpOpsIncGen", | ||
"//:TcpToArith", | ||
"//:TcpToLinalg", | ||
"//:TcpTypesIncGen", | ||
"//:TorchToTcp", | ||
"//:tcp-opt", | ||
"//test:AotCompile/test_aot_compiled_basic_tcp_ops", | ||
"//test:aot_compiled_basic_tcp_ops", | ||
], | ||
) |