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