Skip to content

Commit

Permalink
better debug logs for glob-style entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Apr 27, 2024
1 parent b9adc01 commit adaa9c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/resolver/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,11 @@ func (res *Resolver) ResolveGlob(sourceDir string, importPathPattern []helpers.G
visit = func(dirInfo *dirInfo, dir string) {
for _, key := range dirInfo.entries.SortedKeys() {
entry, _ := dirInfo.entries.Get(key)
if r.debugLogs != nil {
r.debugLogs.addNote(fmt.Sprintf("Considering entry %q", r.fs.Join(dirInfo.absPath, key)))
r.debugLogs.increaseIndent()
}

switch entry.Kind(r.fs) {
case fs.DirEntry:
// To avoid infinite loops, don't follow any symlinks
Expand Down Expand Up @@ -716,6 +721,10 @@ func (res *Resolver) ResolveGlob(sourceDir string, importPathPattern []helpers.G
results[relPath] = result
}
}

if r.debugLogs != nil {
r.debugLogs.decreaseIndent()
}
}
}

Expand Down

0 comments on commit adaa9c5

Please sign in to comment.