public static List<ITagSpan<IOutliningRegionTag>> ExtractOutliningRegions(IAstRuleReturnScope parseResult, ReadOnlyCollection<IToken> tokens, AlloyOutliningTaggerProvider provider, ITextSnapshot snapshot) { BufferedTreeNodeStream input = new BufferedTreeNodeStream(parseResult.Tree); AlloyOutliningTaggerWalker walker = new AlloyOutliningTaggerWalker(input, tokens, provider, snapshot); walker.compilationUnit(); return walker._outliningRegions; }
public static List <ITagSpan <IOutliningRegionTag> > ExtractOutliningRegions(IAstRuleReturnScope parseResult, ReadOnlyCollection <IToken> tokens, AlloyOutliningTaggerProvider provider, ITextSnapshot snapshot) { BufferedTreeNodeStream input = new BufferedTreeNodeStream(parseResult.Tree); AlloyOutliningTaggerWalker walker = new AlloyOutliningTaggerWalker(input, tokens, provider, snapshot); walker.compilationUnit(); return(walker._outliningRegions); }
private void UpdateTags(AntlrParseResultEventArgs antlrParseResultArgs) { List <ITagSpan <IOutliningRegionTag> > outliningRegions = null; IAstRuleReturnScope parseResult = antlrParseResultArgs.Result as IAstRuleReturnScope; if (parseResult != null) { outliningRegions = AlloyOutliningTaggerWalker.ExtractOutliningRegions(parseResult, antlrParseResultArgs.Tokens, _provider, antlrParseResultArgs.Snapshot); } this._outliningRegions = outliningRegions ?? new List <ITagSpan <IOutliningRegionTag> >(); OnTagsChanged(new SnapshotSpanEventArgs(new SnapshotSpan(antlrParseResultArgs.Snapshot, new Span(0, antlrParseResultArgs.Snapshot.Length)))); }