BuildOutlineRegions() public static method

public static BuildOutlineRegions ( IEditorShell editorShell, string content ) : OutlineRegionCollection
editorShell IEditorShell
content string
return OutlineRegionCollection
Exemplo n.º 1
0
        public void Conditionals()
        {
            var content =
                @"if (ncol(x) == 1L) {
    xnames < -1
} else {
    xnames < -paste0(1, 1L:ncol(x))
  }
  if (intercept) {
    x<- cbind(1, x)
    xnames<- c(0, xnames)
  }
";
            var rc = OutlineTest.BuildOutlineRegions(_services, content);

            rc.Should().HaveCount(3);

            rc[0].Start.Should().Be(0);
            rc[0].Length.Should().Be(89);

            rc[1].Start.Should().Be(41);
            rc[1].End.Should().Be(89);
            rc[1].DisplayText.Should().Be("else...");

            rc[2].Start.Should().Be(93);
            rc[2].End.Should().Be(162);
            rc[2].DisplayText.Should().Be("if...");
        }
Exemplo n.º 2
0
        public void RRegionBuilder_Test02()
        {
            string content =
                @"if (ncol(x) == 1L) {
    xnames < -1
} else {
    xnames < -paste0(1, 1L:ncol(x))
  }
  if (intercept) {
    x<- cbind(1, x)
    xnames<- c(0, xnames)
  }
";
            OutlineRegionCollection rc = OutlineTest.BuildOutlineRegions(content);

            rc.Should().HaveCount(3);

            rc[0].Start.Should().Be(0);
            rc[0].Length.Should().Be(89);

            rc[1].Start.Should().Be(41);
            rc[1].End.Should().Be(89);
            rc[1].DisplayText.Should().Be("else...");

            rc[2].Start.Should().Be(93);
            rc[2].End.Should().Be(162);
            rc[2].DisplayText.Should().Be("if...");
        }
Exemplo n.º 3
0
        public void EmptyTest()
        {
            var rc = OutlineTest.BuildOutlineRegions(_services, "");

            rc.Should().BeEmpty();
            rc.Start.Should().Be(0);
            rc.Length.Should().Be(0);
        }
Exemplo n.º 4
0
        public void RRegionBuilder_Test01()
        {
            OutlineRegionCollection rc = OutlineTest.BuildOutlineRegions("");

            rc.Should().BeEmpty();
            rc.Start.Should().Be(0);
            rc.Length.Should().Be(0);
        }
Exemplo n.º 5
0
        public void EmptyTest()
        {
            OutlineRegionCollection rc = OutlineTest.BuildOutlineRegions(_editorShell, "");

            rc.Should().BeEmpty();
            rc.Start.Should().Be(0);
            rc.Length.Should().Be(0);
        }