diff options
author | Peter Collins <pecolli@microsoft.com> | 2022-07-13 04:54:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-13 04:54:14 +0300 |
commit | 039a03016419e9e9234611ba143a75400ec6325d (patch) | |
tree | c178a08270e2d55e731b9fc7c7d9b758f3b2a8f2 | |
parent | f71d2ecf72dc7deac1e2de58cd0f3b94f8d98999 (diff) |
[DocumentationEnumerator] Support global alias matching (#641)
The tooling is currently unable to match existing documentation with a
member that was updated to include a global alias. Fix this by adding a
a type lookup attempt that prefixes `global::` to the documentation
member name.
-rw-r--r-- | mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs b/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs index 3b710a98..abe87e2c 100644 --- a/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs +++ b/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs @@ -256,8 +256,8 @@ namespace Mono.Documentation.Updater // 1. "Normal" (non-generic) member names: GetEnumerator // - Lookup as-is. // 2. Explicitly-implemented interface member names: System.Collections.IEnumerable.Current - // - try as-is, and try type.member (due to "kludge" for property - // support. + // - try as-is, try global::namespace.type.member, and try + // type.member (due to "kludge" for property support. // 3. "Normal" Generic member names: Sort<T> (CSC) // - need to remove generic parameters --> "Sort" // 4. Explicitly-implemented interface members for generic interfaces: @@ -294,6 +294,13 @@ namespace Mono.Documentation.Updater }; + // An explicitly-implemented interface member may have been updated to use a global alias. + foreach (MemberReference mi in type.GetMembers ($"global::{docName}")) + { + memberCount++; + yield return mi; + } + // might be a property; try only type.member instead of // namespace.type.member. var typeMember = DocUtils.GetTypeDotMember (docName); |