• S
    Sort nodes by location before determining contiguous spans encompassed by these nodes. · c299cc49
    Shyam N 提交于
    CommonSyntaxNodeExtensions.GetContiguousSpans() was incorrectly assuming that the supplied nodes will be in the order in which they appear in source. This helper is used in the analyzer that produces diagnostics to grey out unused usings (i.e. to produce one diagnostic for a set of contiguous unused using directives).
    
    Due to the above incorrect assumption, we would end up producing a single diagnostic spanning multiple unused usings sometimes and multiple diagnostics at other times. Often different invocations of the analyzer for the same source file would produce different set of unused usings diagnostics.
    
    While this does not cause observable problems in regular usage - this is a problem for tests and led to flaky behavior where test would pass sometimes and fail at other times.
    c299cc49
ErrorSquiggleProducerTests.cs 8.4 KB