From fe2c36c5aafee6609726ea1f78d99f1bf0c8413c Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Fri, 6 Sep 2024 10:59:31 +0800 Subject: [PATCH] fix: Remove incorrect diagnostic for missing ASTs --- internal/index/package_ident.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/index/package_ident.go b/internal/index/package_ident.go index 48b90c6..375f932 100644 --- a/internal/index/package_ident.go +++ b/internal/index/package_ident.go @@ -7,7 +7,6 @@ import ( "strings" "github.com/agnivade/levenshtein" - "github.com/charmbracelet/log" "golang.org/x/tools/go/packages" ) @@ -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 }