943 references to ParseSyntaxTree
InteractiveHost.UnitTests (1)
InteractiveHostDesktopTests.cs (1)
938new[] { SyntaxFactory.ParseSyntaxTree(source) },
Microsoft.Analyzers.Extra.Tests (4)
SyntaxNodeExtensionsTests.cs (4)
47SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 79SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 142SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr); 173SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(codeStr);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (13)
Debugging\ProximityExpressionsGetterTests.cs (2)
39=> SyntaxFactory.ParseSyntaxTree(GetTestFileContent()); 42=> SyntaxFactory.ParseSyntaxTree(code);
Extensions\ContextQuery\AbstractContextTests.cs (3)
39var tree = SyntaxFactory.ParseSyntaxTree(text, options: options); 61var tree = SyntaxFactory.ParseSyntaxTree(text, options: options); 88var tree = SyntaxFactory.ParseSyntaxTree(text, options: options);
Formatting\FormattingEngineTests.cs (1)
2220var tree = SyntaxFactory.ParseSyntaxTree(code, options: TestOptions.Script);
Semantics\SpeculationAnalyzerTests.cs (1)
522=> SyntaxFactory.ParseSyntaxTree(text);
SymbolKey\SymbolKeyCompilationsTests.cs (6)
330var originalComp = CreateCompilation([SyntaxFactory.ParseSyntaxTree(src1, path: "file1.cs"), SyntaxFactory.ParseSyntaxTree(src1, path: "file2.cs")], assemblyName: "Test"); 331var newComp = CreateCompilation([SyntaxFactory.ParseSyntaxTree(src1, path: "file1.cs"), SyntaxFactory.ParseSyntaxTree(src1, path: "file2.cs")], assemblyName: "Test"); 344var src1 = SyntaxFactory.ParseSyntaxTree(""" 353var src2 = SyntaxFactory.ParseSyntaxTree("""
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
Recommendations\RecommenderTests.cs (1)
63var tree = SyntaxFactory.ParseSyntaxTree(text, options: options);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (34)
BreakingChanges.cs (2)
26SyntaxFactory.ParseSyntaxTree(test).GetDiagnostics().Verify(Diagnostic(ErrorCode.ERR_PPDirectiveExpected, @"de\u0066in\U00000065")); 279SyntaxFactory.ParseSyntaxTree(test).GetDiagnostics().Verify(Diagnostic(ErrorCode.ERR_GlobalAttributesNotFirst, "assembly"));
CodeGen\CodeGenAsyncTests.cs (3)
4542var s0 = CSharpCompilation.CreateScriptCompilation("s0.dll", SyntaxFactory.ParseSyntaxTree(source0, options: TestOptions.Script), references); 4543var s1 = CSharpCompilation.CreateScriptCompilation("s1.dll", SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.Script), references, previousScriptCompilation: s0); 4553var s0 = CSharpCompilation.CreateScriptCompilation("s0.dll", SyntaxFactory.ParseSyntaxTree(source0, options: TestOptions.Script), references);
CodeGen\CodeGenFieldInitTests.cs (1)
654trees.Add(SyntaxFactory.ParseSyntaxTree("System.Console.WriteLine(" + i + ");", options: TestOptions.Script));
CodeGen\CodeGenScriptTests.cs (10)
25var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 44var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 62var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 88var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 113var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 138var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 169var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 197var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 555SyntaxFactory.ParseSyntaxTree(source0, options: TestOptions.Script), 636var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script);
CodeGen\CodeGenTupleTest.cs (1)
24009var tree = SyntaxFactory.ParseSyntaxTree(text, CSharpParseOptions.Default);
CodeGen\GotoTest.cs (4)
1000var s0 = CSharpCompilation.CreateScriptCompilation("s0.dll", SyntaxFactory.ParseSyntaxTree(source0, options: TestOptions.Script), references); 1002var s1 = CSharpCompilation.CreateScriptCompilation("s1.dll", SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.Script), references, previousScriptCompilation: s0); 1111var s0 = CSharpCompilation.CreateScriptCompilation("s0.dll", SyntaxFactory.ParseSyntaxTree(source0, options: TestOptions.Script), references); 1113var s1 = CSharpCompilation.CreateScriptCompilation("s1.dll", SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.Script), references, previousScriptCompilation: s0);
Emit\CompilationEmitTests.cs (1)
4046syntaxTrees: [SyntaxFactory.ParseSyntaxTree("class A { }")],
Emit\EmitMetadataTests.cs (2)
2230var syntax = SyntaxFactory.ParseSyntaxTree(@"class C {}", TestOptions.Regular.WithNoRefSafetyRulesAttribute()); 2419var syntax = SyntaxFactory.ParseSyntaxTree(@"class C { static void Main() { } }", TestOptions.Regular.WithNoRefSafetyRulesAttribute());
Emit\EntryPointTests.cs (9)
374SyntaxFactory.ParseSyntaxTree(csx, options: TestOptions.Script), 395SyntaxFactory.ParseSyntaxTree(csx, options: TestOptions.Script), 726new[] { SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Script) }, 749SyntaxFactory.ParseSyntaxTree(csx, options: TestOptions.Script), 750SyntaxFactory.ParseSyntaxTree(cs, options: TestOptions.Regular) 783SyntaxFactory.ParseSyntaxTree(csx, options: TestOptions.Script), 784SyntaxFactory.ParseSyntaxTree(cs, options: TestOptions.Regular) 930SyntaxFactory.ParseSyntaxTree(csx, options: TestOptions.Script), 931SyntaxFactory.ParseSyntaxTree(cs, options: TestOptions.Regular),
Emit\ResourceTests.cs (1)
448var sourceTree = SyntaxFactory.ParseSyntaxTree("");
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (8)
PDB\PDBTests.cs (7)
45var tree1 = SyntaxFactory.ParseSyntaxTree("class A { }", encoding: null, path: "Foo.cs"); 46var tree2 = SyntaxFactory.ParseSyntaxTree("class B { }", encoding: null, path: ""); 48var tree4 = SyntaxFactory.ParseSyntaxTree("class D { }", encoding: Encoding.UTF8, path: "Baz.cs"); 65var tree1 = SyntaxFactory.ParseSyntaxTree("class A { public void F() { } }", encoding: Encoding.Unicode, path: "Foo.cs"); 66var tree2 = SyntaxFactory.ParseSyntaxTree("class B { public void F() { } }", encoding: null, path: ""); 67var tree3 = SyntaxFactory.ParseSyntaxTree("class C { public void F() { } }", encoding: new UTF8Encoding(true, false), path: "Bar.cs"); 12307var tree = SyntaxFactory.ParseSyntaxTree(source, encoding: Encoding.UTF8, path: "HIDDEN.cs");
PDB\TypeDefinitionDocumentTests.cs (1)
463var trees = sources.Select((s, i) => SyntaxFactory.ParseSyntaxTree(s, path: $"{i + 1}.cs", encoding: Encoding.UTF8)).ToArray();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (21)
Attributes\AttributeTests.cs (1)
4889SyntaxFactory.ParseSyntaxTree(
Attributes\AttributeTests_CallerInfoAttributes.cs (16)
4169SyntaxFactory.ParseSyntaxTree(source1, path: @"C:\filename", encoding: Encoding.UTF8), 4170SyntaxFactory.ParseSyntaxTree(source2, path: @"a\b\..\c\d", encoding: Encoding.UTF8), 4171SyntaxFactory.ParseSyntaxTree(source3, path: @"*", encoding: Encoding.UTF8), 4172SyntaxFactory.ParseSyntaxTree(source4, path: @" ", encoding: Encoding.UTF8), 4211SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.Regular9, path: @"C:\filename", encoding: Encoding.UTF8) 4264SyntaxFactory.ParseSyntaxTree(source1, path: @"C:\filename", encoding: Encoding.UTF8), 4265SyntaxFactory.ParseSyntaxTree(source2, path: @"a\b\..\c\d.cs", encoding: Encoding.UTF8), 4266SyntaxFactory.ParseSyntaxTree(source3, path: @"*", encoding: Encoding.UTF8), 4267SyntaxFactory.ParseSyntaxTree(source4, path: @"C:\x.cs", encoding: Encoding.UTF8), 4268SyntaxFactory.ParseSyntaxTree(source5, path: @"C:\x.cs", encoding: Encoding.UTF8), 5171new[] { SyntaxFactory.ParseSyntaxTree(source, path: @"C:\filename", encoding: Encoding.UTF8) }, 5222new[] { SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular7, path: @"C:\filename", encoding: Encoding.UTF8) }, 5292var compilation = CreateCompilationWithMscorlib461(new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular7, path: @"C:\filename") }).VerifyDiagnostics( 5555new[] { SyntaxFactory.ParseSyntaxTree(source, path: @"C:\filename", encoding: Encoding.UTF8) }, 5615new[] { SyntaxFactory.ParseSyntaxTree(source, path: @"C:\filename", encoding: Encoding.UTF8) }, 5670new[] { SyntaxFactory.ParseSyntaxTree(csSource, path: @"C:\filename", encoding: Encoding.UTF8) },
FieldKeywordTests.cs (2)
10492var modifiedTree = SyntaxFactory.ParseSyntaxTree(source.Replace("return null;", "return field;"), parseOptions); 10526var modifiedTree = SyntaxFactory.ParseSyntaxTree(source.Replace("return null;", "return field;"), parseOptions);
FlowAnalysis\IterationJumpYieldStatementTests.cs (1)
900var tree = SyntaxFactory.ParseSyntaxTree(@"
FlowAnalysis\RegionAnalysisTests.cs (1)
5483var tree = SyntaxFactory.ParseSyntaxTree(source);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (11)
EditAndContinue\BreakpointSpansTests.cs (2)
39var tree = SyntaxFactory.ParseSyntaxTree(source, options); 75var tree = SyntaxFactory.ParseSyntaxTree(source);
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (1)
50var tree = SyntaxFactory.ParseSyntaxTree(source);
EditAndContinue\SyntaxUtilitiesTests.cs (8)
21var oldRoot = SyntaxFactory.ParseSyntaxTree(oldSource).GetRoot(); 22var newRoot = SyntaxFactory.ParseSyntaxTree(newSource).GetRoot(); 73var leftRoot = SyntaxFactory.ParseSyntaxTree(@" 88var rightRoot = SyntaxFactory.ParseSyntaxTree(@" 116var leftRoot = SyntaxFactory.ParseSyntaxTree(@" 135var rightRoot = SyntaxFactory.ParseSyntaxTree(@" 164var tree = SyntaxFactory.ParseSyntaxTree(@" 225var tree = SyntaxFactory.ParseSyntaxTree(@"
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (2)
InteractiveSessionReferencesTests.cs (2)
528new[] { SyntaxFactory.ParseSyntaxTree("public class C {}") }, 1116new[] { SyntaxFactory.ParseSyntaxTree(source) },
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (91)
Semantics\BindingAsyncTests.cs (3)
53var tree = SyntaxFactory.ParseSyntaxTree(source); 82var tree = SyntaxFactory.ParseSyntaxTree(source); 3163syntaxTree: SyntaxFactory.ParseSyntaxTree(source0, options: TestOptions.Script),
Semantics\BindingAwaitTests.cs (1)
26var tree = SyntaxFactory.ParseSyntaxTree(" class C { void M() { await X() on ");
Semantics\ConstantTests.cs (3)
2907var tree = SyntaxFactory.ParseSyntaxTree(@" 2934var tree = SyntaxFactory.ParseSyntaxTree(@" 2962var tree = SyntaxFactory.ParseSyntaxTree(@"
Semantics\InterpolationTests.cs (12)
533Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 534Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 535Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 536Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 537Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 538Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 539Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 540Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 558Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 576Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 595Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 1489Assert.True(SyntaxFactory.ParseSyntaxTree(text).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
Semantics\LambdaTests.cs (7)
837var tree = SyntaxFactory.ParseSyntaxTree(source); 1169var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular9); 1202var tree = SyntaxFactory.ParseSyntaxTree(source); 1234var tree = SyntaxFactory.ParseSyntaxTree(source); 2994var tree = SyntaxFactory.ParseSyntaxTree(source); 3036var tree = SyntaxFactory.ParseSyntaxTree(source); 3985var newTree = SyntaxFactory.ParseSyntaxTree(source + " ");
Semantics\LocalFunctionTests.cs (9)
343var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Regular9); 347var newTree = SyntaxFactory.ParseSyntaxTree(text + " "); 391var tree = SyntaxFactory.ParseSyntaxTree(text); 403var newTree = SyntaxFactory.ParseSyntaxTree(text + " "); 438var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Regular9); 443var newTree = SyntaxFactory.ParseSyntaxTree(text + " ", options: TestOptions.Regular9); 1679var tree = SyntaxFactory.ParseSyntaxTree(@" 1889var tree = SyntaxFactory.ParseSyntaxTree(@" 1945var tree = SyntaxFactory.ParseSyntaxTree(@"
Semantics\NameOfTests.cs (4)
975var tree2 = SyntaxFactory.ParseSyntaxTree(source + " "); 1047var tree2 = SyntaxFactory.ParseSyntaxTree(source + " "); 1129var tree2 = SyntaxFactory.ParseSyntaxTree(source + " "); 1210var tree2 = SyntaxFactory.ParseSyntaxTree(source + " ");
Semantics\RawInterpolationTests.cs (8)
559Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 560Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 561Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 562Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 580Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 598Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 617Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 1163Assert.True(SyntaxFactory.ParseSyntaxTree(text).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
Semantics\RefEscapingTests.cs (18)
23var tree = SyntaxFactory.ParseSyntaxTree(@" 2612var tree = SyntaxFactory.ParseSyntaxTree(""" 2647var tree = SyntaxFactory.ParseSyntaxTree(""" 2676var tree = SyntaxFactory.ParseSyntaxTree(""" 2871var tree = SyntaxFactory.ParseSyntaxTree(""" 2928var tree = SyntaxFactory.ParseSyntaxTree(""" 2968var tree = SyntaxFactory.ParseSyntaxTree(""" 3178var tree = SyntaxFactory.ParseSyntaxTree(""" 3206var tree = SyntaxFactory.ParseSyntaxTree(""" 3288var tree = SyntaxFactory.ParseSyntaxTree(""" 3375var tree = SyntaxFactory.ParseSyntaxTree(""" 3752var tree = SyntaxFactory.ParseSyntaxTree(""" 3797var tree = SyntaxFactory.ParseSyntaxTree(""" 3900var tree = SyntaxFactory.ParseSyntaxTree(""" 4135var tree = SyntaxFactory.ParseSyntaxTree(""" 6262var tree = SyntaxFactory.ParseSyntaxTree(""" 9734var tree = SyntaxFactory.ParseSyntaxTree(""" 9770var tree = SyntaxFactory.ParseSyntaxTree("""
Semantics\RefLocalsAndReturnsTests.cs (2)
539var tree = SyntaxFactory.ParseSyntaxTree(@" 1083var tree = SyntaxFactory.ParseSyntaxTree(@"
Semantics\ScriptSemanticsTests.cs (15)
263var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script); 286var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script); 298var submission = CSharpCompilation.CreateScriptCompilation("test", syntaxTree: SyntaxFactory.ParseSyntaxTree("1", options: TestOptions.Script), returnType: typeof(int)); 365var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 396var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 443var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script); 485var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp6)); 1207syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1216syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1225syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1237syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1249syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1269var syntaxTree2 = SyntaxFactory.ParseSyntaxTree("System.Console.WriteLine(2);", options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1336syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1351syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script));
Semantics\SemanticErrorTests.cs (1)
1385new[] { SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script) });
Semantics\SuppressAccessibilityChecksTests.cs (1)
119var tree = SyntaxFactory.ParseSyntaxTree(source);
Semantics\SwitchTests.cs (2)
1147var syntaxTree = SyntaxFactory.ParseSyntaxTree(source); 2419syntaxTree: SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Script),
Semantics\SyntaxTreeRootTests.cs (3)
42var tree = SyntaxFactory.ParseSyntaxTree(@"class Program { static void Main() { System.Console.WriteLine(""Wah""); } }"); 61var parsedTree = SyntaxFactory.ParseSyntaxTree(""); 107var tree = SyntaxFactory.ParseSyntaxTree("class TheClass { }");
Semantics\UnsafeTests.cs (2)
6270var tree = SyntaxFactory.ParseSyntaxTree(@" 6366var tree = SyntaxFactory.ParseSyntaxTree(code, TestOptions.Regular);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (201)
Compilation\CompilationAPITests.cs (46)
70var tree = SyntaxFactory.ParseSyntaxTree("class C { long _f = 0l;}"); 90var tree = SyntaxFactory.ParseSyntaxTree("class C { long _f = 0l;}"); 112var tree = SyntaxFactory.ParseSyntaxTree(@" 138var tree = SyntaxFactory.ParseSyntaxTree("class C { long _f = 0l; }"); 165var tree = SyntaxFactory.ParseSyntaxTree(@" class C { long _f = 0l; }"); 166var newTree = SyntaxFactory.ParseSyntaxTree(@" class D { long _f = 0l; }"); 191var tree = SyntaxFactory.ParseSyntaxTree(@" class C { long _f = 0l; }"); 353SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree(s1); 386new[] { SyntaxFactory.ParseSyntaxTree("class C { static void Main() {} }") }, 614syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree("public class C {}") }, 622syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 633syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 646syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 682syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree("public class C {}", options: TestOptions.Regular.WithLanguageVersion(LanguageVersion.CSharp6)) }, 690syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 701syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 714syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree( 783SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree(s1); 784SyntaxTree withErrorTree = SyntaxFactory.ParseSyntaxTree(s2); 785SyntaxTree withErrorTree1 = SyntaxFactory.ParseSyntaxTree(s3); 786SyntaxTree withErrorTreeVB = SyntaxFactory.ParseSyntaxTree(s4); 788var withWarning = SyntaxFactory.ParseSyntaxTree(s5); 791var comp = CSharpCompilation.Create("Compilation", syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(s1) }, options: TestOptions.ReleaseDll); 805Assert.False(comp.SyntaxTrees.Contains(SyntaxFactory.ParseSyntaxTree(s1))); 807comp = comp.AddSyntaxTrees(SyntaxFactory.ParseSyntaxTree(s1)); 811comp = comp.ReplaceSyntaxTree(t1, SyntaxFactory.ParseSyntaxTree(s1)); 825Assert.Throws<ArgumentException>(() => comp = comp.RemoveSyntaxTrees(SyntaxFactory.ParseSyntaxTree(s1))); 840SyntaxTree t4 = SyntaxFactory.ParseSyntaxTree("Using System;"); 841SyntaxTree t5 = SyntaxFactory.ParseSyntaxTree("Usingsssssssssssss System;"); 842SyntaxTree t6 = SyntaxFactory.ParseSyntaxTree("Import System;"); 929SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree(s1); 930SyntaxTree t2 = SyntaxFactory.ParseSyntaxTree(s2); 931SyntaxTree t3 = SyntaxFactory.ParseSyntaxTree(s3); 1177var comp1 = CSharpCompilation.Create("Test1", new[] { SyntaxFactory.ParseSyntaxTree(text1) }); 1178var comp2 = CSharpCompilation.Create("Test2", new[] { SyntaxFactory.ParseSyntaxTree(text1) }); 1191new[] { SyntaxFactory.ParseSyntaxTree(text1) }, 1481SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree("Using System;"); 1489Assert.Throws<ArgumentException>(() => comp.ReplaceSyntaxTree(newTree: SyntaxFactory.ParseSyntaxTree("Using System;"), oldTree: t1)); 1541SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree("Using System;"); 1545comp = comp.ReplaceSyntaxTree(newTree: SyntaxFactory.ParseSyntaxTree("Using System;"), oldTree: t1); 1555SyntaxTree t1 = SyntaxFactory.ParseSyntaxTree("Using System;"); 1564SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("Using Goo;"); 1619SyntaxTree t4 = SyntaxFactory.ParseSyntaxTree(s1); 2379var tree1 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 2380var tree2 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 2381var tree3 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5));
Compilation\ReferenceManagerTests.cs (1)
1019new[] { SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Regular) },
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (3)
2750var tree = SyntaxFactory.ParseSyntaxTree(test, options: new CSharpParseOptions(languageVersion: LanguageVersion.CSharp6)); 3104new[] { SyntaxFactory.ParseSyntaxTree(text2) }, 3959var tree2 = SyntaxFactory.ParseSyntaxTree(@"
DeclarationTests.cs (31)
57var tree1 = SyntaxFactory.ParseSyntaxTree(text1); 58var tree2 = SyntaxFactory.ParseSyntaxTree(text2); 226var tree1 = SyntaxFactory.ParseSyntaxTree(text1); 227var tree2 = SyntaxFactory.ParseSyntaxTree(text2); 262new[] { SyntaxFactory.ParseSyntaxTree(code) }, 271var underlyingTree = SyntaxFactory.ParseSyntaxTree(@" 280var foreignType = SyntaxFactory.ParseSyntaxTree(@" 318var underlyingTree = SyntaxFactory.ParseSyntaxTree(@" 327var foreignType = SyntaxFactory.ParseSyntaxTree(@" 361var firstTree = SyntaxFactory.ParseSyntaxTree(@" 375var secondTree = SyntaxFactory.ParseSyntaxTree(@" 389var thirdTree = SyntaxFactory.ParseSyntaxTree(@" 428var firstTree = SyntaxFactory.ParseSyntaxTree(@" 442var secondTree = SyntaxFactory.ParseSyntaxTree(@" 474var firstTree = SyntaxFactory.ParseSyntaxTree(@" 488var secondTree = SyntaxFactory.ParseSyntaxTree(@" 517var firstTree = SyntaxFactory.ParseSyntaxTree(@" 536var secondTree = SyntaxFactory.ParseSyntaxTree(@" 577var firstTree = SyntaxFactory.ParseSyntaxTree(@" 596var secondTree = SyntaxFactory.ParseSyntaxTree(@" 631var firstTree = SyntaxFactory.ParseSyntaxTree(@" 645var secondTree = SyntaxFactory.ParseSyntaxTree(@" 674var firstTree = SyntaxFactory.ParseSyntaxTree(@" 688var secondTree = SyntaxFactory.ParseSyntaxTree(@" 717var firstTree = SyntaxFactory.ParseSyntaxTree(@" 733var secondTree = SyntaxFactory.ParseSyntaxTree(@" 764var firstTree = SyntaxFactory.ParseSyntaxTree(@" 780var secondTree = SyntaxFactory.ParseSyntaxTree(@" 809var firstTree = SyntaxFactory.ParseSyntaxTree(@" 823var secondTree = SyntaxFactory.ParseSyntaxTree(@" 854var firstTree = SyntaxFactory.ParseSyntaxTree(@"
DocumentationComments\DocumentationCommentCompilerTests.cs (51)
759var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 760var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 887var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 888var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 926var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularWithDocumentationComments); 968var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 969var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1017var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1018var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1068var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1069var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1118var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1119var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1173var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1174var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1221var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1222var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1276var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1277var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1333var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1334var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1396var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1397var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1459var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 1460var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments); 1512var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularWithDocumentationComments); 1555var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1556var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1606var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1607var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1650var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularWithDocumentationComments); 1693var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1694var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1745var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1746var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1796var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1797var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1852var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1853var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1901var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1902var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 1957var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 1958var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 2015var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 2016var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 2079var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 2080var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 2143var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreviewWithDocumentationComments); 2144var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularPreviewWithDocumentationComments); 5318var tree1 = SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularWithDocumentationComments); 5319var tree2 = SyntaxFactory.ParseSyntaxTree(source2, options: TestOptions.RegularWithDocumentationComments);
SymbolDisplay\SymbolDisplayTests.cs (9)
3023var tree = SyntaxFactory.ParseSyntaxTree(text, TestOptions.Script); 6597var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6640var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6671var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6735var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6766var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6829var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6862var srcTree = SyntaxFactory.ParseSyntaxTree(@" 6907var srcTree = SyntaxFactory.ParseSyntaxTree(@"
Symbols\AnonymousTypesSymbolTests.cs (2)
1637var tree = SyntaxFactory.ParseSyntaxTree(source); 1678var tree = SyntaxFactory.ParseSyntaxTree(source);
Symbols\AssemblyAndNamespaceTests.cs (9)
118syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text) }, references: new MetadataReference[] { }); 122syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1), SyntaxFactory.ParseSyntaxTree(text2) }, 165syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1), SyntaxFactory.ParseSyntaxTree(text2) }, 251var comp1 = CSharpCompilation.Create(assemblyName: "Test1", options: TestOptions.DebugExe, syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1) }, references: new MetadataReference[] { }); 252var comp2 = CSharpCompilation.Create(assemblyName: "Test2", options: TestOptions.DebugExe, syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text2) }, references: new MetadataReference[] { }); 258syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text3) }, 300syntaxTrees: new SyntaxTree[] { SyntaxFactory.ParseSyntaxTree(text1) },
Symbols\CompilationCreationTests.cs (11)
32return SyntaxFactory.ParseSyntaxTree(text, path: path); 2684SyntaxFactory.ParseSyntaxTree($@" 2690SyntaxFactory.ParseSyntaxTree(@" 2694SyntaxFactory.ParseSyntaxTree(@" 2727SyntaxFactory.ParseSyntaxTree(@" 2732SyntaxFactory.ParseSyntaxTree(@" 2793new[] { SyntaxFactory.ParseSyntaxTree(@"#r ""bar""", TestOptions.Script, "a.csx", Encoding.UTF8) }, 2807SyntaxFactory.ParseSyntaxTree(@" 2811SyntaxFactory.ParseSyntaxTree(@" 2835SyntaxFactory.ParseSyntaxTree(@" 2861var st = SyntaxFactory.ParseSyntaxTree("class C { static void Main() { new lib.Class1(); } }");
Symbols\ConversionTests.cs (1)
385var tree = SyntaxFactory.ParseSyntaxTree(source);
Symbols\ExtensionMethodTests.cs (3)
2423var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script.WithLanguageVersion(LanguageVersion.CSharp6)); 3820syntaxTree: SyntaxFactory.ParseSyntaxTree(source0, options: parseOptions), 3826syntaxTree: SyntaxFactory.ParseSyntaxTree(source1, options: parseOptions),
Symbols\Metadata\MetadataTypeTests.cs (1)
357var tree = SyntaxFactory.ParseSyntaxTree(String.Empty);
Symbols\Source\ClsComplianceTests.cs (2)
3497var tree1 = SyntaxFactory.ParseSyntaxTree(string.Format(sourceTemplate, 1), parseOptions, path: "a.cs"); 3498var tree2 = SyntaxFactory.ParseSyntaxTree(string.Format(sourceTemplate, 2), parseOptions, path: "b.cs");
Symbols\Source\DelegateTests.cs (1)
822var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular);
Symbols\Source\ExternAliasTests.cs (1)
112syntaxTree: SyntaxFactory.ParseSyntaxTree(src, options: TestOptions.Script),
Symbols\Source\FileModifierTests.cs (18)
730var verifier = CompileAndVerify(SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularPreview, path: "path/to/MyFile.cs", encoding: Encoding.Default), expectedOutput: "1", symbolValidator: symbolValidator); 773var verifier = CompileAndVerify(SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularPreview, path: "path/to/My<>File.cs", encoding: Encoding.Default), expectedOutput: "1", symbolValidator: symbolValidator); 804var verifier = CompileAndVerify(SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularPreview, path: "path/to/MyGeneratedFile.g.cs", encoding: Encoding.Default), expectedOutput: "1", symbolValidator: symbolValidator); 865var source1 = SyntaxFactory.ParseSyntaxTree(""" 875var source2 = SyntaxFactory.ParseSyntaxTree("", options: TestOptions.RegularPreview, path: path, encoding: Encoding.Default); 900var source1 = SyntaxFactory.ParseSyntaxTree(""" 910var source2 = SyntaxFactory.ParseSyntaxTree(""" 947var source1 = SyntaxFactory.ParseSyntaxTree(""" 957var source2 = SyntaxFactory.ParseSyntaxTree("", options: TestOptions.RegularPreview, path: path, encoding: Encoding.Default); 981var source1 = SyntaxFactory.ParseSyntaxTree(""" 991var source2 = SyntaxFactory.ParseSyntaxTree("", options: TestOptions.RegularPreview, path: "path/to/File.cs", encoding: Encoding.Default); 1086var comp = CreateCompilation(SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularPreview, path: $"path/to/My{badChar}File.cs", encoding: Encoding.Default)); 1113var comp = CreateCompilation(SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreview, path: "\uD800.cs")); 1148var verifier = CompileAndVerify(SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.RegularPreview, path: "path/to/My+File.cs", encoding: Encoding.Default), expectedOutput: "1", symbolValidator: validateSymbols); 4061SyntaxFactory.ParseSyntaxTree(source1, TestOptions.RegularPreview), 4062SyntaxFactory.ParseSyntaxTree(source2, TestOptions.RegularPreview, path: "path/to/FileB.cs") 4330var comp = CreateCompilation(SyntaxFactory.ParseSyntaxTree(source1, options: TestOptions.RegularPreview, path: "path/to/SomeFile.cs")); 4584var tree = SyntaxFactory.ParseSyntaxTree("""
Symbols\Source\PropertyTests.cs (2)
2606syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(refSrc) }, 2698syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(refSrc) },
Symbols\SymbolErrorTests.cs (1)
20480var submission = CSharpCompilation.CreateScriptCompilation("s0.dll", SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Script), new[] { MscorlibRef_v4_0_30316_17626, SystemCoreRef });
Symbols\TypeResolutionTests.cs (5)
65syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(source2) }, 119syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree("class C { }") }, 168var c1 = CSharpCompilation.Create("Asm1", syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(code) }); 169var c2 = CSharpCompilation.Create("Asm2", syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(code) }); 184syntaxTrees: new[] { SyntaxFactory.ParseSyntaxTree(code) });
Symbols\TypeTests.cs (3)
901var tree = SyntaxFactory.ParseSyntaxTree(text); 1675var tree = SyntaxFactory.ParseSyntaxTree(text); 1759var tree = SyntaxFactory.ParseSyntaxTree(text);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (503)
Diagnostics\DiagnosticTest.cs (3)
2353SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text, path: "goo.cs"); 2382SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text, path: "goo.cs"); 2400SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text, path: "goo.cs");
Diagnostics\LineSpanDirectiveTests.cs (8)
41var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "b.cs"); 87var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "b.cs"); 134var tree = SyntaxFactory.ParseSyntaxTree(source); 183var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "b.cs"); 233var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "page.razor.g.cs"); 301var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "page.razor.g.cs"); 353var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "page.razor.g.cs"); 411var treeB = SyntaxFactory.ParseSyntaxTree(sourceB, path: "a.razor.g.cs");
Diagnostics\LocationsTests.cs (20)
87SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 144SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "goo.cs"); 182SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 198AssertMappedSpanEqual(SyntaxFactory.ParseSyntaxTree(sampleProgram, path: ""), "class X {}", "", 19, 0, 19, 10, hasMappedPath: false); 199AssertMappedSpanEqual(SyntaxFactory.ParseSyntaxTree(sampleProgram, path: " "), "class X {}", " ", 19, 0, 19, 10, hasMappedPath: false); 214SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "filename.cs"); 235SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 251var syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 265var syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 285var syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 309SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 329syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 349syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 372SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 394SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 410SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram); 427SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram); 428SyntaxTree tree2 = SyntaxFactory.ParseSyntaxTree(sampleProgram); 454SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram, path: "c:\\goo.cs"); 488SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(sampleProgram);
IncrementalParsing\BinaryExpression.cs (2)
29var oldTree = SyntaxFactory.ParseSyntaxTree(text); 197var oldTree = SyntaxFactory.ParseSyntaxTree(topLevel ? topLevelStatement : code, options: options);
IncrementalParsing\ChangingAsync.cs (1)
67var oldTree = SyntaxFactory.ParseSyntaxTree(text);
IncrementalParsing\ChangingIdentifiers.cs (1)
264var oldTree = SyntaxFactory.ParseSyntaxTree(code, options: options);
IncrementalParsing\CompoundAssignment.cs (1)
103var oldTree = SyntaxFactory.ParseSyntaxTree(topLevel ? topLevelStatement : code, options: options);
IncrementalParsing\GrammarAmbiguities.cs (1)
90var originalTree = SyntaxFactory.ParseSyntaxTree(code);
IncrementalParsing\IncrementalParsingTests.cs (67)
436var oldTree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script); 460var oldTree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Script); 490var tree = SyntaxFactory.ParseSyntaxTree(source); 500var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 522var tree = SyntaxFactory.ParseSyntaxTree(source); 532var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 562var tree = SyntaxFactory.ParseSyntaxTree(source); 579var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 613var initialTree = SyntaxFactory.ParseSyntaxTree(initialSource); 843var fullTree = SyntaxFactory.ParseSyntaxTree(withCloseBraceDeletedText.ToString()); 913var startTree = SyntaxFactory.ParseSyntaxTree(text); 1444var oldTree = SyntaxFactory.ParseSyntaxTree(oldText); 1458SyntaxTree origTree = SyntaxFactory.ParseSyntaxTree(oldText); 1466SyntaxTree fullTree = SyntaxFactory.ParseSyntaxTree(newText); 2896var comp = CSharpTestBase.CreateCompilation(SyntaxFactory.ParseSyntaxTree(String.Empty)); 2906var fullTree = SyntaxFactory.ParseSyntaxTree(newIText.ToString(), options: newTree.Options); 2920fullTree = SyntaxFactory.ParseSyntaxTree(newIText.ToString(), options: newTree.Options); 2976var currTree = SyntaxFactory.ParseSyntaxTree(text); 2990var fullTree = SyntaxFactory.ParseSyntaxTree(currIText.ToString()); 3016var currTree = SyntaxFactory.ParseSyntaxTree(text); 3026var fullTree = SyntaxFactory.ParseSyntaxTree(currIText.ToString()); 3044var oldTree = SyntaxFactory.ParseSyntaxTree(text); 3053var tempTree = SyntaxFactory.ParseSyntaxTree(text); 3196var tree = SyntaxFactory.ParseSyntaxTree(source); 3202var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3217var tree = SyntaxFactory.ParseSyntaxTree(src); 3223var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3238var tree = SyntaxFactory.ParseSyntaxTree(source); 3244var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3259var tree = SyntaxFactory.ParseSyntaxTree(source); 3265var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3280var tree = SyntaxFactory.ParseSyntaxTree(source); 3286var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3301var tree = SyntaxFactory.ParseSyntaxTree(source); 3308var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3325var tree = SyntaxFactory.ParseSyntaxTree(source); 3332var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3349var tree = SyntaxFactory.ParseSyntaxTree(source); 3356var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3373var tree = SyntaxFactory.ParseSyntaxTree(source); 3380var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3397var tree = SyntaxFactory.ParseSyntaxTree(source); 3404var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3421var tree = SyntaxFactory.ParseSyntaxTree(source); 3428var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3447var tree = SyntaxFactory.ParseSyntaxTree(source); 3454var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3473var tree = SyntaxFactory.ParseSyntaxTree(source); 3479var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3498var tree = SyntaxFactory.ParseSyntaxTree(source); 3505var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3524var tree = SyntaxFactory.ParseSyntaxTree(source); 3531var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3542var tree = SyntaxFactory.ParseSyntaxTree(source); 3549var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3560var tree = SyntaxFactory.ParseSyntaxTree(source); 3567var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3578var tree = SyntaxFactory.ParseSyntaxTree(source); 3585var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3593var tree = SyntaxFactory.ParseSyntaxTree(source); 3599var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3607var tree = SyntaxFactory.ParseSyntaxTree(source); 3613var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3621var tree = SyntaxFactory.ParseSyntaxTree(source); 3628var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString()); 3659var tree = SyntaxFactory.ParseSyntaxTree(source); 3665var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString());
IncrementalParsing\TypeChanges.cs (1)
155var oldTree = SyntaxFactory.ParseSyntaxTree(text);
IncrementalParsing\UnaryExpression.cs (1)
79var oldTree = SyntaxFactory.ParseSyntaxTree(topLevel ? topLevelStatement : code, options: options);
LexicalAndXml\PreprocessorTests.cs (2)
3213var tree = SyntaxFactory.ParseSyntaxTree(text, path: compilationFileName); 3874var tree = SyntaxFactory.ParseSyntaxTree(text);
Parsing\AsyncParsingTests.cs (1)
21return SyntaxFactory.ParseSyntaxTree(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp5));
Parsing\AsyncStreamsParsingTests.cs (1)
22return SyntaxFactory.ParseSyntaxTree(text, options: (options ?? TestOptions.Regular).WithLanguageVersion(LanguageVersion.CSharp8));
Parsing\AwaitParsingTests.cs (1)
19return SyntaxFactory.ParseSyntaxTree(text);
Parsing\DeclarationParsingTests.cs (1)
25return SyntaxFactory.ParseSyntaxTree(text, options ?? TestOptions.Regular);
Parsing\DeconstructionTests.cs (1)
34return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\ExpressionParsingTests.cs (2)
22return SyntaxFactory.ParseSyntaxTree(text, options: options); 3135var root = SyntaxFactory.ParseSyntaxTree(text).GetRoot();
Parsing\FileModifierParsingTests.cs (1)
20return SyntaxFactory.ParseSyntaxTree(text, options ?? TestOptions.Regular);
Parsing\LambdaAttributeParsingTests.cs (1)
24return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\LambdaParameterParsingTests.cs (1)
22return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\LambdaReturnTypeParsingTests.cs (1)
18return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\LineSpanDirectiveParsingTests.cs (1)
20return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\ParserErrorMessageTests.cs (51)
5439var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5442tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)); 5461var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5464tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5526var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5529tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5545var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5548tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5588var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5591tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5623var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5626tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5657var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5660tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5694var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 5946var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5964var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5977var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5985tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)); 6006var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6013tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)); 6036var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6049tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)); 6078var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6091tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)); 6148SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)).GetDiagnostics().Verify(); 6149SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6160SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6161SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6184SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6185SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6215SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)).GetDiagnostics().Verify(); 6216SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6243SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6244SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6271SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6272SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6285SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6286SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify( 6304SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6305SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify( 6328SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6329SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify( 6348SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6349SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.RegularWithDocumentationComments.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6365var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6380SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6381SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6475SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)).GetDiagnostics().Verify(); 6477SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).GetDiagnostics().Verify(); 6627SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Verify(
Parsing\ParserRegressionTests.cs (8)
25return SyntaxFactory.ParseSyntaxTree(text, options ?? TestOptions.Regular); 88var tree = SyntaxFactory.ParseSyntaxTree(test); 97var tree = SyntaxFactory.ParseSyntaxTree(test); 107var tree = SyntaxFactory.ParseSyntaxTree(test); 117var tree = SyntaxFactory.ParseSyntaxTree(test); 127var tree = SyntaxFactory.ParseSyntaxTree(test); 137var tree = SyntaxFactory.ParseSyntaxTree(test); 147var tree = SyntaxFactory.ParseSyntaxTree(test);
Parsing\ParsingErrorRecoveryTests.cs (24)
7395SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text, TestOptions.Regular9); 7414SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7448SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7473SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7498SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7524SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7548SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7573SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7587SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(text); 7644var tree = SyntaxFactory.ParseSyntaxTree(source); 7671var tree = SyntaxFactory.ParseSyntaxTree(source); 7760var tree = SyntaxFactory.ParseSyntaxTree(source); 7775var tree = SyntaxFactory.ParseSyntaxTree(source); 7806var tree = SyntaxFactory.ParseSyntaxTree(source); 7840var tree = SyntaxFactory.ParseSyntaxTree(source); 7865var tree = SyntaxFactory.ParseSyntaxTree(source); 7892var tree = SyntaxFactory.ParseSyntaxTree(source); 7906var tree = SyntaxFactory.ParseSyntaxTree(source); 7918var tree = SyntaxFactory.ParseSyntaxTree(source); 7933var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot(); 7954var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot(); 7975var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot(); 7998var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot(); 8022var root = SyntaxFactory.ParseSyntaxTree(source).GetRoot();
Parsing\ParsingTests.cs (2)
78protected virtual SyntaxTree ParseTree(string text, CSharpParseOptions? options) => SyntaxFactory.ParseSyntaxTree(text, options); 365_ = SyntaxFactory.ParseSyntaxTree(stringBuilder.ToString(), TestOptions.RegularPreview);
Parsing\ReadOnlyStructs.cs (1)
23return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\RecordParsing.cs (1)
1217var tree = SyntaxFactory.ParseSyntaxTree(text, options: TestOptions.Regular8);
Parsing\RefReadonlyTests.cs (1)
23return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\RefStructs.cs (1)
23return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\RoundTrippingTests.cs (1)
55var tree = SyntaxFactory.ParseSyntaxTree(text);
Parsing\ScriptParsingTests.cs (2)
25return SyntaxFactory.ParseSyntaxTree(text, options: options ?? TestOptions.Script); 9609var tree = SyntaxFactory.ParseSyntaxTree(test, options: TestOptions.Script);
Parsing\SeparatedSyntaxListParsingTests.cs (1)
24return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\SingleLineDeclarationParsingTests.cs (1)
25return SyntaxFactory.ParseSyntaxTree(text, options);
Parsing\StatementParsingTests.cs (5)
3410var tree = SyntaxFactory.ParseSyntaxTree(text); 3437var tree = SyntaxFactory.ParseSyntaxTree(text, options: new CSharpParseOptions(documentationMode: DocumentationMode.Parse)); 3460var tree = SyntaxFactory.ParseSyntaxTree(source); 3506var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular); 3531var tree = SyntaxFactory.ParseSyntaxTree(source, options: TestOptions.Regular);
Parsing\TypeArgumentListParsingTests.cs (1)
17return SyntaxFactory.ParseSyntaxTree(text, options: options);
Parsing\UsingDirectiveParsingTests.cs (1)
18return SyntaxFactory.ParseSyntaxTree(text, options: options ?? TestOptions.RegularPreview);
Parsing\ValueTupleTests.cs (1)
22return SyntaxFactory.ParseSyntaxTree(text, options: options);
Syntax\LambdaUtilitiesTests.cs (1)
42var tree = SyntaxFactory.ParseSyntaxTree(source);
Syntax\StructuredTriviaTests.cs (7)
100var tree = SyntaxFactory.ParseSyntaxTree(@" 119var tree = SyntaxFactory.ParseSyntaxTree(@" 131var tree = SyntaxFactory.ParseSyntaxTree(@" 141var tree = SyntaxFactory.ParseSyntaxTree(@" 159var tree = SyntaxFactory.ParseSyntaxTree(@" 175var tree = SyntaxFactory.ParseSyntaxTree(@" 190var tree = SyntaxFactory.ParseSyntaxTree(" class goo {}");
Syntax\SyntaxAnnotationTests.cs (25)
25var tree = SyntaxFactory.ParseSyntaxTree(code); 53var fromNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot(); 62var fromNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot(); 63var toNode = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot(); 72var toToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First(); 80var fromToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First(); 89var fromToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First(); 90var toToken = SyntaxFactory.ParseSyntaxTree(_helloWorldCode).GetCompilationUnitRoot().DescendantTokens().First(); 99var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 109var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 118var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 133var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 143var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 156var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 188var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 220var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 252var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 271var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 280var tree = SyntaxFactory.ParseSyntaxTree(_helloWorldCode); 306var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 314var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 322var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 330var tree = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 338var tree1 = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular); 339var tree2 = SyntaxFactory.ParseSyntaxTree(_allInOneCSharpCode, options: Test.Utilities.TestOptions.Regular);
Syntax\SyntaxDiffingTests.cs (18)
21var oldTree = SyntaxFactory.ParseSyntaxTree(""); 22var newTree = SyntaxFactory.ParseSyntaxTree("class C { }"); 40var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 41var newTree = SyntaxFactory.ParseSyntaxTree("class B { }"); 60var oldTree = SyntaxFactory.ParseSyntaxTree("class A { } class B { }"); 61var newTree = SyntaxFactory.ParseSyntaxTree("class C { } class D { }"); 84var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 102var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 120var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 139var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 159var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 177var oldTree = SyntaxFactory.ParseSyntaxTree("class A { }"); 195var oldTree = SyntaxFactory.ParseSyntaxTree("class A { int X; }"); 212var oldTree = SyntaxFactory.ParseSyntaxTree("namespace N { class A { int X; } }"); 229var oldTree = SyntaxFactory.ParseSyntaxTree("class A { int X; }"); 246var oldTree = SyntaxFactory.ParseSyntaxTree("namespace N { class A { int X; } }"); 283var oldTree = SyntaxFactory.ParseSyntaxTree(original); 343var oldTree = SyntaxFactory.ParseSyntaxTree(original);
Syntax\SyntaxEquivalenceTests.cs (116)
21var tree3 = SyntaxFactory.ParseSyntaxTree(tree2.GetText().ToString()); 30var tree3 = SyntaxFactory.ParseSyntaxTree(tree2.GetText().ToString()); 39var tree3 = SyntaxFactory.ParseSyntaxTree(node2.GetText().ToString()); 47var tree1 = SyntaxFactory.ParseSyntaxTree(text); 48var tree2 = SyntaxFactory.ParseSyntaxTree(text); 58var tree1 = SyntaxFactory.ParseSyntaxTree(text); 69var tree1 = SyntaxFactory.ParseSyntaxTree(text); 80var tree1 = SyntaxFactory.ParseSyntaxTree(text); 91var tree1 = SyntaxFactory.ParseSyntaxTree(text); 101var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { }"); 111var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { }"); 121var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { int z = 0; } } }"); 131var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { }"); 141var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { int z = 0; } } }"); 151var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { } }"); 161var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { } } }"); 171var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { int i; } } }"); 181var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { int i = 5; int j = 6; } }"); 191var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { int i = 5; int j = 6; } }"); 201var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { int i = 5; } }"); 211var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { int i = 5, j = 7; } }"); 225var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { const int i = 5; } }"); 235var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { const int i = 5, j = 7; } }"); 250var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { const int i = 5; } } }"); 260var tree1 = SyntaxFactory.ParseSyntaxTree("enum E { i = 5 }"); 270var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { [Obsolete(true)]class C { const int i = 5; } }"); 280var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { Console.Write(0); } } }"); 290var tree1 = SyntaxFactory.ParseSyntaxTree("using System; namespace N { class C { void Goo() { Console.Write(0); } } }"); 300var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 310var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 320var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 330var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 340var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 350var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { Console.Write(0); } }"); 360var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { } }"); 370var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { } }"); 380var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { } }"); 390var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { int i; } }"); 400var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { int i; } }"); 411var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { int i; } }"); 412var tree2 = SyntaxFactory.ParseSyntaxTree(text.Replace(" ", " /**/ ")); 422var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void Goo() { int i; } }"); 423var tree2 = SyntaxFactory.ParseSyntaxTree(text.Replace(" ", " ")); 433var tree1 = SyntaxFactory.ParseSyntaxTree(text); 434var tree2 = SyntaxFactory.ParseSyntaxTree(text.Replace("abc", "hello")); 442var tree1 = SyntaxFactory.ParseSyntaxTree("namespace N { class C { void Goo() { Console.Write($\"Hello{123:N1}\"); } } }"); 457var tree1 = SyntaxFactory.ParseSyntaxTree("class C { void M() => 1; }"); 458var tree2 = SyntaxFactory.ParseSyntaxTree("class C { void M() => 2; }"); 479var tree1 = SyntaxFactory.ParseSyntaxTree($@" 484var tree2 = SyntaxFactory.ParseSyntaxTree($@" 494var tree3 = SyntaxFactory.ParseSyntaxTree($@" 502var tree4 = SyntaxFactory.ParseSyntaxTree($@" 523var tree1 = SyntaxFactory.ParseSyntaxTree($@" 532var tree2 = SyntaxFactory.ParseSyntaxTree($@" 548var tree1 = SyntaxFactory.ParseSyntaxTree(@" 556var tree2 = SyntaxFactory.ParseSyntaxTree(@" 571var tree1 = SyntaxFactory.ParseSyntaxTree(@" 580var tree2 = SyntaxFactory.ParseSyntaxTree(@" 597var tree1 = SyntaxFactory.ParseSyntaxTree(@" 606var tree2 = SyntaxFactory.ParseSyntaxTree(@" 621var tree1 = SyntaxFactory.ParseSyntaxTree(@" 630var tree2 = SyntaxFactory.ParseSyntaxTree(@" 646var tree1 = SyntaxFactory.ParseSyntaxTree(@" 655var tree2 = SyntaxFactory.ParseSyntaxTree(@" 670var tree1 = SyntaxFactory.ParseSyntaxTree(@" 679var tree2 = SyntaxFactory.ParseSyntaxTree(@" 695var tree1 = SyntaxFactory.ParseSyntaxTree(@" 704var tree2 = SyntaxFactory.ParseSyntaxTree(@" 719var tree1 = SyntaxFactory.ParseSyntaxTree(@" 728var tree2 = SyntaxFactory.ParseSyntaxTree(@" 744var tree1 = SyntaxFactory.ParseSyntaxTree(@" 753var tree2 = SyntaxFactory.ParseSyntaxTree(@" 769var tree1 = SyntaxFactory.ParseSyntaxTree(@" 778var tree2 = SyntaxFactory.ParseSyntaxTree(@" 794var tree1 = SyntaxFactory.ParseSyntaxTree(@" 803var tree2 = SyntaxFactory.ParseSyntaxTree(@" 818var tree1 = SyntaxFactory.ParseSyntaxTree(@" 827var tree2 = SyntaxFactory.ParseSyntaxTree(@" 843var tree1 = SyntaxFactory.ParseSyntaxTree(@" 852var tree2 = SyntaxFactory.ParseSyntaxTree(@" 868var tree1 = SyntaxFactory.ParseSyntaxTree(@" 877var tree2 = SyntaxFactory.ParseSyntaxTree(@" 893var tree1 = SyntaxFactory.ParseSyntaxTree(@" 902var tree2 = SyntaxFactory.ParseSyntaxTree(@" 918var tree1 = SyntaxFactory.ParseSyntaxTree(@" 927var tree2 = SyntaxFactory.ParseSyntaxTree(@" 943var tree1 = SyntaxFactory.ParseSyntaxTree(@" 952var tree2 = SyntaxFactory.ParseSyntaxTree(@" 967var tree1 = SyntaxFactory.ParseSyntaxTree(@" 976var tree2 = SyntaxFactory.ParseSyntaxTree(@" 992var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1001var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1017var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1026var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1042var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1051var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1067var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1076var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1092var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1103var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1120var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1131var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1149var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1160var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1178var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1189var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1207var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1218var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1236var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1247var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1265var tree1 = SyntaxFactory.ParseSyntaxTree(@" 1276var tree2 = SyntaxFactory.ParseSyntaxTree(@" 1294var tree1 = SyntaxFactory.ParseSyntaxTree($$"""" 1304var tree2 = SyntaxFactory.ParseSyntaxTree($$"""" 1322var tree1 = SyntaxFactory.ParseSyntaxTree($$"""" 1332var tree2 = SyntaxFactory.ParseSyntaxTree($$""""
Syntax\SyntaxNodeTests.cs (90)
45var tree = SyntaxFactory.ParseSyntaxTree(builder.ToString()); 534var t1 = SyntaxFactory.ParseSyntaxTree(s1); 547var t1 = SyntaxFactory.ParseSyntaxTree(s1); 560var t1 = SyntaxFactory.ParseSyntaxTree(s1); 577var t1 = SyntaxFactory.ParseSyntaxTree(s1); 589var t1 = SyntaxFactory.ParseSyntaxTree(s1); 601var t1 = SyntaxFactory.ParseSyntaxTree(s1); 614var t1 = SyntaxFactory.ParseSyntaxTree(s1); 661var t1 = SyntaxFactory.ParseSyntaxTree(s1); 672var tree = SyntaxFactory.ParseSyntaxTree(text); 726var tree = SyntaxFactory.ParseSyntaxTree(text); 786var tree = SyntaxFactory.ParseSyntaxTree(code); 801var tree = SyntaxFactory.ParseSyntaxTree(text); 809var tree = SyntaxFactory.ParseSyntaxTree(text); 817var tree1 = SyntaxFactory.ParseSyntaxTree(text); 818var tree2 = SyntaxFactory.ParseSyntaxTree(text); 826var tree1 = SyntaxFactory.ParseSyntaxTree("class goo { }"); 827var tree2 = SyntaxFactory.ParseSyntaxTree("class bar { }"); 835var tree1 = SyntaxFactory.ParseSyntaxTree("class goo { }"); 836var tree2 = SyntaxFactory.ParseSyntaxTree(string.Empty); 844var tree1 = SyntaxFactory.ParseSyntaxTree("class goo { void M() { } }"); 845var tree2 = SyntaxFactory.ParseSyntaxTree("class bar { void M() { } }"); 857var tree1 = SyntaxFactory.ParseSyntaxTree("class goo {void M() { }}"); 858var tree2 = SyntaxFactory.ParseSyntaxTree("class goo { void M() { } }"); 866var tree = SyntaxFactory.ParseSyntaxTree(text); 874var tree = SyntaxFactory.ParseSyntaxTree(text); 882var tree = SyntaxFactory.ParseSyntaxTree(text); 890var tree1 = SyntaxFactory.ParseSyntaxTree(text); 891var tree2 = SyntaxFactory.ParseSyntaxTree(text); 899var tree1 = SyntaxFactory.ParseSyntaxTree(text); 900var tree2 = SyntaxFactory.ParseSyntaxTree(text); 908var tree1 = SyntaxFactory.ParseSyntaxTree(text); 919var tree1 = SyntaxFactory.ParseSyntaxTree(text); 929var tree = SyntaxFactory.ParseSyntaxTree(" class goo {}"); 944var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 952var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 960var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 968var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { "); 981var tree1 = SyntaxFactory.ParseSyntaxTree("class A {} public class B {} public static class C {}"); 1004var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1030var tree = SyntaxFactory.ParseSyntaxTree(text); 1055var tree = SyntaxFactory.ParseSyntaxTree( 1081SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1103var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1130var tree = SyntaxFactory.ParseSyntaxTree(text); 1160var tree = SyntaxFactory.ParseSyntaxTree(text); 1186SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1210var tree = SyntaxFactory.ParseSyntaxTree("public static class goo {"); 1231SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("public static class goo {"); 1252var tree = SyntaxFactory.ParseSyntaxTree("public static class goo {"); 1276SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("public static class goo {"); 1299var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1317var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1336var tree = SyntaxFactory.ParseSyntaxTree("public static class goo { }"); 1353var tree = SyntaxFactory.ParseSyntaxTree("#define GOO"); 1364var tree = SyntaxFactory.ParseSyntaxTree("#define GOO"); 1400var tree = SyntaxFactory.ParseSyntaxTree("#define GOO"); 1409var tree = SyntaxFactory.ParseSyntaxTree( 1421var tree = SyntaxFactory.ParseSyntaxTree( 1449var tree = SyntaxFactory.ParseSyntaxTree( 1477var tree = SyntaxFactory.ParseSyntaxTree( 1505var tree = SyntaxFactory.ParseSyntaxTree( 1536var tree = SyntaxFactory.ParseSyntaxTree( 1575var tree = SyntaxFactory.ParseSyntaxTree( 1603var tree = SyntaxFactory.ParseSyntaxTree( 1637var tree = SyntaxFactory.ParseSyntaxTree( 1671var tree = SyntaxFactory.ParseSyntaxTree( 1702var tree = SyntaxFactory.ParseSyntaxTree( 1732var tree = SyntaxFactory.ParseSyntaxTree( 1752var tree = SyntaxFactory.ParseSyntaxTree( 1774var tree = SyntaxFactory.ParseSyntaxTree( 1790var tree = SyntaxFactory.ParseSyntaxTree( 1807var rootNode = SyntaxFactory.ParseSyntaxTree("using X; namespace Y { }").GetCompilationUnitRoot(); 1820SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(@"class c1 2017var tree = SyntaxFactory.ParseSyntaxTree( 2032SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("class C {}"); 2053SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree("class C {}"); 2073var tree = SyntaxFactory.ParseSyntaxTree("class C { void F() { } }"); 3290var tree = SyntaxFactory.ParseSyntaxTree(s1); 3352var syntaxTree = SyntaxFactory.ParseSyntaxTree(@"namespace n1 { c1<t"); 3364var syntaxTree = SyntaxFactory.ParseSyntaxTree(@" 3402var syntaxTree = SyntaxFactory.ParseSyntaxTree(code); 3421var tree = SyntaxFactory.ParseSyntaxTree(code); 3436var tree = SyntaxFactory.ParseSyntaxTree(code); 3456var tree = SyntaxFactory.ParseSyntaxTree(@" 3504var node = SyntaxFactory.ParseSyntaxTree(" ").GetCompilationUnitRoot(); 3610SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(SourceText); 3660SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(SourceText); 3693SyntaxTree tree = SyntaxFactory.ParseSyntaxTree(SourceText); 3831var tree = SyntaxFactory.ParseSyntaxTree(code.ToString());
Syntax\SyntaxNormalizerTests.cs (3)
3722var tree = SyntaxFactory.ParseSyntaxTree(code); 3750var tree = SyntaxFactory.ParseSyntaxTree(code); 3779var tree = SyntaxFactory.ParseSyntaxTree(code);
Syntax\SyntaxRewriterTests.cs (13)
336var tree = SyntaxFactory.ParseSyntaxTree("class Class1<T> { }"); 348var tree = SyntaxFactory.ParseSyntaxTree("class Class1 : Class2<T> { }"); 361var tree = SyntaxFactory.ParseSyntaxTree("System.Console.Write(\"Before\")", TestOptions.Script); 376var tree = SyntaxFactory.ParseSyntaxTree("m(a, b)", TestOptions.Script); 395var tree = SyntaxFactory.ParseSyntaxTree("m(a, b)", TestOptions.Script); 422var tree = SyntaxFactory.ParseSyntaxTree("private class C { }", options: TestOptions.Script); 442var tree = SyntaxFactory.ParseSyntaxTree("public class C { }", options: TestOptions.Script); 465var tree = SyntaxFactory.ParseSyntaxTree("/* c */ identifier", options: TestOptions.Script); 492var tree = SyntaxFactory.ParseSyntaxTree("/* c */ identifier", options: TestOptions.Script); 514var tree = SyntaxFactory.ParseSyntaxTree("private class C { }", options: TestOptions.Script); 527var tree = SyntaxFactory.ParseSyntaxTree("private class C { }", options: TestOptions.Script); 539var tree = SyntaxFactory.ParseSyntaxTree("class Class1<T> { }"); 600var tree1 = SyntaxFactory.ParseSyntaxTree("class C { static void Main() { if (true) } }");
Syntax\SyntaxTests.cs (3)
22Assert.False(SyntaxFactory.IsCompleteSubmission(SyntaxFactory.ParseSyntaxTree(code, options: TestOptions.Script))); 27Assert.True(SyntaxFactory.IsCompleteSubmission(SyntaxFactory.ParseSyntaxTree(code, options: TestOptions.Script))); 35SyntaxFactory.IsCompleteSubmission(SyntaxFactory.ParseSyntaxTree("", options: TestOptions.Regular)));
Syntax\SyntaxTreeTests.cs (5)
90SyntaxTreeFactoryKind.ParsedTreeWithRootAndOptions => WithInitializedDirectives(SyntaxFactory.ParseSyntaxTree("", options: parseOptions)).WithRootAndOptions(root, parseOptions), 243var oldTree = SyntaxFactory.ParseSyntaxTree("class B {}"); 287var oldTree = SyntaxFactory.ParseSyntaxTree("class B {}", path: "old.cs"); 329oldTree = SyntaxFactory.ParseSyntaxTree("", path: "old.cs"); 331Assert.Equal(string.Empty, SyntaxFactory.ParseSyntaxTree("", path: null).FilePath);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (3)
PdbTests.cs (3)
76new[] { SyntaxFactory.ParseSyntaxTree("class C { static void Main() {} }") }, 92new[] { SyntaxFactory.ParseSyntaxTree("class C { static void Main() {} }") }, 109new[] { SyntaxFactory.ParseSyntaxTree("class C { static void Main() {} }") },
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (21)
CodeGeneration\SyntaxGeneratorTests.cs (19)
45.AddSyntaxTrees(ParseSyntaxTree(code)); 974var comp = CSharpCompilation.Create(null, [SyntaxFactory.ParseSyntaxTree(""" 2205var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2219var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2240var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2261var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2282var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2303var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2325var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2343var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2361var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2389var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2417var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2444var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2476var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2530var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 2550AddSyntaxTrees(ParseSyntaxTree(""" 2581var compilation = _emptyCompilation.AddSyntaxTrees(ParseSyntaxTree(""" 4000.AddSyntaxTrees(ParseSyntaxTree(src, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)));
CSharpSyntaxFactsServiceTests.cs (1)
18var tree = SyntaxFactory.ParseSyntaxTree(code);
EmbeddedLanguages\VirtualChars\CSharpVirtualCharServiceTests.cs (1)
121var tree = SyntaxFactory.ParseSyntaxTree(text);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (5)
Utilities\SymbolEquivalenceComparerTests.cs (5)
1739var a1 = (Compilation)CS.CSharpCompilation.Create("a", [CS.SyntaxFactory.ParseSyntaxTree(source)], references, CSharpDllOptions); 1740var a2 = (Compilation)CS.CSharpCompilation.Create("a", [CS.SyntaxFactory.ParseSyntaxTree(source)], references, CSharpDllOptions); 1742var b1 = (Compilation)CS.CSharpCompilation.Create("b", [CS.SyntaxFactory.ParseSyntaxTree(sourceV1)], references, CSharpSignedDllOptions); 1743var b2 = (Compilation)CS.CSharpCompilation.Create("b", [CS.SyntaxFactory.ParseSyntaxTree(sourceV2)], references, CSharpSignedDllOptions); 1744var b3 = (Compilation)CS.CSharpCompilation.Create("b", [CS.SyntaxFactory.ParseSyntaxTree(sourceV2)], references, CSharpSignedDllOptions);
Microsoft.CodeAnalysis.UnitTests (1)
Analyzers\AnalyzerFileReferenceAppDomainTests.cs (1)
94new SyntaxTree[] { CSharp.SyntaxFactory.ParseSyntaxTree(analyzerSource) },
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\CompilationAPITests.vb (2)
1388Dim t1 = CS.SyntaxFactory.ParseSyntaxTree(s1) 1393csComp = csComp.AddSyntaxTrees(t1, CS.SyntaxFactory.ParseSyntaxTree("Imports Goo"))
Microsoft.CodeAnalysis.Workspaces.UnitTests (21)
FormattingTests.cs (1)
72var tree = CS.SyntaxFactory.ParseSyntaxTree(input);
SolutionTests\SolutionTests.cs (2)
304var tree = CS.SyntaxFactory.ParseSyntaxTree("class NewClass {}"); 3432var tree = CSharp.SyntaxFactory.ParseSyntaxTree("public class C {}").GetRoot(CancellationToken.None);
SymbolKeyTests.cs (1)
1481var tree = CSharp.SyntaxFactory.ParseSyntaxTree(source, path: path);
SyntaxNodeTests.cs (2)
29var tree = SyntaxFactory.ParseSyntaxTree(text); 50var tree = SyntaxFactory.ParseSyntaxTree(text);
SyntaxPathTests.cs (11)
80var tree = SyntaxFactory.ParseSyntaxTree(string.Empty); 91var tree = SyntaxFactory.ParseSyntaxTree(string.Empty); 119var tree = SyntaxFactory.ParseSyntaxTree(text); 146var tree = SyntaxFactory.ParseSyntaxTree(text); 184var tree = SyntaxFactory.ParseSyntaxTree(text); 217var tree = SyntaxFactory.ParseSyntaxTree(text); 249var tree = SyntaxFactory.ParseSyntaxTree(text); 277var tree = SyntaxFactory.ParseSyntaxTree(text); 308var tree = SyntaxFactory.ParseSyntaxTree(text); 337var tree = SyntaxFactory.ParseSyntaxTree(text); 376var tree = SyntaxFactory.ParseSyntaxTree(text);
UtilityTest\DocumentationCommentIdTests.cs (1)
19var syntaxTree = SyntaxFactory.ParseSyntaxTree(sourceText);
UtilityTest\FormattingRangeHelperTests.cs (3)
19var root = SyntaxFactory.ParseSyntaxTree("{Foo();}").GetRoot(); 29var root = SyntaxFactory.ParseSyntaxTree("{Fizz();\nBuzz();}").GetRoot(); 39var token = SyntaxFactory.ParseSyntaxTree("else\nFoo();").GetRoot().GetFirstToken();