Beispiel #1
0
        void GetRazorFoldingRegions(List <FoldingRegion> foldingRegions)
        {
            var blocks = new List <Block> ();

            GetBlocks(editorParser.CurrentParseTree, blocks);
            foreach (var block in blocks)
            {
                var beginLine = currentDocument.GetLineByOffset(block.Start.AbsoluteIndex);
                var endLine   = currentDocument.GetLineByOffset(block.Start.AbsoluteIndex + block.Length);
                if (beginLine != endLine)
                {
                    foldingRegions.Add(new FoldingRegion(RazorUtils.GetShortName(block),
                                                         new DomRegion(currentDocument.OffsetToLocation(block.Start.AbsoluteIndex),
                                                                       currentDocument.OffsetToLocation(block.Start.AbsoluteIndex + block.Length))));
                }
            }
        }
Beispiel #2
0
 public OutlineNode(Block block)
 {
     Name = RazorUtils.GetShortName(block);
 }