Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.2.0]Add suggestions to invalid tag class errors #17896

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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