From 1310f3b239615656983f8724b5563ad705292b80 Mon Sep 17 00:00:00 2001 From: H5-O5 <166461697+H5-O5@users.noreply.github.com> Date: Thu, 21 Nov 2024 03:49:47 -0800 Subject: [PATCH] Fix getPackageName which didn't respect "build ignore" This fixed the indexing problem caused by retrieving the wrong package name. fixes #7010 --- .../src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java | 1 + 1 file changed, 1 insertion(+) diff --git a/golang/src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java b/golang/src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java index 2388ae4c7ef..d80885fd0ad 100644 --- a/golang/src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java +++ b/golang/src/com/google/idea/blaze/golang/resolve/BlazeGoPackage.java @@ -272,6 +272,7 @@ private static String getPackageName(Project project, Collection files, St .map(psiManager::findFile) .filter(GoFile.class::isInstance) .map(GoFile.class::cast) + .filter(goFile -> !Objects.equals(goFile.getBuildFlags(), "ignore")) .map(GoFile::getCanonicalPackageName) // strips _test suffix from test packages .filter(Objects::nonNull) .findFirst() // short circuit