Skip to content
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

feat(api): also filter directories containing only textless entries #5582

Merged
merged 2 commits into from
Apr 17, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions kythe/go/serving/filetree/filetree.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ func (t *Table) Directory(ctx context.Context, req *ftpb.DirectoryRequest) (*ftp
}
entries := make([]*ftpb.DirectoryReply_Entry, 0, len(d.Entry))
for _, e := range d.Entry {
if !req.GetIncludeFilesMissingText() && e.GetMissingText() {
jaysachs marked this conversation as resolved.
Show resolved Hide resolved
continue
}
re := &ftpb.DirectoryReply_Entry{
Name: e.Name,
BuildConfig: e.BuildConfig,
Expand All @@ -87,9 +90,6 @@ func (t *Table) Directory(ctx context.Context, req *ftpb.DirectoryRequest) (*ftp
switch e.Kind {
case srvpb.FileDirectory_FILE:
re.Kind = ftpb.DirectoryReply_FILE
if !req.GetIncludeFilesMissingText() && e.GetMissingText() {
continue
}
case srvpb.FileDirectory_DIRECTORY:
re.Kind = ftpb.DirectoryReply_DIRECTORY
default:
Expand Down
3 changes: 2 additions & 1 deletion kythe/proto/filetree.proto
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ message DirectoryReply {
// True if the entry is generated.
bool generated = 4;

// Whether the FILE entry is missing text.
// Whether the FILE entry is missing text or the DIRECTORY entry contains
// only entries with missing_text.
bool missing_text = 5;
}
enum Kind {
Expand Down