public async Task GenerateBaseline()
        {
            Console.WriteLine(typeof(FactAttribute));

            var text = Resources.ProximityExpressionsGetterTestFile;
            using (var workspace = await CSharpWorkspaceFactory.CreateWorkspaceFromLinesAsync(text))
            {
                var languageDebugInfo = new CSharpLanguageDebugInfoService();

                var hostdoc = workspace.Documents.First();
                var snapshot = hostdoc.TextBuffer.CurrentSnapshot;
                var document = workspace.CurrentSolution.GetDocument(hostdoc.Id);

                var builder = new StringBuilder();
                var statements = (await document.GetSyntaxRootAsync(CancellationToken.None)).DescendantTokens().Select(t => t.GetAncestor<StatementSyntax>()).Distinct().WhereNotNull();

                // Try to get proximity expressions at every token position and the start of every
                // line.
                var index = 0;
                foreach (var statement in statements)
                {
                    builder.AppendLine("[WpfFact, Trait(Traits.Feature, Traits.Features.DebuggingProximityExpressions)]");
                    builder.AppendLine("public void TestAtStartOfStatement_" + index + "()");
                    builder.AppendLine("{");

                    var token = statement.GetFirstToken();
                    var line = snapshot.GetLineFromPosition(token.SpanStart);

                    builder.AppendLine("    //// Line " + (line.LineNumber + 1));
                    builder.AppendLine();
                    if (line.LineNumber > 0)
                    {
                        builder.AppendLine("    //// " + snapshot.GetLineFromLineNumber(line.LineNumber - 1).GetText());
                    }

                    builder.AppendLine("    //// " + line.GetText());
                    var charIndex = token.SpanStart - line.Start;
                    builder.AppendLine("    //// " + new string(' ', charIndex) + "^");
                    builder.AppendLine("    var tree = GetTree(\"ProximityExpressionsGetterTestFile.cs\");");
                    builder.AppendLine("    var terms = CSharpProximityExpressionsService.Do(tree, " + token.SpanStart + ");");

                    var proximityExpressionsGetter = new CSharpProximityExpressionsService();
                    var terms = await proximityExpressionsGetter.GetProximityExpressionsAsync(document, token.SpanStart, CancellationToken.None);
                    if (terms == null)
                    {
                        builder.AppendLine("    Assert.Null(terms);");
                    }
                    else
                    {
                        builder.AppendLine("    Assert.NotNull(terms);");

                        var termsString = terms.Select(t => "\"" + t + "\"").Join(", ");
                        builder.AppendLine("    AssertEx.Equal(new[] { " + termsString + " }, terms);");
                    }

                    builder.AppendLine("}");
                    builder.AppendLine();
                    index++;
                }

                var str = builder.ToString();
                Console.WriteLine(str);
            }
        }
        private async Task TestProximityExpressionGetterAsync(
            string markup,
            Func<CSharpProximityExpressionsService, Document, int, Task> continuation)
        {
            using (var workspace = await CSharpWorkspaceFactory.CreateWorkspaceFromLinesAsync(markup))
            {
                var testDocument = workspace.Documents.Single();
                var caretPosition = testDocument.CursorPosition.Value;
                var snapshot = testDocument.TextBuffer.CurrentSnapshot;
                var languageDebugInfo = new CSharpLanguageDebugInfoService();
                var document = workspace.CurrentSolution.GetDocument(testDocument.Id);

                var proximityExpressionsGetter = new CSharpProximityExpressionsService();

                await continuation(proximityExpressionsGetter, document, caretPosition);
            }
        }