Exemplo n.º 1
0
        public static void Annotate(BoundSourceFileBuilder builder, CodexFile file)
        {
            builder.AddClassifications(FilterSpans(file.Spans.Select(span => ToClassification(file.Store, span)).Where(c => c != null)));

            foreach (var reference in FilterSpans(file.Spans.Select(span => ToReference(file.Store, builder, span)).Where(c => c != null)))
            {
                builder.AnnotateReferences(reference.Start, reference.Length, reference.Reference);
            }

            foreach (var definition in FilterSpans(file.Spans.Select(span => ToDefinition(file.Store, builder, span)).Where(c => c != null)))
            {
                builder.AnnotateDefinition(definition.Start, definition.Length, definition.Definition);
            }
        }
Exemplo n.º 2
0
 private static void AnnotateReference(BoundSourceFileBuilder binder, ReferenceSymbol projectFileReference, Microsoft.CodeAnalysis.Text.TextSpan span)
 {
     binder.AnnotateClassification(span.Start, span.Length, ClassificationTypeNames.XmlLiteralAttributeValue);
     binder.AnnotateReferences(span.Start, span.Length, projectFileReference);
 }