@@ -94,7 +94,7 @@ static XDocument loadDoc(string path)
9494 ;
9595
9696 var docMap = generateDocMap ( types , docMembers , trimLevel , logger ) ;
97- var docCref = docMembers . Elements ( DocElementNames . Member ) . Where ( m => ! m . HasAttribute ( DocAttributeNames . _trimmed ) ) . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( c => ! string . IsNullOrWhiteSpace ( c ) ) ;
97+ var docCref = docMembers . Elements ( DocElementNames . Member ) . Where ( m => ! m . HasAttribute ( DocAttributeNames . _trimmed ) ) . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( isValidCref ) ;
9898 var asmTypes = types . Select ( t => t . GetDocID ( ) ) . ToHashSet ( ) ;
9999
100100 var refCref = docMap . Values . SelectMany ( v => v . Select ( l => l . Cref ) ) . Concat ( docCref ) . Where ( c => ! asmTypes . Contains ( getTypeIDFromDocID ( c ) ) ) . ToHashSet ( ) ;
@@ -171,7 +171,7 @@ private static IDictionary<string, IEnumerable<DocMatch>> generateDocMap(IList<T
171171 {
172172 logger . Write ( ILogger . Severity . Diag , "Processing DocID: " + typeID ) ;
173173
174- var crefs = typeDocs . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( c => ! string . IsNullOrWhiteSpace ( c ) ) . ToList ( ) ;
174+ var crefs = typeDocs . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( isValidCref ) . ToList ( ) ;
175175 var dml = new List < DocMatch > ( ) ;
176176 docMap . Add ( typeID , dml ) ;
177177
@@ -267,7 +267,7 @@ private static IDictionary<string, IEnumerable<DocMatch>> generateDocMap(IList<T
267267 logger . Write ( ILogger . Severity . Diag , "Processing DocID: " + memID ) ;
268268
269269 var bases = ( om is not null ? ( new [ ] { om } ) : [ ] ) . Concat ( m . GetBaseCandidates ( ) ) . ToList ( ) ;
270- var crefs = methDocs . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( c => ! string . IsNullOrWhiteSpace ( c ) ) . ToHashSet ( ) ;
270+ var crefs = methDocs . Descendants ( DocElementNames . InheritDoc ) . Select ( i => ( string ) i . Attribute ( DocAttributeNames . Cref ) ) . Where ( isValidCref ) . ToHashSet ( ) ;
271271 var dml = new List < DocMatch > ( ) ;
272272
273273 foreach ( var ( bm , cref ) in bases . SelectMany ( bm => bm . GetDocID ( ) . Select ( d => ( bm , d ) ) ) )
@@ -555,6 +555,8 @@ static XDocument getRefDocs(IReadOnlyCollection<string> refAssemblies, IReadOnly
555555 }
556556 }
557557
558+ private static bool isValidCref ( string cref ) => cref is { Length : > 2 } && cref [ 0 ] is not '!' && ( cref [ 0 ] is 'T' || cref . IndexOf ( '.' , 2 ) > 0 ) ;
559+
558560 private static string getTypeIDFromDocID ( string docID )
559561 {
560562 if ( docID [ 0 ] == 'T' )
0 commit comments