Skip to content

Commit

Permalink
feat(api): also filter directories containing only textless entries (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
schroederc committed Apr 17, 2023
1 parent 02c7c21 commit bd0277b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions kythe/go/serving/filetree/filetree.go
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() {
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
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

0 comments on commit bd0277b

Please sign in to comment.