Skip to content

Commit

Permalink
fix: Remove incorrect diagnostic for missing ASTs
Browse files Browse the repository at this point in the history
  • Loading branch information
varungandhi-src committed Sep 6, 2024
1 parent ebfe810 commit fe2c36c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/index/package_ident.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"strings"

"github.com/agnivade/levenshtein"
"github.com/charmbracelet/log"
"golang.org/x/tools/go/packages"
)

Expand All @@ -22,7 +21,8 @@ func findBestPackageDefinitionPath(pkg *packages.Package) (*ast.File, error) {
}

if len(pkg.Syntax) == 0 {
log.Warn("package does not contain any ASTs", "path", pkg.PkgPath)
// This case can be triggered when a package directory only contains `_test.go` files,
// as those files will be compiled as part of a separate _test package.
return nil, nil
}

Expand Down

0 comments on commit fe2c36c

Please sign in to comment.