Match DynamicDependency members by name#1262
Merged
Merged
Conversation
marek-safar
reviewed
Jun 10, 2020
| IEnumerable<IMemberDefinition> members; | ||
| if (dynamicDependency.MemberSignature is string memberSignature) { | ||
| members = DocumentationSignatureParser.GetMembersByDocumentationSignature (type, memberSignature); | ||
| members = DocumentationSignatureParser.GetMembersByDocumentationSignature (type, memberSignature, acceptName: true); |
Contributor
There was a problem hiding this comment.
So this is a light version of wildcard support, right? It will mark any members if ( is not part of the signature.
Member
Author
There was a problem hiding this comment.
Yup. I will note this in the docs.
vitek-karas
approved these changes
Jun 10, 2020
Member
vitek-karas
left a comment
There was a problem hiding this comment.
Maybe we should add a short doc about the signatures (and mention the two attributes where we use it). If nothing else to have a link to the Roslyn docs about it and also to note whichever differences we know about and some of the notable capabilities.
marek-safar
approved these changes
Jun 10, 2020
Member
Author
|
I'm working on a doc - I will open a follow-up for it so that I can get this in now. |
tkapin
pushed a commit
to tkapin/runtime
that referenced
this pull request
Jan 31, 2023
Commit migrated from dotnet/linker@012faca
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The signature parser allows a name to match different member types (method/field, etc.) with the same string, and it also allows specifying a parameterless method by name alone. This change also allows it to match methods/properties with any number of parameters by name alone.
I thought this was already the case, but didn't notice that the parser still checks parameters when it doesn't see parentheses, and didn't hit it when testing.
I noticed this while turning it on for dotnet/runtime. There we use it to pull in
GetSourceLineInfoby name: https://github.com/dotnet/runtime/blob/144e5145453ac3885ac20bc1f1f2641523c6fcea/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrameHelper.cs#L91.GetSourceLineInfohas a lot of parameters, so we probably wouldn't want to put the full signature in the attribute: https://github.com/dotnet/runtime/blob/144e5145453ac3885ac20bc1f1f2641523c6fcea/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs#L53.