static IEnumerable <Tag> GetSemanticTags(SyntaxTree unit) { var visitor = new SemanticTagVisitor(); unit.AcceptVisitor(visitor); foreach (var fold in visitor.Tags) { yield return(fold); } }
public override Task <IReadOnlyList <Tag> > GetTagCommentsAsync(CancellationToken cancellationToken = default(CancellationToken)) { if (tags == null) { return(Task.Run(delegate { lock (tagLock) { if (tags == null) { var visitor = new SemanticTagVisitor(cancellationToken); if (Unit != null) { try { visitor.Visit(Unit.GetRoot(cancellationToken)); } catch { } } tags = visitor.Tags; } return tags; } })); } return(Task.FromResult(tags)); }
public override Task<IReadOnlyList<Tag>> GetTagCommentsAsync (CancellationToken cancellationToken = default(CancellationToken)) { if (tags == null) { return Task.Run (delegate { lock (tagLock) { if (tags == null) { var visitor = new SemanticTagVisitor (cancellationToken); if (Unit != null) { try { visitor.Visit (Unit.GetRoot (cancellationToken)); } catch { } } tags = visitor.Tags; } return tags; } }); } return Task.FromResult (tags); }