Skip to content

Commit

Permalink
Log unresolved imports under static flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pcj committed Nov 27, 2023
1 parent 0c942fe commit 059a57f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions language/scala/scala_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
const (
debugSelfImports = false
debugNameNotFound = false
debugUnresolvedImport = false
debugUnresolved = false
debugExtendsNameNotFound = false
debugFileScope = false
)
Expand Down Expand Up @@ -87,7 +87,9 @@ func (r *scalaRule) ResolveExports(rctx *scalarule.ResolveContext) resolver.Impo
if symbol, ok := r.ResolveSymbol(rctx.Config, rctx.RuleIndex, rctx.From, scalaLangName, imp.Imp); ok {
imp.Symbol = symbol
} else {
log.Println("unresolved export:", imp)
if debugUnresolved {
log.Println("unresolved export:", imp)
}
imp.Error = resolver.ErrSymbolNotFound
}
}
Expand All @@ -112,7 +114,7 @@ func (r *scalaRule) ResolveImports(rctx *scalarule.ResolveContext) resolver.Impo
if symbol, ok := r.ResolveSymbol(rctx.Config, rctx.RuleIndex, rctx.From, scalaLangName, imp.Imp); ok {
imp.Symbol = symbol
} else {
if debugUnresolvedImport {
if debugUnresolved {
log.Println("unresolved import:", imp)
}
imp.Error = resolver.ErrSymbolNotFound
Expand Down Expand Up @@ -276,7 +278,7 @@ func (r *scalaRule) fileImports(file *sppb.File, imports resolver.ImportMap) {
if sym, ok := r.ctx.scope.GetSymbol(name); ok {
putImport(resolver.NewResolvedNameImport(sym.Name, file, name, sym))
} else {
if debugUnresolvedImport {
if debugUnresolved {
log.Printf("warning: unresolved wildcard import: symbol %q: was not found' (%s)", name, file.Filename)
}
imp := resolver.NewDirectImport(name, file)
Expand Down

0 comments on commit 059a57f

Please sign in to comment.