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 ShreeM01 committed Mar 27, 2023
1 parent 8c6d02e commit 424a0cd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,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 @@ -115,10 +116,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 424a0cd

Please sign in to comment.