• D
    Rationalize Code Model "member node" logic · 90d042a9
    Dustin Campbell 提交于
    Code Model has several ways of looking at the member nodes of a
    particular container. Sometimes it does so recursively, flattening all
    nested members into a single list. Sometimes, it looks for "logical"
    nodes, i.e. breaking up field declarations into their component
    declarators. Sometimes only supported nodes (that is, nodes that can be
    properly represented in Code Mode) are expected.
    
    Unfortunately, the internal APIs for these searches grew up organically
    and have ecome quite a mess. There were several places where the wrong
    search was being used, resulting in strange bugs*.
    
    These concepts are now consolidated into a single GetMemberNodes()
    method and all callsites have been reviewed and updated.
    
    * The particular bug that this change addresses is about inserting a
    node into a container that contains an incomplete member. In that case,
    the code used a "flattened" list to find the index where the node was to
    be inserted. What it really wanted was a "logical" list, but that was
    conflated with "flattening".
    90d042a9
CSharpCodeModelService.cs 151.4 KB