Skip to content

Commit

Permalink
Add suggestions to invalid tag class errors
Browse files Browse the repository at this point in the history
Closes bazelbuild#17888.

PiperOrigin-RevId: 519729739
Change-Id: I0ae8b18acd1a88de4da40b6883cf24c5ce6586bb
  • Loading branch information
fmeum authored and Copybara-Service committed Mar 27, 2023
1 parent 81f3121 commit 3c1c0c0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import net.starlark.java.eval.StarlarkList;
import net.starlark.java.eval.StarlarkValue;
import net.starlark.java.eval.Structure;
import net.starlark.java.spelling.SpellChecker;

/** A Starlark object representing a Bazel module in the external dependency graph. */
@StarlarkBuiltin(
Expand Down Expand Up @@ -118,10 +119,11 @@ public static StarlarkBazelModule create(
throw ExternalDepsException.withMessage(
Code.BAD_MODULE,
"The module extension defined at %s does not have a tag class named %s, but its use is"
+ " attempted at %s",
+ " attempted at %s%s",
extension.getLocation(),
tag.getTagName(),
tag.getLocation());
tag.getLocation(),
SpellChecker.didYouMean(tag.getTagName(), extension.getTagClasses().keySet()));
}

// Now we need to type-check the attribute values and convert them into "build language types"
Expand Down

0 comments on commit 3c1c0c0

Please sign in to comment.