-
Notifications
You must be signed in to change notification settings - Fork 229
Allow components in global namespace #10086
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
Changes from 5 commits
8a05492
9de3c17
b225060
acf1208
a7713a7
e9f30fb
61ead07
d5eeae8
7f6c75d
cfb9176
ae4fc31
8586250
1836b11
0d0bf2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -115,8 +115,10 @@ private static TagHelperDescriptor CreateNameMatchingDescriptor( | |||||||||||||||
|
|
||||||||||||||||
| if (fullyQualified) | ||||||||||||||||
| { | ||||||||||||||||
| var containingNamespace = type.ContainingNamespace.ToDisplayString(); | ||||||||||||||||
| var fullName = $"{containingNamespace}.{type.Name}"; | ||||||||||||||||
| var containingNamespace = type.ContainingNamespace.ToDisplayString(SymbolExtensions.FullNameTypeDisplayFormat); | ||||||||||||||||
| var fullName = string.IsNullOrEmpty(containingNamespace) | ||||||||||||||||
| ? type.Name | ||||||||||||||||
| : $"{containingNamespace}.{type.Name}"; | ||||||||||||||||
|
||||||||||||||||
| var containingNamespace = type.ContainingNamespace.ToDisplayString(SymbolExtensions.FullNameTypeDisplayFormat); | |
| var fullName = string.IsNullOrEmpty(containingNamespace) | |
| ? type.Name | |
| : $"{containingNamespace}.{type.Name}"; | |
| var fullName = type.ContainingNamespace.IsGlobalNamespace | |
| ? type.Name | |
| : $"{type.ContainingNamespace.ToDisplayString(SymbolExtensions.FullNameTypeDisplayFormat)}.{type.Name}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is it possible to have a component in a nested type? If so, will this handle that correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, is it possible to have a component in a nested type? If so, will this handle that correctly?
I don't think it's possible. (You've already asked me this previously in #9689 (comment) :D)
In any case, the previous code did "{namespace}.{typeName}" and I've just changed it to omit the "{namespace}." prefix when needed, so nothing should change at this front, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_type.ContainingNamespace.ToDisplayString()would be"<global namespace>"; withSymbolExtensions.FullNameTypeDisplayFormatwe get an empty string instead (this format was already used in other places, just not everywhere)