6 types derived from CSharpSyntaxTree
Microsoft.CodeAnalysis.CSharp (3)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
228 references to CSharpSyntaxTree
ConfigurationSchemaGenerator.Tests (1)
Microsoft.AspNetCore.Analyzers.Test (1)
Microsoft.AspNetCore.App.Analyzers.Test (1)
Microsoft.AspNetCore.Http.Extensions.Tests (2)
Microsoft.AspNetCore.Http.Microbenchmarks (2)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
Microsoft.CodeAnalysis.CSharp (57)
Syntax\SyntaxFactory.cs (7)
1548=> CSharpSyntaxTree.Create((CSharpSyntaxNode)root, (CSharpParseOptions?)options ?? CSharpParseOptions.Default, path, encoding, SourceHashAlgorithm.Sha1);
1554/// <inheritdoc cref="CSharpSyntaxTree.ParseText(string, CSharpParseOptions?, string, Encoding?, CancellationToken)"/>
1562return CSharpSyntaxTree.ParseText(SourceText.From(text, encoding, SourceHashAlgorithm.Sha1), (CSharpParseOptions?)options, path, diagnosticOptions: null, isGeneratedCode: null, cancellationToken);
1566/// <inheritdoc cref="CSharpSyntaxTree.ParseText(SourceText, CSharpParseOptions?, string, CancellationToken)"/>
1573return CSharpSyntaxTree.ParseText(text, (CSharpParseOptions?)options, path, cancellationToken);
2803return CSharpSyntaxTree.ParseText(text, (CSharpParseOptions?)options, path, diagnosticOptions, isGeneratedCode: null, cancellationToken);
2832return CSharpSyntaxTree.ParseText(text, (CSharpParseOptions?)options, path, diagnosticOptions, isGeneratedCode, cancellationToken);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (57)
Diagnostics\DiagnosticAnalyzerTests.cs (44)
1478var tree = CSharpSyntaxTree.ParseText(string.Format(source, treeNum++), path: "SourceFileRegular.cs");
1480tree = CSharpSyntaxTree.ParseText(string.Format(source, treeNum++), path: "AssemblyInfo.cs");
1486tree = CSharpSyntaxTree.ParseText(string.Format(source, treeNum++), path: fileName);
1496tree = CSharpSyntaxTree.ParseText(string.Format(autoGeneratedPrefix + source, treeNum++), path: $"SourceFileWithAutoGeneratedComment{i++}.cs");
1506tree = CSharpSyntaxTree.ParseText(string.Format(source, treeNum++), path: myGeneratedFileTrueName);
1514tree = CSharpSyntaxTree.ParseText(string.Format(source, treeNum++), path: myGeneratedFileCaseInsensitiveTrueName);
1520tree = CSharpSyntaxTree.ParseText(string.Format(source, treeNum++), path: "MyGeneratedFileFalse.cs");
1526tree = CSharpSyntaxTree.ParseText(string.Format(source, treeNum++), path: "MyGeneratedFileAuto.cs");
1570var tree = CSharpSyntaxTree.ParseText(source, path: "SourceFileRegular.cs");
1612var tree1 = CSharpSyntaxTree.ParseText(source1, path: "SourceFileRegular.cs");
1613var tree2 = CSharpSyntaxTree.ParseText(source2, path: "SourceFileRegular.Designer.cs");
1905var tree1 = CSharpSyntaxTree.ParseText(source1, path: "Source1_File1.cs");
1906var tree2 = CSharpSyntaxTree.ParseText(source1, path: "Source1_File2.cs");
1907var tree3 = CSharpSyntaxTree.ParseText(source2, path: "Source2_File3.cs");
1908var tree4 = CSharpSyntaxTree.ParseText(source3, path: "Source3_File4.generated.cs");
1909var tree5 = CSharpSyntaxTree.ParseText(source3, path: "Source3_File5.designer.cs");
1943var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
1964var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
1987var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2008var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2033var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2053var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2072var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2095var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2116var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2142var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2175var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2240var tree = CSharpSyntaxTree.ParseText(source, path: "Source.cs");
2532var tree = CSharpSyntaxTree.ParseText(source);
2561var tree = CSharpSyntaxTree.ParseText(source);
2589var tree = CSharpSyntaxTree.ParseText(source);
2607var tree = CSharpSyntaxTree.ParseText(source);
2625var tree = CSharpSyntaxTree.ParseText(source);
2653var tree = CSharpSyntaxTree.ParseText(source);
2849var tree = CSharpSyntaxTree.ParseText(source);
3591var tree = CSharpSyntaxTree.ParseText(source);
3621var tree = CSharpSyntaxTree.ParseText(source);
3642var tree = CSharpSyntaxTree.ParseText(source);
3879var tree = CSharpSyntaxTree.ParseText(string.Empty);
3914var tree = CSharpSyntaxTree.ParseText(string.Empty);
4037var tree = CSharpSyntaxTree.ParseText(@"class C { }");
4393var tree = CSharpSyntaxTree.ParseText(@"class C { }");
4418var tree = CSharpSyntaxTree.ParseText(source);
4419var compilation = CreateCompilationWithCSharp(new[] { tree, CSharpSyntaxTree.ParseText(IsExternalInitTypeDefinition) });
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (35)
SourceGeneration\GeneratorDriverTests.cs (10)
1514compilation = compilation.ReplaceSyntaxTree(syntaxTree, CSharpSyntaxTree.ParseText("""
2168compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.Single(), CSharpSyntaxTree.ParseText(source, parseOptions));
2230compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.Single(), CSharpSyntaxTree.ParseText(source, parseOptions));
2373compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText(source, parseOptions));
2432var c2 = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText("class E{}", parseOptions));
3617var syntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "/detached");
3650var invalidSyntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "/detached");
3681var syntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "/detached");
3711var invalidSyntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "/detached");
4104compilation = compilation.ReplaceSyntaxTree(tree, CSharpSyntaxTree.ParseText(source, parseOptions));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (22)
Syntax\SyntaxTreeTests.cs (15)
85SyntaxTreeFactoryKind.Create => CSharpSyntaxTree.Create(root, options: parseOptions, path: "", encoding: null),
86SyntaxTreeFactoryKind.ParseText => CSharpSyntaxTree.ParseText(SourceText.From(source, Encoding.UTF8, SourceHashAlgorithm.Sha256), parseOptions),
89SyntaxTreeFactoryKind.ParsedTreeWithPath => WithInitializedDirectives(CSharpSyntaxTree.Create(root, options: parseOptions, path: "old path", Encoding.UTF8)).WithFilePath("new path"),
94Assert.Equal("#define U | #undef U | #define Y", ((CSharpSyntaxTree)tree).GetDirectives().GetDebuggerDisplay());
111_ = ((CSharpSyntaxTree)tree).GetDirectives();
121var tree = CSharpSyntaxTree.Create(root);
131var tree = CSharpSyntaxTree.Create(SyntaxFactory.ParseCompilationUnit(""), options: null, path: null, encoding: null, diagnosticOptions: options);
141var tree = CSharpSyntaxTree.ParseText(
156var tree = CSharpSyntaxTree.ParseText(
172var tree = CSharpSyntaxTree.ParseText(
188var tree = CSharpSyntaxTree.ParseText(
276var dummy = new CSharpSyntaxTree.DummySyntaxTree();
317var oldTree = new CSharpSyntaxTree.DummySyntaxTree();
327SyntaxTree oldTree = new CSharpSyntaxTree.DummySyntaxTree();
332Assert.Equal(string.Empty, CSharpSyntaxTree.Create((CSharpSyntaxNode)oldTree.GetRoot()).FilePath);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.Rebuild (1)
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
Microsoft.CodeAnalysis.Test.Utilities (7)
Microsoft.CodeAnalysis.UnitTests (3)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.DotNet.GenFacades (2)
Microsoft.Gen.Logging.Unit.Tests (1)
Microsoft.ML.CodeGenerator (1)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Mvc.Analyzers.Test (1)
System.Windows.Forms.Design.Tests (1)
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
WinShimmer (1)