提交 a289221b 编写于 作者: C CyrusNajmabadi

More comments.

上级 072761d3
......@@ -396,16 +396,24 @@ private TextSpan GetRegionSpanForReference(SourceText sourceText, TextSpan refer
List<ClassifiedSpan> syntaxSpans, List<ClassifiedSpan> semanticSpans,
TextSpan widenedSpan, SourceText sourceText)
{
// The spans produced by the language services may not be ordered
// (indeed, this happens with semantic classification as different
// providers produce different results in an arbitrary order). Order
// them first before proceeding.
syntaxSpans = Order(syntaxSpans);
semanticSpans = Order(semanticSpans);
// Produce SymbolDisplayParts for both sets of ClassifiedSpans. This will
// also produce parts for the regions between the sections that the classifiers
// returned results for (i.e. for things like spaces and plain text).
var syntaxParts = Classifier.ConvertClassifications(
sourceText, widenedSpan.Start, syntaxSpans, insertSourceTextInGaps: true);
var semanticParts = Classifier.ConvertClassifications(
sourceText, widenedSpan.Start, semanticSpans, insertSourceTextInGaps: true);
var allParts = CreateAllParts(syntaxParts, semanticParts);
return allParts;
// Now merge the lists together, taking all the results from syntaxParts
// unless they were overridden by results in semanticParts.
return CreateAllParts(syntaxParts, semanticParts);
}
private List<ClassifiedSpan> Order(List<ClassifiedSpan> syntaxSpans)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册