Skip to content

Commit

Permalink
Fix getPackageName which didn't respect "build ignore" (#7034)
Browse files Browse the repository at this point in the history
This fixed the indexing problem caused by retrieving the wrong package name.

fixes #7010
  • Loading branch information
H5-O5 authored Nov 27, 2024
1 parent 78af0a8 commit bfe4785
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ private static String getPackageName(Project project, Collection<File> 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
Expand Down

0 comments on commit bfe4785

Please sign in to comment.