121 references to ParseText
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
42private static readonly SyntaxTree s_attributesSyntaxTree = CSharpSyntaxTree.ParseText(File.ReadAllText("ConfigurationSchemaAttributes.cs"));
Microsoft.AspNetCore.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestCompilation.cs (1)
14new[] { CSharpSyntaxTree.ParseText(source) },
Microsoft.AspNetCore.App.Analyzers.Test (1)
Infrastructure\WellKnownTypesTests.cs (1)
74var tree = CSharpSyntaxTree.ParseText(code);
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
68var syntaxTree = CSharpSyntaxTree.ParseText(GetMapActionString(updatedSource), path: $"TestMapActions.cs", options: ParseOptions);
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
68var syntaxTree = CSharpSyntaxTree.ParseText(GetMapActionString(updatedSource), path: $"TestMapActions.cs", options: ParseOptions);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CompilerFailedExceptionFactoryTest.cs (1)
51var syntaxTree = CSharpSyntaxTree.ParseText("@class Test { public string Test { get; set; } }");
Microsoft.CodeAnalysis.CSharp (1)
Syntax\SyntaxFactory.cs (1)
1554/// <inheritdoc cref="CSharpSyntaxTree.ParseText(string, CSharpParseOptions?, string, Encoding?, CancellationToken)"/>
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (6)
CodeActions\PreviewTests.cs (1)
84solution = solution.WithDocumentSyntaxRoot(_oldDocument.Id, CSharpSyntaxTree.ParseText(ChangedDocumentText, cancellationToken: cancellationToken).GetRoot(cancellationToken));
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
3241var libComp = origComp.RemoveAllSyntaxTrees().AddSyntaxTrees(CSharpSyntaxTree.ParseText(before, options: options));
Extensions\SyntaxTreeExtensionsTests.cs (3)
44var tree = CSharpSyntaxTree.ParseText(code); 59var tree = CSharpSyntaxTree.ParseText(code); 74var tree = CSharpSyntaxTree.ParseText(code);
Formatting\FormattingEngineTests.cs (1)
2538var syntaxTree = CSharpSyntaxTree.ParseText(text);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenTupleTest.cs (4)
5798var tree = CSharpSyntaxTree.ParseText("class C { }"); 5909var tree = CSharpSyntaxTree.ParseText("class C { }"); 6350var syntaxTree = CSharpSyntaxTree.ParseText("class C { }"); 6386var syntaxTree = CSharpSyntaxTree.ParseText("class C { }");
Emit\DeterministicTests.cs (1)
264var tree = CSharpSyntaxTree.ParseText("class Program { static void Main() { } }");
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) });
Diagnostics\GetDiagnosticsTests.cs (7)
166var tree1 = CSharpSyntaxTree.ParseText(source1, path: "file1"); 167var tree2 = CSharpSyntaxTree.ParseText(source2, path: "file2"); 215var tree1 = CSharpSyntaxTree.ParseText(source1, path: "file1"); 216var tree2 = CSharpSyntaxTree.ParseText(source2, path: "file2"); 267var tree1 = CSharpSyntaxTree.ParseText(source1, path: "file1"); 268var tree2 = CSharpSyntaxTree.ParseText(source2, path: "file2"); 319var tree = CSharpSyntaxTree.ParseText(source, path: "file1");
Semantics\OutVarTests.cs (6)
36362var tree2 = CSharpSyntaxTree.ParseText(source); 36408var tree2 = CSharpSyntaxTree.ParseText(source); 36448var tree2 = CSharpSyntaxTree.ParseText(source); 36490var tree2 = CSharpSyntaxTree.ParseText(source); 36525var tree2 = CSharpSyntaxTree.ParseText(source); 36563var tree2 = CSharpSyntaxTree.ParseText(source);
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests.cs (2)
241var tree = CSharpSyntaxTree.ParseText(@" 319var tree = CSharpSyntaxTree.ParseText(@"
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (19)
Semantics\LocalFunctionTests.cs (1)
8738var tree2 = CSharpSyntaxTree.ParseText(source);
Semantics\NullableReferenceTypesTests.cs (1)
65893var tree2 = CSharpSyntaxTree.ParseText(source2);
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));
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (1)
1300compilation = compilation.ReplaceSyntaxTree(tree, CSharpSyntaxTree.ParseText(source, parseOptions));
SourceGeneration\SyntaxAwareGeneratorTests.cs (6)
1041compilation = compilation.AddSyntaxTrees(CSharpSyntaxTree.ParseText(source2, parseOptions)); 1249var newTree = CSharpSyntaxTree.ParseText(@" 1428var dummyTree = CSharpSyntaxTree.ParseText("", parseOptions); 1461var newLastTree = CSharpSyntaxTree.ParseText(lastTree.ToString(), parseOptions); 1537compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText(source2, parseOptions)); 1650compilation = compilation.ReplaceSyntaxTree(compilation.SyntaxTrees.First(), CSharpSyntaxTree.ParseText(source2, parseOptions));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\CompilationAPITests.cs (1)
2621var tree = CSharpSyntaxTree.ParseText("class C { }");
Compilation\SemanticModelAPITests.cs (1)
3599var tree = CSharpSyntaxTree.ParseText(@"using System.Collections.Generic;
SymbolDisplay\SymbolDisplayTests.cs (1)
6065tree = CSharpSyntaxTree.ParseText(@"
Symbols\CovariantReturnTests.cs (1)
451return comp.AddSyntaxTrees(CSharpSyntaxTree.ParseText(assignments, (CSharpParseOptions)comp.SyntaxTrees[0].Options, path: "assignments.cs", encoding: Encoding.UTF8));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
LexicalAndXml\LexicalTests.cs (1)
3820var tree = CSharpSyntaxTree.ParseText(source);
Parsing\ParserRegressionTests.cs (1)
162var tree = CSharpSyntaxTree.ParseText(code);
Syntax\SyntaxListTests.cs (4)
330var tree = CSharpSyntaxTree.ParseText(builder.ToString()); 354var tree = CSharpSyntaxTree.ParseText(builder.ToString()); 369CSharpSyntaxTree.ParseText(source).VerifyChildNodePositions(); 400var tree = CSharpSyntaxTree.ParseText(source);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
833var tree = CSharpSyntaxTree.ParseText(code);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (1)
50syntaxTrees: [CSharpSyntaxTree.ParseText(unconditionalSuppressMessageDef)],
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
427syntaxTrees: new[] { CSharpSyntaxTree.ParseText(@"// this is a comment", CSharpParseOptions.Default.WithLanguageVersion(CSharp.LanguageVersion.CSharp10)) },
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\AnalysisContextInfoTests.cs (1)
113var syntaxTree = CSharpSyntaxTree.ParseText(source, path: fileName, options: parseOptions);
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Attributes\InternalsVisibleToAndStrongNameTests.vb (1)
838syntaxTrees:={CSharp.CSharpSyntaxTree.ParseText(cSource)},
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
FindReferencesTests.cs (1)
232var tree = Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(
Microsoft.DotNet.GenFacades (2)
NotSupportedAssemblyGenerator.cs (1)
79syntaxTree = CSharpSyntaxTree.ParseText(File.ReadAllText(sourceFile), new CSharpParseOptions(languageVersion));
TypeParser.cs (1)
147SyntaxTree tree = CSharpSyntaxTree.ParseText(File.ReadAllText(sourceFile), options);
Microsoft.Gen.Logging.Unit.Tests (1)
CompilationHelper.cs (1)
49syntaxTrees: new[] { CSharpSyntaxTree.ParseText(source) },
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
187var tree = CSharpSyntaxTree.ParseText(trainProgramCSFileContent);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
ProjectSystemShim\EntryPointFinderTests.cs (1)
37var compilation = CSharpCompilation.Create("Test", references: [TestBase.MscorlibRef]).AddSyntaxTrees(CSharpSyntaxTree.ParseText($$"""
Mvc.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestCompilation.cs (1)
14new[] { CSharpSyntaxTree.ParseText(source) },
System.Windows.Forms.Design.Tests (1)
System\Resources\Tools\CodeDomCompileHelper.cs (1)
36new[] { CSharpSyntaxTree.ParseText(source) },
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
291SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source);
WinShimmer (1)
Program.cs (1)
50.AddSyntaxTrees(CSharpSyntaxTree.ParseText($@"