Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@ To narrow the set of targets to index or pass additional flags to Bazel, include
Files.walkFileTree(
bazelOutLink,
object : SimpleFileVisitor<Path>() {
override fun preVisitDirectory(
dir: Path,
attrs: BasicFileAttributes,
): FileVisitResult {
// The aspect declares a `<target>.scip-targetroot` directory that
// contains the intermediate per-source `*.scip` shards. Those shards
// are already aggregated into the sibling `<target>.scip` file, so
// including them here would duplicate every document in the index.
return if (dir.fileName.toString().endsWith(".scip-targetroot")) {
FileVisitResult.SKIP_SUBTREE
} else {
FileVisitResult.CONTINUE
}
}

override fun visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult {
if (scipPattern.matches(file)) {
val bytes = Files.readAllBytes(file)
Expand Down
7 changes: 5 additions & 2 deletions scip-java/src/main/resources/scip-java/scip_java.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ many *.scip (https://github.com/scip-code/scip) files.
These files encode information about which symbols are referenced from which
locations in your source code.

Use the command below to merge all of these SCIP files into a single index:
Use the command below to merge all of these SCIP files into a single index.
The `*.scip-targetroot` directories are excluded because they contain
intermediate per-source shards that are already aggregated into the sibling
`<target>.scip` files:

find bazel-bin/ -type f -name '*.scip' | xargs cat > index.scip
find bazel-bin/ -type f -name '*.scip' -not -path '*.scip-targetroot/*' | xargs cat > index.scip

Use `src code-intel upload` to upload the unified SCIP file to Sourcegraph:

Expand Down
Loading