fix: show correct name in entityReference when base name is private

This commit is contained in:
spiral
2022-02-05 09:26:14 -05:00
parent 47e501da81
commit 375758206e
8 changed files with 72 additions and 68 deletions

View File

@@ -64,7 +64,7 @@ public class MemberProxy
throw new PKSyntaxError("You must pass an example proxy to add (eg. `[text]` or `J:text`).");
var tagToAdd = ParseProxyTags(ctx.RemainderOrNull(false));
if (tagToAdd.IsEmpty) throw Errors.EmptyProxyTags(target);
if (tagToAdd.IsEmpty) throw Errors.EmptyProxyTags(target, ctx);
if (target.ProxyTags.Contains(tagToAdd))
throw Errors.ProxyTagAlreadyExists(tagToAdd, target);
if (tagToAdd.ProxyString.Length > Limits.MaxProxyTagLength)
@@ -88,7 +88,7 @@ public class MemberProxy
throw new PKSyntaxError("You must pass a proxy tag to remove (eg. `[text]` or `J:text`).");
var tagToRemove = ParseProxyTags(ctx.RemainderOrNull(false));
if (tagToRemove.IsEmpty) throw Errors.EmptyProxyTags(target);
if (tagToRemove.IsEmpty) throw Errors.EmptyProxyTags(target, ctx);
if (!target.ProxyTags.Contains(tagToRemove))
throw Errors.ProxyTagDoesNotExist(tagToRemove, target);
@@ -103,7 +103,7 @@ public class MemberProxy
else
{
var requestedTag = ParseProxyTags(ctx.RemainderOrNull(false));
if (requestedTag.IsEmpty) throw Errors.EmptyProxyTags(target);
if (requestedTag.IsEmpty) throw Errors.EmptyProxyTags(target, ctx);
// This is mostly a legacy command, so it's gonna warn if there's
// already more than one proxy tag.