344 instantiations of CSharpParseOptions
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
38internal static readonly CSharpParseOptions ParseOptions = new CSharpParseOptions(LanguageVersion.Preview).WithFeatures(new[] { new KeyValuePair<string, string>("InterceptorsPreviewNamespaces", "Microsoft.AspNetCore.Http.Generated") });
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
38internal static readonly CSharpParseOptions ParseOptions = new CSharpParseOptions(LanguageVersion.Preview).WithFeatures(new[] { new KeyValuePair<string, string>("InterceptorsPreviewNamespaces", "Microsoft.AspNetCore.Http.Generated") });
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CSharpCompiler.cs (1)
216var parseOptions = new CSharpParseOptions(preprocessorSymbols: (IEnumerable<string>)defines);
Microsoft.CodeAnalysis.CSharp (6)
CSharpParseOptions.cs (6)
22public static CSharpParseOptions Default { get; } = new CSharpParseOptions(); 96return new CSharpParseOptions(this) { SpecifiedKind = kind, Kind = effectiveKind }; 107return new CSharpParseOptions(this) { SpecifiedLanguageVersion = version, LanguageVersion = effectiveLanguageVersion }; 132return new CSharpParseOptions(this) { PreprocessorSymbols = symbols }; 142return new CSharpParseOptions(this) { DocumentationMode = documentationMode }; 169return new CSharpParseOptions(this) { _features = dictionary };
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (90)
src\Analyzers\CSharp\Tests\DocumentationComments\AddDocCommentNodesCodeFixProviderTests.cs (1)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular);
src\Analyzers\CSharp\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.cs (1)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular);
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateMethodTests.cs (1)
5304new TestParameters(new CSharpParseOptions(kind: SourceCodeKind.Regular)));
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
1835""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7));
src\Analyzers\CSharp\Tests\Nullable\CSharpDeclareAsNullableCodeFixTests.cs (1)
24private static readonly TestParameters s_nullableFeature = new TestParameters(parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.cs (1)
1387""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (27)
2736""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 2770""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 2791""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 3010""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3027""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 3122""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3145""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 3259""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3296""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 5474""", optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 7777""", PreferDiscard, new CSharpParseOptions(LanguageVersion.CSharp9)); 8237""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8253""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8277""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8301""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8321""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8472""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8495""", PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 8886""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)); 8924""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9126""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9147""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 9164""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9190""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9258""", options: PreferDiscard, parseOptions: new CSharpParseOptions(languageVersion)); 9276""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 9308""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (50)
78new CSharpParseOptions(LanguageVersion.CSharp7_2)); 92new CSharpParseOptions(LanguageVersion.CSharp7)); 109new CSharpParseOptions(LanguageVersion.CSharp6)); 126new CSharpParseOptions(LanguageVersion.CSharp5)); 143new CSharpParseOptions(LanguageVersion.CSharp4)); 157new CSharpParseOptions(LanguageVersion.CSharp7)); 191new CSharpParseOptions(LanguageVersion.CSharp7)); 205new CSharpParseOptions(LanguageVersion.CSharp7_1)); 219new CSharpParseOptions(LanguageVersion.CSharp7)); 236new CSharpParseOptions(LanguageVersion.CSharp7_1)); 255new CSharpParseOptions(LanguageVersion.CSharp7)); 270new CSharpParseOptions(LanguageVersion.CSharp7_2)); 286new CSharpParseOptions(LanguageVersion.CSharp7_2)); 299new CSharpParseOptions(LanguageVersion.CSharp7_2)); 312new CSharpParseOptions(LanguageVersion.CSharp7_2)); 325new CSharpParseOptions(LanguageVersion.CSharp7_2)); 341new CSharpParseOptions(LanguageVersion.CSharp7_3)); 355new CSharpParseOptions(LanguageVersion.CSharp7_3)); 372new CSharpParseOptions(LanguageVersion.CSharp7_3)); 703new CSharpParseOptions(LanguageVersion.CSharp8)); 716new CSharpParseOptions(LanguageVersion.CSharp7)); 749new CSharpParseOptions(LanguageVersion.CSharp7)); 778new CSharpParseOptions(LanguageVersion.CSharp7)); 812new CSharpParseOptions(LanguageVersion.CSharp7)); 849new CSharpParseOptions(LanguageVersion.CSharp7_3)); 877new CSharpParseOptions(LanguageVersion.CSharp7_3)); 891new CSharpParseOptions(LanguageVersion.CSharp7_3)); 905new CSharpParseOptions(LanguageVersion.CSharp7_3)); 919new CSharpParseOptions(LanguageVersion.CSharp7_3)); 932new CSharpParseOptions(LanguageVersion.CSharp7_3)); 965new CSharpParseOptions(LanguageVersion.CSharp7_3)); 994new CSharpParseOptions(LanguageVersion.CSharp7_3)); 1028new CSharpParseOptions(LanguageVersion.CSharp7_3)); 1065new CSharpParseOptions(LanguageVersion.CSharp8)); 1091new CSharpParseOptions(LanguageVersion.CSharp9)); 1102new CSharpParseOptions(LanguageVersion.CSharp11)); 1113new CSharpParseOptions(LanguageVersion.CSharp11)); 1124new CSharpParseOptions(LanguageVersion.CSharp11)); 1135new CSharpParseOptions(LanguageVersion.CSharp11)); 1146new CSharpParseOptions(LanguageVersion.CSharp11)); 1157new CSharpParseOptions(LanguageVersion.CSharp11)); 1170new CSharpParseOptions(LanguageVersion.CSharp8)); 1180new CSharpParseOptions(LanguageVersion.CSharp9)); 1199new CSharpParseOptions(LanguageVersion.CSharp9)); 1215new CSharpParseOptions(LanguageVersion.CSharp8)); 1233new CSharpParseOptions(LanguageVersion.CSharp8)); 1247new CSharpParseOptions(LanguageVersion.CSharp10)); 1261new CSharpParseOptions(LanguageVersion.CSharp10)); 1275new CSharpParseOptions(LanguageVersion.CSharp10)); 1292new CSharpParseOptions(LanguageVersion.CSharp11));
src\Analyzers\CSharp\Tests\UseInterpolatedVerbatimString\UseInterpolatedVerbatimStringCodeFixTests.cs (6)
49""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 64""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 88""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 114""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 129""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 144""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp8)));
src\Features\CSharpTest\Diagnostics\AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor.cs (1)
16private static readonly CSharpParseOptions Script = new CSharpParseOptions(kind: SourceCodeKind.Script);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Interactive\CSharpInteractiveEvaluatorLanguageInfoProvider.cs (1)
24new(languageVersion: LanguageVersion.Latest, kind: SourceCodeKind.Script);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (18)
ChangeSignature\ChangeSignature_CheckAllSignatureChanges.cs (1)
182parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7));
Classification\SyntacticClassifierTests.cs (1)
2860[new CSharpParseOptions(LanguageVersion.CSharp8)],
CodeActions\AddUsing\AddUsingTests.cs (4)
2716var options = new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose); 2738var options = new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose); 2786var options = new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose); 2824var options = new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose);
Completion\CompletionProviders\CrefCompletionProviderTests.cs (1)
444using var workspace = EditorTestWorkspace.Create(LanguageNames.CSharp, new CSharpCompilationOptions(OutputKind.ConsoleApplication), new CSharpParseOptions(), [text], composition: GetComposition());
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (1)
3058using var workspace = EditorTestWorkspace.Create(LanguageNames.CSharp, new CSharpCompilationOptions(OutputKind.ConsoleApplication), new CSharpParseOptions(), [text], composition: GetComposition());
Debugging\LocationInfoGetterTests.cs (3)
529""", "f1", 0, new CSharpParseOptions(kind: SourceCodeKind.Script)); 540""", "M1(int x)", 2, new CSharpParseOptions(kind: SourceCodeKind.Script)); 549""", null, 0, new CSharpParseOptions(kind: SourceCodeKind.Script));
ExtractMethod\ExtractMethodBase.cs (1)
33parseOptions = new CSharpParseOptions().WithFeatures(featuresMapped);
ExtractMethod\ExtractMethodTests.cs (1)
10379await TestExtractMethodAsync(code, expected, parseOptions: new CSharpParseOptions(kind: SourceCodeKind.Script));
ExtractMethod\ExtractMethodTests.LanguageInteraction.cs (1)
1390await TestExtractMethodAsync(code, expected, parseOptions: new CSharpParseOptions(kind: SourceCodeKind.Script));
Formatting\CSharpNewDocumentFormattingServiceTests.cs (3)
58parseOptions: new CSharpParseOptions(LanguageVersion.CSharp10)); 81parseOptions: new CSharpParseOptions(LanguageVersion.CSharp10)); 103parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9));
SignatureHelp\AbstractCSharpSignatureHelpProviderTests.cs (1)
18return new CSharpParseOptions().WithFeatures(new Dictionary<string, string>()); // no experimental features to enable
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
PDB\CSharpDeterministicBuildCompilationTests.cs (1)
352var parseOptions = new CSharpParseOptions(
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (19)
Attributes\AttributeTests_Dynamic.cs (5)
1299parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.CSharp7_2))); 1309parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.CSharp7_2)); 1351parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.CSharp7_2))); 1365parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.Preview))); 1394CreateCompilationWithMscorlib461(source: source, parseOptions: new CSharpParseOptions(kind: sourceCodeKind, languageVersion: LanguageVersion.CSharp7_2)).VerifyDiagnostics(
Attributes\AttributeTests_WellKnownAttributes.cs (4)
13662CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 13679CreateEmptyCompilation(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 13705CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 13731CreateEmptyCompilation(code, references: WinRtRefs, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)).VerifyDiagnostics(
Diagnostics\GetDiagnosticsTests.cs (10)
385var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" })); 397var compilation = CreateCompilationWithMscorlib461(string.Empty, parseOptions: new CSharpParseOptions().WithKind(SourceCodeKind.Interactive)); 409var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithLanguageVersion((LanguageVersion)10000)); 419var compilation = CreateEmptyCompilation(string.Empty, parseOptions: new CSharpParseOptions().WithDocumentationMode(unchecked((DocumentationMode)100))); 429var syntaxTree1 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" })); 430var syntaxTree2 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "2" })); 431var syntaxTree3 = Parse(string.Empty, options: new CSharpParseOptions().WithPreprocessorSymbols(new[] { "3" })); 455var parseOptions1 = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" }); 456var parseOptions2 = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "2" }); 481var parseOptions = new CSharpParseOptions(LanguageVersion.Latest);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (105)
ConvertForToForEach\ConvertForToForEachTests.cs (2)
1730""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 1768""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp8)));
ConvertLinq\ConvertLinqQueryToForEachTests.cs (2)
4430await TestInRegularAndScriptAsync(source, output, parseOptions: new CSharpParseOptions(CodeAnalysis.CSharp.LanguageVersion.CSharp7_3)); 4474await TestInRegularAndScriptAsync(source, output, parseOptions: new CSharpParseOptions(CodeAnalysis.CSharp.LanguageVersion.CSharp8));
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringTests.cs (4)
165""", new(new CSharpParseOptions(LanguageVersion.CSharp9))); 189""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp10)); 218""", new(new CSharpParseOptions(LanguageVersion.CSharp9))); 240""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp10));
Diagnostics\AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor.cs (1)
16private static readonly CSharpParseOptions Script = new CSharpParseOptions(kind: SourceCodeKind.Script);
Diagnostics\Suppression\SuppressionTests.cs (1)
405}}", new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose));
EncapsulateField\EncapsulateFieldTests.cs (1)
904await TestAllOptionsOffAsync(host, text, expected, new CodeAnalysis.CSharp.CSharpParseOptions(), TestOptions.ReleaseExe);
ExtractClass\ExtractClassTests.cs (1)
51var unusedParseOptions = new CSharpParseOptions(LanguageVersion.CSharp1);
GenerateVariable\GenerateVariableTests.cs (1)
4824index: 3, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7));
RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_AsTests.cs (3)
3354""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp7_1))); 3373""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp7_1))); 3392""", parameters: new TestParameters(new CSharpParseOptions(LanguageVersion.CSharp7_1)));
src\Analyzers\CSharp\Tests\DocumentationComments\AddDocCommentNodesCodeFixProviderTests.cs (1)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular);
src\Analyzers\CSharp\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.cs (1)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular);
src\Analyzers\CSharp\Tests\GenerateMethod\GenerateMethodTests.cs (1)
5304new TestParameters(new CSharpParseOptions(kind: SourceCodeKind.Regular)));
src\Analyzers\CSharp\Tests\ImplementAbstractClass\ImplementAbstractClassTests.cs (1)
1835""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7));
src\Analyzers\CSharp\Tests\Nullable\CSharpDeclareAsNullableCodeFixTests.cs (1)
24private static readonly TestParameters s_nullableFeature = new TestParameters(parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedParametersTests.cs (1)
1387""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (27)
2736""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 2770""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 2791""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 3010""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3027""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 3122""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3145""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 3259""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3296""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 5474""", optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 7777""", PreferDiscard, new CSharpParseOptions(LanguageVersion.CSharp9)); 8237""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8253""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8277""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8301""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8321""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8472""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8495""", PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 8886""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)); 8924""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9126""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9147""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 9164""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9190""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9258""", options: PreferDiscard, parseOptions: new CSharpParseOptions(languageVersion)); 9276""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 9308""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8));
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (50)
78new CSharpParseOptions(LanguageVersion.CSharp7_2)); 92new CSharpParseOptions(LanguageVersion.CSharp7)); 109new CSharpParseOptions(LanguageVersion.CSharp6)); 126new CSharpParseOptions(LanguageVersion.CSharp5)); 143new CSharpParseOptions(LanguageVersion.CSharp4)); 157new CSharpParseOptions(LanguageVersion.CSharp7)); 191new CSharpParseOptions(LanguageVersion.CSharp7)); 205new CSharpParseOptions(LanguageVersion.CSharp7_1)); 219new CSharpParseOptions(LanguageVersion.CSharp7)); 236new CSharpParseOptions(LanguageVersion.CSharp7_1)); 255new CSharpParseOptions(LanguageVersion.CSharp7)); 270new CSharpParseOptions(LanguageVersion.CSharp7_2)); 286new CSharpParseOptions(LanguageVersion.CSharp7_2)); 299new CSharpParseOptions(LanguageVersion.CSharp7_2)); 312new CSharpParseOptions(LanguageVersion.CSharp7_2)); 325new CSharpParseOptions(LanguageVersion.CSharp7_2)); 341new CSharpParseOptions(LanguageVersion.CSharp7_3)); 355new CSharpParseOptions(LanguageVersion.CSharp7_3)); 372new CSharpParseOptions(LanguageVersion.CSharp7_3)); 703new CSharpParseOptions(LanguageVersion.CSharp8)); 716new CSharpParseOptions(LanguageVersion.CSharp7)); 749new CSharpParseOptions(LanguageVersion.CSharp7)); 778new CSharpParseOptions(LanguageVersion.CSharp7)); 812new CSharpParseOptions(LanguageVersion.CSharp7)); 849new CSharpParseOptions(LanguageVersion.CSharp7_3)); 877new CSharpParseOptions(LanguageVersion.CSharp7_3)); 891new CSharpParseOptions(LanguageVersion.CSharp7_3)); 905new CSharpParseOptions(LanguageVersion.CSharp7_3)); 919new CSharpParseOptions(LanguageVersion.CSharp7_3)); 932new CSharpParseOptions(LanguageVersion.CSharp7_3)); 965new CSharpParseOptions(LanguageVersion.CSharp7_3)); 994new CSharpParseOptions(LanguageVersion.CSharp7_3)); 1028new CSharpParseOptions(LanguageVersion.CSharp7_3)); 1065new CSharpParseOptions(LanguageVersion.CSharp8)); 1091new CSharpParseOptions(LanguageVersion.CSharp9)); 1102new CSharpParseOptions(LanguageVersion.CSharp11)); 1113new CSharpParseOptions(LanguageVersion.CSharp11)); 1124new CSharpParseOptions(LanguageVersion.CSharp11)); 1135new CSharpParseOptions(LanguageVersion.CSharp11)); 1146new CSharpParseOptions(LanguageVersion.CSharp11)); 1157new CSharpParseOptions(LanguageVersion.CSharp11)); 1170new CSharpParseOptions(LanguageVersion.CSharp8)); 1180new CSharpParseOptions(LanguageVersion.CSharp9)); 1199new CSharpParseOptions(LanguageVersion.CSharp9)); 1215new CSharpParseOptions(LanguageVersion.CSharp8)); 1233new CSharpParseOptions(LanguageVersion.CSharp8)); 1247new CSharpParseOptions(LanguageVersion.CSharp10)); 1261new CSharpParseOptions(LanguageVersion.CSharp10)); 1275new CSharpParseOptions(LanguageVersion.CSharp10)); 1292new CSharpParseOptions(LanguageVersion.CSharp11));
src\Analyzers\CSharp\Tests\UseInterpolatedVerbatimString\UseInterpolatedVerbatimStringCodeFixTests.cs (6)
49""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 64""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 88""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 114""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 129""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp7_3))); 144""", parameters: new TestParameters().WithParseOptions(new CSharpParseOptions(LanguageVersion.CSharp8)));
Microsoft.CodeAnalysis.CSharp.Scripting (1)
CSharpScriptCompiler.cs (1)
18internal static readonly CSharpParseOptions DefaultParseOptions = new CSharpParseOptions(kind: SourceCodeKind.Script, languageVersion: LanguageVersion.Latest);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (21)
Semantics\ForEachTests.cs (1)
2051var options = new CSharpParseOptions(preprocessorSymbols: ImmutableArray.Create("CONDITIONAL"), documentationMode: DocumentationMode.None);
Semantics\GenericConstraintsTests.cs (4)
351var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 908var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 1390var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 2086var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2);
Semantics\InterpolationTests.cs (2)
1154var parseOptions = new CSharpParseOptions( 1365var parseOptions = new CSharpParseOptions(
Semantics\ScriptSemanticsTests.cs (11)
1179var compilationUnit = CSharp.SyntaxFactory.ParseCompilationUnit(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1207syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1216syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1225syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1237syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1249syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1267var compilationUnit = CSharp.SyntaxFactory.ParseCompilationUnit("\nSystem.Console.WriteLine(1);", options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1269var syntaxTree2 = SyntaxFactory.ParseSyntaxTree("System.Console.WriteLine(2);", options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1306var compilationUnit = CSharp.SyntaxFactory.ParseCompilationUnit(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1336syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script)); 1351syntaxTree = SyntaxFactory.ParseSyntaxTree(code, options: new CSharp.CSharpParseOptions(kind: SourceCodeKind.Script));
Semantics\StackAllocInitializerTests.cs (1)
1461var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7);
Semantics\StackAllocSpanExpressionsTests.cs (2)
363var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7); 382var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
2750var tree = SyntaxFactory.ParseSyntaxTree(test, options: new CSharpParseOptions(languageVersion: LanguageVersion.CSharp6));
DocumentationComments\ParameterTests.cs (2)
829CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp2)).VerifyDiagnostics( 834CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.Latest)).VerifyDiagnostics();
Symbols\Source\ModifierTests.cs (1)
328CreateCompilation(code, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7)).VerifyDiagnostics(
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (41)
IncrementalParsing\IncrementalParsingTests.cs (2)
23return new CSharpParseOptions(languageVersion: LanguageVersion.CSharp3, preprocessorSymbols: defines); 35var options = new CSharpParseOptions(languageVersion: languageVersion);
LexicalAndXml\LexicalTests.cs (4)
32_options = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp3); 33_options6 = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp6); 34_options7 = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp7); 35_options72 = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp7_2);
LexicalAndXml\PreprocessorTests.cs (2)
77return new CSharpParseOptions(languageVersion: LanguageVersion.CSharp4, kind: kind, preprocessorSymbols: defines); 3232var node = Parse(text, new CSharpParseOptions(version));
LexicalAndXml\XmlDocCommentTests.cs (1)
25return new CSharpParseOptions(
Parsing\AsyncParsingTests.cs (1)
33test(new CSharpParseOptions(languageVersion: version));
Parsing\CSharpParseOptionsTests.cs (26)
35var po = new CSharpParseOptions().WithFeatures(new[] { kvp }); 77var options = new CSharpParseOptions(); 83options = new CSharpParseOptions(kind: SourceCodeKind.Regular); 89options = new CSharpParseOptions(kind: SourceCodeKind.Script); 96options = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 105options = new CSharpParseOptions(kind: (SourceCodeKind)int.MinValue); 117var options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 118var options2 = new CSharpParseOptions(kind: SourceCodeKind.Script); 124options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 125options2 = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 134var options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 135var options2 = new CSharpParseOptions(kind: SourceCodeKind.Script); 141options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 142options2 = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 152var options = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 163var options = new CSharpParseOptions(documentationMode: unchecked((DocumentationMode)100)); 173var options = new CSharpParseOptions(languageVersion: unchecked((LanguageVersion)10000)); 183var options = new CSharpParseOptions(preprocessorSymbols: new[] { "test", "1" }); 194var options = new CSharpParseOptions().WithKind(SourceCodeKind.Interactive); 205var options = new CSharpParseOptions().WithDocumentationMode(unchecked((DocumentationMode)100)); 215var options = new CSharpParseOptions().WithLanguageVersion(unchecked((LanguageVersion)10000)); 225var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "" }); 235var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { " " }); 245var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "Good", "Bad.Symbol" }); 255var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "Good", "Bad\\Symbol" }); 265var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "Good", null });
Parsing\RoundTrippingTests.cs (1)
1579CSharpParseOptions options = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp2);
Parsing\StatementParsingTests.cs (1)
3437var tree = SyntaxFactory.ParseSyntaxTree(text, options: new CSharpParseOptions(documentationMode: DocumentationMode.Parse));
Syntax\SyntaxTreeTests.cs (3)
245var newOptions = new CSharpParseOptions(); 263var newOptions = new CSharpParseOptions(); 278var newOptions = new CSharpParseOptions();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
TestOptions.cs (2)
19public static readonly CSharpParseOptions Regular = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.Parse); 58new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None, languageVersion: LanguageVersion.Preview).WithFeatures(s_experimentalFeatures);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.cs (1)
43return new CSharpParseOptions(
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Formatting\FormattingTests.cs (1)
7481var parseOptions = new CSharpParseOptions();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\CSharpTestWorkspaceFixture.cs (1)
19parseOptions: new CSharpParseOptions(kind: SourceCodeKind.Regular),
Microsoft.CodeAnalysis.Features.Test.Utilities (2)
Utils\Options.cs (2)
13internal static readonly CSharpParseOptions Script = new CSharpParseOptions(kind: SourceCodeKind.Script); 14internal static readonly CSharpParseOptions Regular = new CSharpParseOptions(kind: SourceCodeKind.Regular);
Microsoft.CodeAnalysis.Features.UnitTests (2)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
1983solution = solution.WithProjectParseOptions(project.Id, new CSharpParseOptions(LanguageVersion.CSharp10)); 3015solution = solution.WithProjectParseOptions(project.Id, new CSharpParseOptions(LanguageVersion.CSharp10));
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\AnalysisContextInfoTests.cs (1)
26var parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Attributes\AttributeTests_ObsoleteAttribute.vb (1)
2707Dim csCompilation = CreateCSharpCompilation("Dll1", csSource.Value, parseOptions:=New CSharp.CSharpParseOptions(CSharp.LanguageVersion.CSharp7_2))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\SemanticModelAPITests.vb (1)
2964", parseOptions:=New CSharp.CSharpParseOptions(CSharp.LanguageVersion.CSharp7_3))
Semantics\NativeIntegerTests.vb (1)
21Dim comp As Compilation = CreateCSharpCompilation(source0, parseOptions:=New CSharp.CSharpParseOptions(CSharp.LanguageVersion.CSharp9))
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
278return new CSharpParseOptions(preprocessorSymbols: preprocessorSymbolsAttribute.Value.Split(','));
Microsoft.CodeAnalysis.Workspaces.UnitTests (11)
BatchFixAllProviderTests.cs (1)
156return new CSharpParseOptions(LanguageVersion.Default, DocumentationMode.Diagnose);
SolutionTests\SolutionTests.cs (10)
1176parseOptions: new CSharpParseOptions(CS.LanguageVersion.CSharp5), 1350parseOptions: new CSharpParseOptions(CS.LanguageVersion.CSharp5), 1766var options = new CSharpParseOptions(CS.LanguageVersion.CSharp1); 1796document = document.Project.WithParseOptions(new CSharpParseOptions(languageVersion: CS.LanguageVersion.CSharp1)).GetRequiredDocument(documentId); 2363WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2389WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2419WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2448WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2477WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script)); 2508WithProjectParseOptions(projectId, new CSharpParseOptions(kind: SourceCodeKind.Script));
Microsoft.DotNet.GenFacades (2)
NotSupportedAssemblyGenerator.cs (1)
79syntaxTree = CSharpSyntaxTree.ParseText(File.ReadAllText(sourceFile), new CSharpParseOptions(languageVersion));
TypeParser.cs (1)
135CSharpParseOptions options = new CSharpParseOptions(languageVersion: languageVersion, preprocessorSymbols: constants);
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
82.WithParseOptions(new CSharpParseOptions(langVersion).WithPreprocessorSymbols(preprocessorSymbols))
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
82.WithParseOptions(new CSharpParseOptions(langVersion).WithPreprocessorSymbols(preprocessorSymbols))
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
82.WithParseOptions(new CSharpParseOptions(langVersion).WithPreprocessorSymbols(preprocessorSymbols))
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
82.WithParseOptions(new CSharpParseOptions(langVersion).WithPreprocessorSymbols(preprocessorSymbols))
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
82.WithParseOptions(new CSharpParseOptions(langVersion).WithPreprocessorSymbols(preprocessorSymbols))
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ChangeSignature\CSharpChangeSignatureViewModelFactoryService.cs (1)
21private static readonly CSharpParseOptions s_langVersionLatestParseOptions = new(LanguageVersion.Preview);
StackDepthTest (1)
Program.cs (1)
77var parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None);
1711 references to CSharpParseOptions
IdeCoreBenchmarks (1)
IncrementalSourceGeneratorBenchmarks.cs (1)
138new ISourceGenerator[] { generator }, parseOptions: CSharpParseOptions.Default);
Microsoft.Analyzers.Extra.Tests (2)
Resources\RoslynTestUtils.cs (2)
222CSharpParseOptions options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
Microsoft.Analyzers.Local.Tests (2)
Resources\RoslynTestUtils.cs (2)
222CSharpParseOptions options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
38internal static readonly CSharpParseOptions ParseOptions = new CSharpParseOptions(LanguageVersion.Preview).WithFeatures(new[] { new KeyValuePair<string, string>("InterceptorsPreviewNamespaces", "Microsoft.AspNetCore.Http.Generated") });
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
38internal static readonly CSharpParseOptions ParseOptions = new CSharpParseOptions(LanguageVersion.Preview).WithFeatures(new[] { new KeyValuePair<string, string>("InterceptorsPreviewNamespaces", "Microsoft.AspNetCore.Http.Generated") });
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (4)
CSharpCompiler.cs (4)
26private CSharpParseOptions? _parseOptions; 37public virtual CSharpParseOptions ParseOptions 209private static CSharpParseOptions GetParseOptions( 216var parseOptions = new CSharpParseOptions(preprocessorSymbols: (IEnumerable<string>)defines);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (2)
CSharpCompilerTest.cs (2)
82var parseOptions = compiler.ParseOptions; 124var parseOptions = compiler.ParseOptions;
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (4)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (2)
97var parseOptions = (CSharpParseOptions)base.CreateParseOptions();
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeRefactoringVerifier`1+Test.cs (2)
104var parseOptions = (CSharpParseOptions)base.CreateParseOptions();
Microsoft.CodeAnalysis.CSharp (122)
Binder\Binder_Operators.cs (2)
3227((CSharpParseOptions)node.SyntaxTree.Options).IsFeatureEnabled(MessageID.IDS_FeaturePatternMatching)) 3274if (wasUnderscore && ((CSharpParseOptions)node.SyntaxTree.Options).IsFeatureEnabled(MessageID.IDS_FeatureRecursivePatterns))
Binder\Binder_Statements.cs (1)
1289bool extensibleFixedEnabled = ((CSharpParseOptions)initializerOpt.SyntaxTree.Options)?.IsFeatureEnabled(MessageID.IDS_FeatureExtensibleFixedStatement) != false;
Binder\Binder_Symbols.cs (1)
2741if (feature.GetFeatureAvailabilityDiagnosticInfo((CSharpParseOptions)tree.Options) is { } diagInfo)
Binder\SwitchBinder.cs (1)
36((CSharpParseOptions)SwitchSyntax.SyntaxTree.Options)?.IsFeatureEnabled(MessageID.IDS_FeaturePatternMatching) != false;
CommandLine\CSharpCommandLineArguments.cs (1)
21public new CSharpParseOptions ParseOptions { get; internal set; }
CommandLine\CSharpCommandLineParser.cs (1)
1472var parseOptions = new CSharpParseOptions
CommandLine\CSharpCompiler.cs (7)
45var parseOptions = Arguments.ParseOptions; 49var scriptParseOptions = parseOptions.WithKind(SourceCodeKind.Script); 174CSharpParseOptions parseOptions, 175CSharpParseOptions scriptParseOptions, 202CSharpParseOptions parseOptions, 203CSharpParseOptions scriptParseOptions, 378return CSharpGeneratorDriver.Create(generators, additionalTexts, (CSharpParseOptions)parseOptions, analyzerConfigOptionsProvider, driverOptions: new GeneratorDriverOptions(disabledOutputs: IncrementalGeneratorOutputKind.Host, baseDirectory: baseDirectory));
Compilation\CSharpCompilation.cs (1)
534var version = ((CSharpParseOptions)tree.Options).LanguageVersion;
Compilation\CSharpCompilationExtensions.cs (1)
19return ((CSharpParseOptions?)syntax?.SyntaxTree.Options)?.IsFeatureEnabled(feature) == true;
Compilation\CSharpDeterministicKeyBuilder.cs (1)
42if (parseOptions is not CSharpParseOptions csharpOptions)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (1)
621SyntaxTriviaList leadingTrivia = SyntaxFactory.ParseLeadingTrivia(commentText, CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Diagnose));
CSharpParseOptions.cs (12)
17public sealed class CSharpParseOptions : ParseOptions, IEquatable<CSharpParseOptions> 22public static CSharpParseOptions Default { get; } = new CSharpParseOptions(); 77private CSharpParseOptions(CSharpParseOptions other) : this( 88public new CSharpParseOptions WithKind(SourceCodeKind kind) 99public CSharpParseOptions WithLanguageVersion(LanguageVersion version) 110public CSharpParseOptions WithPreprocessorSymbols(IEnumerable<string>? preprocessorSymbols) 115public CSharpParseOptions WithPreprocessorSymbols(params string[]? preprocessorSymbols) 120public CSharpParseOptions WithPreprocessorSymbols(ImmutableArray<string> symbols) 135public new CSharpParseOptions WithDocumentationMode(DocumentationMode documentationMode) 163public new CSharpParseOptions WithFeatures(IEnumerable<KeyValuePair<string, string>>? features) 273return this.Equals(obj as CSharpParseOptions); 276public bool Equals(CSharpParseOptions? other)
Errors\MessageID.cs (3)
409if (GetFeatureAvailabilityDiagnosticInfo(feature, (CSharpParseOptions)parseOptions) is { } diagInfo) 424if (GetFeatureAvailabilityDiagnosticInfo(feature, (CSharpParseOptions)parseOptions) is { } diagInfo) 446internal static CSDiagnosticInfo? GetFeatureAvailabilityDiagnosticInfo(this MessageID feature, CSharpParseOptions options)
Parser\LanguageParser_InterpolatedString.cs (1)
361CSharpParseOptions options,
Parser\Lexer.cs (3)
75private readonly CSharpParseOptions _options; 113public Lexer(SourceText text, CSharpParseOptions options, bool allowPreprocessorDirectives = true, bool interpolationFollowedByColon = false) 141public CSharpParseOptions Options
Parser\SyntaxParser.cs (1)
219public CSharpParseOptions Options
SourceGeneration\CSharpGeneratorDriver.cs (8)
23/// <param name="parseOptions">The <see cref="CSharpParseOptions"/> that should be used when parsing generated files.</param> 27internal CSharpGeneratorDriver(CSharpParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, GeneratorDriverOptions driverOptions) 58/// <param name="parseOptions">The <see cref="CSharpParseOptions"/> that should be used when parsing generated files, or <c>null</c> to use <see cref="CSharpParseOptions.Default"/></param> 62public static CSharpGeneratorDriver Create(IEnumerable<ISourceGenerator> generators, IEnumerable<AdditionalText>? additionalTexts = null, CSharpParseOptions? parseOptions = null, AnalyzerConfigOptionsProvider? optionsProvider = null, GeneratorDriverOptions driverOptions = default) 63=> new CSharpGeneratorDriver(parseOptions ?? CSharpParseOptions.Default, generators.ToImmutableArray(), optionsProvider ?? CompilerAnalyzerConfigOptionsProvider.Empty, additionalTexts.AsImmutableOrEmpty(), driverOptions); 67public static CSharpGeneratorDriver Create(IEnumerable<ISourceGenerator> generators, IEnumerable<AdditionalText>? additionalTexts, CSharpParseOptions? parseOptions, AnalyzerConfigOptionsProvider? optionsProvider) 71=> CSharpSyntaxTree.ParseTextLazy(input.Text, (CSharpParseOptions)_state.ParseOptions, fileName);
Symbols\Source\LocalFunctionSymbol.cs (1)
397var diagnosticInfo = MessageID.IDS_FeatureLocalFunctionAttributes.GetFeatureAvailabilityDiagnosticInfo((CSharpParseOptions)syntaxReferenceOpt.SyntaxTree.Options);
Symbols\Source\ModifierUtils.cs (3)
122if (MessageID.IDS_FeatureRefFields.GetFeatureAvailabilityDiagnosticInfo((CSharpParseOptions)syntax.SyntaxTree.Options) is { } diagnosticInfo) 153LanguageVersion availableVersion = ((CSharpParseOptions)errorLocation.SourceTree.Options).LanguageVersion; 217LanguageVersion availableVersion = ((CSharpParseOptions)location.SourceTree.Options).LanguageVersion;
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4460var languageVersion = ((CSharpParseOptions)this.GetFirstLocation().SourceTree!.Options).LanguageVersion;
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1023var interceptorsNamespaces = ((CSharpParseOptions)attributeNameSyntax.SyntaxTree.Options).InterceptorsNamespaces; 1173var interceptorsNamespaces = ((CSharpParseOptions)attributeSyntax.SyntaxTree.Options).InterceptorsNamespaces;
Symbols\Source\SourceModuleSymbol.cs (3)
346ImmutableArray<ImmutableArray<string>> interceptorsNamespaces = ((CSharpParseOptions)location.SourceTree.Options).InterceptorsNamespaces; 600var options = (CSharpParseOptions?)compilation.SyntaxTrees.FirstOrDefault()?.Options;
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
464var options = (CSharpParseOptions)SyntaxTree.Options;
Symbols\Source\SourcePropertySymbol.cs (2)
52((CSharpParseOptions)syntax.SyntaxTree.Options).IsFeatureEnabled(MessageID.IDS_FeatureFieldKeyword)); 452LanguageVersion availableVersion = ((CSharpParseOptions)location.SourceTree.Options).LanguageVersion;
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
169LanguageVersion availableVersion = ((CSharpParseOptions)location.SourceTree.Options).LanguageVersion;
Symbols\Symbol_Attributes.cs (2)
696var parseOptions = (CSharpParseOptions)targetOpt.SyntaxTree.Options;
Syntax\CSharpSyntaxTree.cs (18)
57public new abstract CSharpParseOptions Options { get; } 314public static SyntaxTree Create(CSharpSyntaxNode root, CSharpParseOptions? options = null, string? path = "", Encoding? encoding = null) 332CSharpParseOptions? options, 350options: options ?? CSharpParseOptions.Default, 359CSharpParseOptions options, 380internal static SyntaxTree CreateForDebugger(CSharpSyntaxNode root, SourceText text, CSharpParseOptions options) 393/// <para>NOTE: Do not use this method elsewhere, instead use <see cref="Create(CSharpSyntaxNode, CSharpParseOptions, string, Encoding)"/> method for creating a syntax tree.</para> 404options: CSharpParseOptions.Default, 417CSharpParseOptions? options = null, 420return new LazySyntaxTree(text, options ?? CSharpParseOptions.Default, path, diagnosticOptions: null); 432CSharpParseOptions? options = null, 453CSharpParseOptions? options, 472CSharpParseOptions? options = null, 492CSharpParseOptions? options, 503options = options ?? CSharpParseOptions.Default; 912CSharpParseOptions? options, 923CSharpParseOptions? options, 935CSharpParseOptions? options,
Syntax\CSharpSyntaxTree.DebuggerSyntaxTree.cs (1)
16public DebuggerSyntaxTree(CSharpSyntaxNode root, SourceText text, CSharpParseOptions options)
Syntax\CSharpSyntaxTree.Dummy.cs (3)
54public override CSharpParseOptions Options 56get { return CSharpParseOptions.Default; } 95=> Create((CSharpSyntaxNode)root, (CSharpParseOptions)options, FilePath, Encoding, ChecksumAlgorithm);
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (4)
20private readonly CSharpParseOptions _options; 27CSharpParseOptions options, 93public override CSharpParseOptions Options 121(CSharpParseOptions)options,
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (4)
22private readonly CSharpParseOptions _options; 36CSharpParseOptions options, 107public override CSharpParseOptions Options 135(CSharpParseOptions)options,
Syntax\SyntaxFactory.cs (29)
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); 1584return ParseLeadingTrivia(text, CSharpParseOptions.Default, offset); 1590internal static SyntaxTriviaList ParseLeadingTrivia(string text, CSharpParseOptions options, int offset = 0) 1603using (var lexer = new InternalSyntax.Lexer(MakeSourceText(text, offset), CSharpParseOptions.Default)) 1622SyntaxTriviaList leadingTrivia = ParseLeadingTrivia(commentText, CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Diagnose)); 1640using (var lexer = new InternalSyntax.Lexer(MakeSourceText(text, offset), CSharpParseOptions.Default)) 1656public static IEnumerable<SyntaxToken> ParseTokens(string text, int offset = 0, int initialTokenPosition = 0, CSharpParseOptions? options = null) 1658using (var lexer = new InternalSyntax.Lexer(MakeSourceText(text, offset), options ?? CSharpParseOptions.Default)) 1682public static SyntaxTokenParser CreateTokenParser(SourceText sourceText, CSharpParseOptions? options = null) 1684return new SyntaxTokenParser(new InternalSyntax.Lexer(sourceText, options ?? CSharpParseOptions.Default)); 1716using (var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options)) 1735using (var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options)) 1754using (var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options)) 1774using (var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options)) 1795public static CompilationUnitSyntax ParseCompilationUnit(string text, int offset = 0, CSharpParseOptions? options = null) 1817using (var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options)) 1836using (var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options)) 1855using (var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options)) 1874using (var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options)) 1893using var lexer = MakeLexer(text, offset, (CSharpParseOptions?)options); 1916private static InternalSyntax.Lexer MakeLexer(string text, int offset, CSharpParseOptions? options = null) 1920options: options ?? CSharpParseOptions.Default); 2803return CSharpSyntaxTree.ParseText(text, (CSharpParseOptions?)options, path, diagnosticOptions, isGeneratedCode: null, cancellationToken); 2832return CSharpSyntaxTree.ParseText(text, (CSharpParseOptions?)options, path, diagnosticOptions, isGeneratedCode, cancellationToken);
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
71var csOptions = (CSharpParseOptions)syntaxTree.Options;
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (2)
42var parseOptions = (CSharpParseOptions)syntaxTree.Options;
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
45var parseOptions = (CSharpParseOptions)syntaxTree.Options;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
20CSharpParseOptions parseOptions,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParseOptionsExtensions.cs (1)
10=> ((CSharpParseOptions)options).LanguageVersion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
24=> ((CSharpParseOptions)node.SyntaxTree.Options).LanguageVersion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\CSharpInferredMemberNameSimplifier.cs (1)
13internal static bool CanSimplifyTupleElementName(ArgumentSyntax node, CSharpParseOptions parseOptions)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (4)
93var parseOptions = (CSharpParseOptions)project.ParseOptions!; 108var parseOptions = (CSharpParseOptions)project.ParseOptions!;
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (2)
50var parseOptions = (CSharpParseOptions)originalRoot.SyntaxTree.Options;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
38=> new(context, (CSharpCodeGenerationOptions)options, this, ((CSharpParseOptions)parseOptions).LanguageVersion);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
167=> ((CSharpParseOptions)options).LanguageVersion >= LanguageVersion.CSharp7;
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (72)
src\Analyzers\CSharp\Tests\DocumentationComments\AddDocCommentNodesCodeFixProviderTests.cs (2)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular); 33var parseOptions = Regular.WithDocumentationMode(DocumentationMode.Diagnose);
src\Analyzers\CSharp\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.cs (2)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular); 33var parseOptions = Regular.WithDocumentationMode(DocumentationMode.Diagnose);
src\Analyzers\CSharp\Tests\InlineDeclaration\CSharpInlineDeclarationTests.cs (2)
217""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 2446""", CSharpParseOptions.Default);
src\Analyzers\CSharp\Tests\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessTests.cs (1)
142""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
src\Analyzers\CSharp\Tests\MakeFieldReadonly\MakeFieldReadonlyTests.cs (1)
24private static readonly ParseOptions s_strictFeatureFlag = CSharpParseOptions.Default.WithFeatures([KeyValuePairUtil.Create("strict", "true")]);
src\Analyzers\CSharp\Tests\MakeLocalFunctionStatic\MakeLocalFunctionStaticTests.cs (2)
30private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 31private static readonly ParseOptions CSharp8ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
src\Analyzers\CSharp\Tests\MakeMethodAsynchronous\MakeMethodAsynchronousTests.cs (1)
92await TestAsync(initial, expected, parseOptions: CSharpParseOptions.Default,
src\Analyzers\CSharp\Tests\MakeRefStruct\MakeRefStructTests.cs (3)
24private static readonly CSharpParseOptions s_parseOptions = 25CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3); 75await TestMissingInRegularAndScriptAsync(text, new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)));
src\Analyzers\CSharp\Tests\MisplacedUsingDirectives\MisplacedUsingDirectivesTests.cs (1)
88initialMarkup, expectedMarkup, options: options, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (2)
8946parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 8969parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueExpressionStatementTests.cs (1)
83parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\ReplaceDefaultLiteral\ReplaceDefaultLiteralTests.cs (2)
49parseOptions: CSharpParseOptions.Default.WithLanguageVersion(version)); 58new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(version)));
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (1)
47p => Assert.Equal(expected, ((CSharpParseOptions)p.ParseOptions!).SpecifiedLanguageVersion));
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests.cs (4)
24private readonly ParseOptions CSharp12 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12); 448CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 468""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5))); 514""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests_Field.cs (2)
16private readonly ParseOptions CSharp13 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp13); 17private readonly ParseOptions Preview = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.cs (7)
21private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 22private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 167""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 1012""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1078""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1113""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1148""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion)));
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (2)
499""", CSharpParseOptions.Default, options: ImplicitTypeEverywhere()); 3326""", CSharpParseOptions.Default, options: ImplicitTypeEverywhere());
src\Analyzers\CSharp\Tests\UseInferredMemberName\UseInferredMemberNameTests.cs (4)
29private static readonly CSharpParseOptions s_parseOptions = 30CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Latest); 87""", count: 0, parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 103""", count: 0, parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7)));
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForCastAndEqualityOperatorTests.cs (7)
95new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 115new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 175""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 205""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 235""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 265""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 283""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForReferenceEqualsTests.cs (6)
26private static readonly ParseOptions CSharp7 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7); 27private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 28private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 99new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 119new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 287""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseLocalFunction\UseLocalFunctionTests.cs (4)
29private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 53""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 4165parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10)); 4181new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests.cs (10)
84""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(version))); 102""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 1170""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1209""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1475""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1506""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1561""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1593""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1656""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1698""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests_FixAllTests.cs (2)
72""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 129""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
77""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseThrowExpression\UseThrowExpressionTests.cs (1)
150""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Features\CSharpTest\Diagnostics\AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor.cs (1)
16private static readonly CSharpParseOptions Script = new CSharpParseOptions(kind: SourceCodeKind.Script);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (6)
AutomaticCompletion\AutomaticLineEnderCommandHandler.cs (5)
179BaseFieldDeclarationSyntax => SyntaxFactory.ParseCompilationUnit(WrapInType(textToParse), options: (CSharpParseOptions)tree.Options), 180BaseMethodDeclarationSyntax => SyntaxFactory.ParseCompilationUnit(WrapInType(textToParse), options: (CSharpParseOptions)tree.Options), 181BasePropertyDeclarationSyntax => SyntaxFactory.ParseCompilationUnit(WrapInType(textToParse), options: (CSharpParseOptions)tree.Options), 182StatementSyntax => SyntaxFactory.ParseStatement(textToParse, options: (CSharpParseOptions)tree.Options), 183UsingDirectiveSyntax => SyntaxFactory.ParseCompilationUnit(textToParse, options: (CSharpParseOptions)tree.Options),
Interactive\CSharpInteractiveEvaluatorLanguageInfoProvider.cs (1)
23private static readonly CSharpParseOptions s_parseOptions =
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (52)
CodeActions\AddUsing\AddUsingTests.cs (4)
2716var options = new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose); 2738var options = new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose); 2786var options = new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose); 2824var options = new CSharpParseOptions(documentationMode: DocumentationMode.Diagnose);
CodeActions\GenerateType\GenerateTypeTests.cs (1)
4956parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10),
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (2)
3240var options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Latest);
Debugging\LocationInfoGetterTests.cs (1)
22private static async Task TestAsync(string markup, string expectedName, int expectedLineOffset, CSharpParseOptions parseOptions = null)
Extensions\ContextQuery\AbstractContextTests.cs (10)
16private void VerifyWorker(string markup, bool validLocation, CSharpParseOptions options = null) 33CSharpParseOptions options) 44private void VerifyInFrontOfComment(string text, int position, bool validLocation, CSharpParseOptions options) 47private void VerifyInFrontOfComment_TypePartiallyWritten(string text, int position, bool validLocation, CSharpParseOptions options) 55CSharpParseOptions options) 65private void VerifyAtPosition(string text, int position, bool validLocation, CSharpParseOptions options) 68private void VerifyAtPosition_TypePartiallyWritten(string text, int position, bool validLocation, CSharpParseOptions options) 76CSharpParseOptions options) 92private void VerifyAtEndOfFile(string text, int position, bool validLocation, CSharpParseOptions options) 95private void VerifyAtEndOfFile_TypePartiallyWritten(string text, int position, bool validLocation, CSharpParseOptions options)
ExtractInterface\ExtractInterfaceTests.cs (4)
500parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10), 540parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9), 581parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10), 892parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10),
ExtractMethod\ExtractMethodBase.cs (3)
45CSharpParseOptions parseOptions = null) 79CSharpParseOptions parseOptions = null) 161protected static async Task TestSelectionAsync(string codeWithMarker, bool expectedFail = false, CSharpParseOptions parseOptions = null, TextSpan? textSpanOverride = null)
Formatting\FormattingEngineTests.cs (6)
2713AssertFormatWithView(expected, code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2738AssertFormatWithView(expected, code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2763AssertFormatWithView(expected, code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2783AssertFormatAfterTypeChar(code, expected, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2803AssertFormatAfterTypeChar(code, expected, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 2823AssertFormatAfterTypeChar(code, expected, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12));
Formatting\Indentation\SmartIndenterTests.cs (13)
3331options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 3351options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 3372options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 3393options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 3438CSharpParseOptions options = null, 3449CSharpParseOptions options, 3456foreach (var option in optionsSet) 3493CSharpParseOptions options = null, 3505CSharpParseOptions options, 3512foreach (var option in optionsSet) 3523CSharpParseOptions options = null, 3534CSharpParseOptions options, 3541foreach (var option in optionsSet)
GenerateConstructorFromMembers\GenerateConstructorFromMembersTests.cs (1)
1386parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6),
GoToAdjacentMember\CSharpGoToAdjacentMemberTests.cs (1)
20protected override ParseOptions DefaultParseOptions => CSharpParseOptions.Default;
LineSeparators\LineSeparatorTests.cs (1)
595private static async Task AssertTagsOnBracesOrSemicolonsTokensAsync(string contents, int[] tokenIndices, CSharpParseOptions? options = null)
Organizing\AbstractOrganizerTests.cs (1)
26protected static async Task CheckAsync(string initial, string final, CSharpParseOptions options)
QuickInfo\DiagnosticAnalyzerQuickInfoSourceTests.cs (1)
207CSharpParseOptions parseOptions = null)
QuickInfo\SemanticQuickInfoSourceTests.cs (1)
28private static async Task TestWithOptionsAsync(CSharpParseOptions options, string markup, params Action<QuickInfoItem>[] expectedResults)
QuickInfo\SyntacticQuickInfoSourceTests.cs (1)
599CSharpParseOptions parseOptions = null)
TextStructureNavigation\TextStructureNavigatorTests.cs (1)
505CSharpParseOptions? options)
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (17)
Recommendations\RecommenderTests.cs (17)
25protected static readonly CSharpParseOptions CSharp9ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 30internal async Task VerifyWorkerAsync(string markup, bool absent, CSharpParseOptions? options = null, int? matchPriority = null) 46CSharpParseOptions? options, 56private Task CheckResultAsync(string text, int position, bool absent, CSharpParseOptions? options, int? matchPriority) 108private Task VerifyInFrontOfCommentAsync(string text, int cursorPosition, bool absent, CSharpParseOptions? options, int? matchPriority) 111private Task VerifyInFrontOfComment_KeywordPartiallyWrittenAsync(string text, int position, bool absent, CSharpParseOptions? options, int? matchPriority) 119CSharpParseOptions? options, 129private Task VerifyAtPositionAsync(string text, int position, bool absent, CSharpParseOptions? options, int? matchPriority) 132private Task VerifyAtPosition_KeywordPartiallyWrittenAsync(string text, int position, bool absent, CSharpParseOptions? options, int? matchPriority) 140CSharpParseOptions? options, 156private Task VerifyAtEndOfFileAsync(string text, int position, bool absent, CSharpParseOptions? options, int? matchPriority) 159private Task VerifyAtEndOfFile_KeywordPartiallyWrittenAsync(string text, int position, bool absent, CSharpParseOptions? options, int? matchPriority) 164CSharpParseOptions? options = null, 165CSharpParseOptions? scriptOptions = null) 188CSharpParseOptions? options = null, 189CSharpParseOptions? scriptOptions = null)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (39)
CodeGen\CodeGenAsyncIteratorTests.cs (2)
140private CSharpCompilation CreateCompilationWithAsyncIterator(string source, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 144private CSharpCompilation CreateCompilationWithAsyncIterator(CSharpTestSource source, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null)
CodeGen\CodeGenConstructorInitTests.cs (1)
1209var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
CodeGen\CodeGenDynamicTests.cs (2)
35CSharpParseOptions parseOptions = null, 62private readonly CSharpParseOptions _localFunctionParseOptions = TestOptions.Regular;
CodeGen\CodeGenExprLambdaTests.cs (1)
23CSharpParseOptions parseOptions = null,
CodeGen\CodeGenIterators.cs (1)
2389var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
CodeGen\CodeGenReadOnlySpanConstructionTest.cs (2)
763var parseOptions = CSharpParseOptions.Default.WithPEVerifyCompatFeature();
CodeGen\CodeGenReadonlyStructTests.cs (3)
2557public static TheoryData<bool, CSharpParseOptions, Verification> ReadOnlyGetter_LangVersion_Data() => 2558new TheoryData<bool, CSharpParseOptions, Verification> 2566public void ReadOnlyGetter_LangVersion(bool isReadOnly, CSharpParseOptions parseOptions, Verification verify)
CodeGen\CodeGenTests.cs (1)
33var parseOptions = TestOptions.RegularWithDocumentationComments;
CodeGen\CodeGenTupleTest.cs (2)
24009var tree = SyntaxFactory.ParseSyntaxTree(text, CSharpParseOptions.Default); 25315var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
CodeGen\EventTests.cs (1)
645var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
CodeGen\WinMdDelegateTests.cs (1)
57parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview));
Emit\CompilationEmitTests.cs (20)
262", assemblyName: "test", parseOptions: CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.None)); 307", assemblyName: "test", parseOptions: CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.None)); 353", assemblyName: "test", parseOptions: CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Diagnose)); 407", assemblyName: "test", parseOptions: CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Diagnose)); 463", assemblyName: "test", parseOptions: CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Diagnose)); 516", assemblyName: "test", parseOptions: CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Parse)); 2130var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 2261var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 2328var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 2395var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 2455var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 2500var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 4672var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 4757var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 4802var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 4858var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 4889var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 4937var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 4966var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 5014var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (1)
3641private CompilationVerifier CompileAndVerify(string source, string expectedOutput = null, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null, Verification verify = default)
Emit\EntryPointTests.cs (1)
16private CSharpCompilation CompileConsoleApp(string source, CSharpParseOptions parseOptions = null, string mainTypeName = null)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (22)
Emit\EditAndContinue\AssemblyReferencesTests.cs (1)
136var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Emit\EditAndContinue\EditAndContinueClosureTests.cs (2)
817}", options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 834}", options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
Emit\EditAndContinue\EditAndContinueStateMachineTests.cs (1)
46var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Emit\EditAndContinue\EditAndContinueTest.cs (1)
28private readonly CSharpParseOptions _parseOptions = parseOptions ?? TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Emit\EditAndContinue\EditAndContinueTestBase.cs (3)
47internal static SourceWithMarkedNodes MarkedSource(string markedSource, string fileName = "", CSharpParseOptions options = null, bool removeTags = false) 266var previousParseOptions = (CSharpParseOptions)compilation.SyntaxTrees.FirstOrDefault()?.Options;
Emit\EditAndContinue\EditAndContinueTests.cs (1)
7633var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Emit\EditAndContinue\LocalSlotMappingTests.cs (5)
751var asyncStreamsTree = Parse(AsyncStreamsTypes, options: (CSharpParseOptions)source0.Tree.Options); 842var asyncStreamsTree = Parse(AsyncStreamsTypes, options: (CSharpParseOptions)source0.Tree.Options); 5048var source0 = MarkedSource(sourceText, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 5049var source1 = MarkedSource(sourceText, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 5050var source2 = MarkedSource(sourceText, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
Emit\NumericIntPtrTests.cs (1)
10325var parseOptions = (useCSharp11 ? TestOptions.Regular11 : TestOptions.Regular10).WithNoRefSafetyRulesAttribute();
PDB\CSharpDeterministicBuildCompilationTests.cs (6)
97public void PortablePdb_DeterministicCompilation(CSharpCompilationOptions compilationOptions, EmitOptions emitOptions, CSharpParseOptions parseOptions) 157public void PortablePdb_DeterministicCompilation_DuplicateFilePaths(CSharpCompilationOptions compilationOptions, EmitOptions emitOptions, CSharpParseOptions parseOptions) 221public void PortablePdb_DeterministicCompilationWithSJIS(CSharpCompilationOptions compilationOptions, EmitOptions emitOptions, CSharpParseOptions parseOptions) 289foreach (var parseOptions in GetCSharpParseOptions()) 350private static IEnumerable<CSharpParseOptions> GetCSharpParseOptions() 352var parseOptions = new CSharpParseOptions(
PDB\CSharpPDBTestBase.cs (1)
20public static void TestSequencePoints(string markup, CSharpCompilationOptions compilationOptions, CSharpParseOptions parseOptions = null, string methodName = "")
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (137)
Attributes\AttributeTests_Dynamic.cs (2)
1188var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 1225var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Attributes\AttributeTests_Nullable.cs (4)
746var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 3471var parseOptions = TestOptions.Regular8; 3516var parseOptions = TestOptions.Regular8; 3632var parseOptions = TestOptions.Regular8;
Attributes\AttributeTests_NullablePublicOnly.cs (17)
32var parseOptions = TestOptions.Regular8; 57var parseOptions = TestOptions.Regular8; 84var parseOptions = TestOptions.Regular8; 100var parseOptions = TestOptions.Regular8; 120var parseOptions = TestOptions.Regular7; 140var parseOptions = TestOptions.Regular8; 160var parseOptions = TestOptions.Regular8; 180var parseOptions = TestOptions.Regular8; 200var parseOptions = TestOptions.Regular8; 217var parseOptions = TestOptions.Regular8; 271var parseOptions = TestOptions.Regular8; 291var parseOptions = TestOptions.Regular8; 310var parseOptions = TestOptions.Regular8; 330var parseOptions = TestOptions.Regular8; 354var parseOptions = TestOptions.Regular8; 377var parseOptions = TestOptions.Regular8; 566var parseOptions = TestOptions.Regular8;
Attributes\AttributeTests_Synthesized.cs (4)
1122var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 1196var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 1234var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 1914var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Attributes\AttributeTests_Tuples.cs (2)
175var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 213var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Attributes\AttributeTests_WellKnownAttributes.cs (3)
5141var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 10412private CompilationVerifier CompileAndVerifyWithSkipLocalsInit(string src, CSharpCompilationOptions options, CSharpParseOptions parseOptions = null, Verification? verify = null) 10426private CompilationVerifier CompileAndVerifyWithSkipLocalsInit(string src, CSharpParseOptions parseOptions = null, Verification? verify = null)
Attributes\InternalsVisibleToAndStrongNameTests.cs (94)
74public void AssemblyKeyFileAttributeNotExistFile(CSharpParseOptions parseOptions) 104public void PubKeyFromKeyFileAttribute(CSharpParseOptions parseOptions) 132public void PubKeyFromKeyFileAttribute_AssemblyKeyFileResolver(CSharpParseOptions parseOptions) 161public void PubKeyFromKeyFileAttribute_AssemblyKeyFileResolver_RelativeToCurrentParent(CSharpParseOptions parseOptions) 250public void PubKeyFromKeyContainerAttribute(CSharpParseOptions parseOptions) 278public void PubKeyFromKeyFileOptions(CSharpParseOptions parseOptions) 289public void PubKeyFromKeyFileOptions_ReferenceResolver(CSharpParseOptions parseOptions) 319public void PubKeyFromKeyFileOptionsJustPublicKey(CSharpParseOptions parseOptions) 331public void PubKeyFromKeyFileOptionsJustPublicKey_ReferenceResolver(CSharpParseOptions parseOptions) 365public void PubKeyFileNotFoundOptions(CSharpParseOptions parseOptions) 378public void PubKeyFileBogusOptions(CSharpParseOptions parseOptions) 393public void PubKeyContainerBogusOptions(CSharpParseOptions parseOptions) 411public void KeyFileAttributeOptionConflict(CSharpParseOptions parseOptions) 423public void KeyContainerAttributeOptionConflict(CSharpParseOptions parseOptions) 435public void KeyContainerSigningTempPathMissing(CSharpParseOptions parseOptions) 449public void KeyFileAttributeEmpty(CSharpParseOptions parseOptions) 460public void KeyContainerEmpty(CSharpParseOptions parseOptions) 471public void PublicKeyFromOptions_DelaySigned(CSharpParseOptions parseOptions) 492public void PublicKeyFromOptions_PublicSign(CSharpParseOptions parseOptions) 551public void KeyFileFromAttributes_PublicSign(CSharpParseOptions parseOptions) 571public void KeyContainerFromAttributes_PublicSign(CSharpParseOptions parseOptions) 604public void SnkFile_PublicSign(CSharpParseOptions parseOptions) 626public void PublicKeyFile_PublicSign(CSharpParseOptions parseOptions) 648public void PublicSign_DelaySignAttribute(CSharpParseOptions parseOptions) 674public void KeyContainerNoSNProvider_PublicSign(CSharpParseOptions parseOptions) 691public void KeyContainerDesktopProvider_PublicSign(CSharpParseOptions parseOptions) 713public void PublicSignAndDelaySign(CSharpParseOptions parseOptions) 734public void PublicSignAndDelaySignFalse(CSharpParseOptions parseOptions) 753public void PublicSignNoKey(CSharpParseOptions parseOptions) 768public void PublicKeyFromOptions_InvalidCompilationOptions(CSharpParseOptions parseOptions) 793public void IVTBasicCompilation(CSharpParseOptions parseOptions) 844public void IVTBasicMetadata(CSharpParseOptions parseOptions) 893public void IVTSigned(CSharpParseOptions parseOptions) 926public void IVTNotBothSigned_CStoCS(CSharpParseOptions parseOptions) 960public void CS0281Method(CSharpParseOptions parseOptions) 1010public void CS0281Class(CSharpParseOptions parseOptions) 1044public void IVTNotBothSigned_VBtoCS(CSharpParseOptions parseOptions) 1085public void IVTDeferredSuccess(CSharpParseOptions parseOptions) 1115public void IVTDeferredFailSignMismatch(CSharpParseOptions parseOptions) 1144public void IVTDeferredFailSignMismatch_AssemblyKeyName(CSharpParseOptions parseOptions) 1174public void IVTDeferredFailKeyMismatch(CSharpParseOptions parseOptions) 1209public void IVTDeferredFailKeyMismatch_AssemblyKeyName(CSharpParseOptions parseOptions) 1250public void IVTSuccessThroughIAssembly(CSharpParseOptions parseOptions) 1280public void IVTDeferredFailKeyMismatchIAssembly(CSharpParseOptions parseOptions) 1316public void IVTDeferredFailKeyMismatchIAssembly_AssemblyKeyName(CSharpParseOptions parseOptions) 1359public void IVTGivesAccessToUsingDifferentKeys(CSharpParseOptions parseOptions) 1396public void IVTHasCulture(CSharpParseOptions parseOptions) 1413public void IVTNoKey(CSharpParseOptions parseOptions) 1434public void MaxSizeKey(CSharpParseOptions parseOptions) 1494public void SignIt(CSharpParseOptions parseOptions) 1523private void ConfirmModuleAttributePresentAndAddingToAssemblyResultsInSignedOutput(MemoryStream moduleContents, AttributeDescription expectedModuleAttr, CSharpParseOptions parseOptions) 1571public void SignModuleKeyFileAttr(CSharpParseOptions parseOptions) 1585public void SignModuleKeyContainerAttr(CSharpParseOptions parseOptions) 1598public void SignModuleKeyContainerBogus(CSharpParseOptions parseOptions) 1621public void SignModuleKeyFileBogus(CSharpParseOptions parseOptions) 1638public void AttemptToStrongNameWithOnlyPublicKey(CSharpParseOptions parseOptions) 1657public void SignModuleKeyContainerCmdLine(CSharpParseOptions parseOptions) 1674public void SignModuleKeyContainerCmdLine_1(CSharpParseOptions parseOptions) 1694public void SignModuleKeyContainerCmdLine_2(CSharpParseOptions parseOptions) 1714public void SignModuleKeyFileCmdLine(CSharpParseOptions parseOptions) 1730public void BothLegacyAndNonLegacyGiveTheSameOutput(CSharpParseOptions parseOptions) 1751public void SignRefAssemblyKeyFileCmdLine(CSharpParseOptions parseOptions) 1773public void SignModuleKeyFileCmdLine_1(CSharpParseOptions parseOptions) 1791public void SignModuleKeyFileCmdLine_2(CSharpParseOptions parseOptions) 1808public void SignItWithOnlyPublicKey(CSharpParseOptions parseOptions) 1834public void AssemblySignatureKeyOnNetModule(CSharpParseOptions parseOptions) 1858public void DelaySignItWithOnlyPublicKey(CSharpParseOptions parseOptions) 1877public void DelaySignButNoKey(CSharpParseOptions parseOptions) 1899public void SignInMemory(CSharpParseOptions parseOptions) 1915public void DelaySignConflict(CSharpParseOptions parseOptions) 1934public void DelaySignNoConflict(CSharpParseOptions parseOptions) 1953public void DelaySignWithAssemblySignatureKey(CSharpParseOptions parseOptions) 1997public void InvalidAssemblyName(CSharpParseOptions parseOptions) 2039public void IvtVirtualCall1(CSharpParseOptions parseOptions) 2147public void IvtVirtualCall2(CSharpParseOptions parseOptions) 2269public void IvtVirtual_ParamsAndDynamic(CSharpParseOptions parseOptions) 2395public void Bug529779_1(CSharpParseOptions parseOptions) 2423public void Bug529779_2(CSharpParseOptions parseOptions) 2499public void AssemblySignatureKeyAttribute_1(CSharpParseOptions parseOptions) 2528public void AssemblySignatureKeyAttribute_2(CSharpParseOptions parseOptions) 2557public void AssemblySignatureKeyAttribute_3(CSharpParseOptions parseOptions) 2587public void AssemblySignatureKeyAttribute_4(CSharpParseOptions parseOptions) 2619public void AssemblySignatureKeyAttribute_5(CSharpParseOptions parseOptions) 2644public void AssemblySignatureKeyAttribute_6(CSharpParseOptions parseOptions) 2674public void AssemblySignatureKeyAttribute_7(CSharpParseOptions parseOptions) 2700public void Bug781312(CSharpParseOptions parseOptions) 2734public void Bug1072350(CSharpParseOptions parseOptions) 2762public void Bug1072339(CSharpParseOptions parseOptions) 2790public void Bug1095618(CSharpParseOptions parseOptions) 2811public void ConsistentErrorMessageWhenProvidingNullKeyFile(CSharpParseOptions parseOptions) 2823public void ConsistentErrorMessageWhenProvidingEmptyKeyFile(CSharpParseOptions parseOptions) 2834public void ConsistentErrorMessageWhenProvidingNullKeyFile_PublicSign(CSharpParseOptions parseOptions) 2846public void ConsistentErrorMessageWhenProvidingEmptyKeyFile_PublicSign(CSharpParseOptions parseOptions) 2887public void IVT_Circularity(CSharpParseOptions parseOptions)
Diagnostics\GetDiagnosticsTests.cs (3)
455var parseOptions1 = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "1" }); 456var parseOptions2 = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "2" }); 481var parseOptions = new CSharpParseOptions(LanguageVersion.Latest);
Diagnostics\OperationAnalyzerTests.cs (1)
22private static readonly CSharpParseOptions patternParseOptions = TestOptions.Regular;
FieldKeywordTests.cs (1)
8027var parseOptions = TestOptions.RegularNext;
FirstClassSpanTests.cs (2)
6194void verifyWithMissing(string source2, CSharpParseOptions parseOptions, params DiagnosticDescription[] expected) 6267void verifyWithMissing(string source2, CSharpParseOptions parseOptions, params DiagnosticDescription[] expected)
Semantics\CollectionExpressionTests.cs (3)
1431void verify(CSharpParseOptions parseOptions, string expectedType) 9319var parseOptions = TestOptions.RegularPreview; 9350var parseOptions = TestOptions.RegularPreview;
Semantics\InlineArrayTests.cs (1)
23340foreach (var parseOptions in new[] { TestOptions.Regular12, TestOptions.Regular13, TestOptions.RegularPreview })
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (1)
EndToEndTests.cs (1)
796var parseOptions = TestOptions.RegularPreview;
Microsoft.CodeAnalysis.CSharp.Features (19)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
64ParseOptions: CSharpParseOptions { LanguageVersion: >= LanguageVersion.CSharp8 },
MetadataAsSource\CSharpMetadataAsSourceService.cs (2)
104var options = (CSharpParseOptions)tree.Options;
QuickInfo\CSharpSemanticQuickInfoProvider.cs (2)
88var parseOptions = (CSharpParseOptions)semanticModel.SyntaxTree!.Options;
SemanticSearch\CSharpSemanticSearchUtilities.cs (2)
11public static readonly CSharpParseOptions ParseOptions = CSharpParseOptions.Default;
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (2)
71var csOptions = (CSharpParseOptions)syntaxTree.Options;
src\Analyzers\CSharp\Analyzers\UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs (2)
42var parseOptions = (CSharpParseOptions)syntaxTree.Options;
src\Analyzers\CSharp\Analyzers\UseInferredMemberName\CSharpUseInferredMemberNameDiagnosticAnalyzer.cs (2)
45var parseOptions = (CSharpParseOptions)syntaxTree.Options;
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (4)
93var parseOptions = (CSharpParseOptions)project.ParseOptions!; 108var parseOptions = (CSharpParseOptions)project.ParseOptions!;
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (2)
50var parseOptions = (CSharpParseOptions)originalRoot.SyntaxTree.Options;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (125)
ConvertAnonymousType\ConvertAnonymousTypeToClassTests.cs (1)
20private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
ConvertLocalFunctionToMethod\ConvertLocalFunctionToMethodTests.cs (2)
375""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 414""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7));
Diagnostics\AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor.cs (1)
16private static readonly CSharpParseOptions Script = new CSharpParseOptions(kind: SourceCodeKind.Script);
Diagnostics\Suppression\SuppressionAllCodeTests.cs (3)
28=> TestWorkspace.CreateCSharp(definition, (CSharpParseOptions)parseOptions, composition: s_compositionWithMockDiagnosticUpdateSourceRegistrationService); 36=> await TestPragmaAsync(TestResource.AllInOneCSharpCode, CSharpParseOptions.Default, verifier: t => t.IndexOf("#pragma warning disable", StringComparison.Ordinal) >= 0); 43CSharpParseOptions.Default,
Diagnostics\Suppression\SuppressionTests.cs (1)
658// comment", CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Diagnose));
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
456var experimental = TestOptions.Regular.WithFeatures(experimentalFeatures); 506var experimental = TestOptions.Regular.WithFeatures(featuresToEnable);
EditAndContinue\Helpers\EditingTestBase.cs (1)
132CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12),
ExtractClass\ExtractClassTests.cs (1)
51var unusedParseOptions = new CSharpParseOptions(LanguageVersion.CSharp1);
ExtractMethod\ExtractMethodTests2.cs (2)
5119""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 5148""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)));
GenerateVariable\GenerateVariableTests.cs (3)
10002""" + TestResources.NetFX.ValueTuple.tuplelib_cs, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 10046""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)); 10092""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12));
InlineTemporary\InlineTemporaryTests.cs (5)
271CSharpParseOptions.Default); 411""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion)); 441""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion)); 5669""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 5810await TestInRegularAndScriptAsync(code, expected, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
IntroduceParameter\IntroduceParameterTests.cs (14)
436await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 480await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 524await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 568await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 630await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 692await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 754await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 799await TestInRegularAndScriptAsync(code, expected, index: 4, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 833await TestInRegularAndScriptAsync(code, expected, index: 2, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 876await TestInRegularAndScriptAsync(code, expected, index: 2, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 911await TestInRegularAndScriptAsync(code, expected, index: 2, options: UseExpressionBody, parseOptions: CSharpParseOptions.Default); 950await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 1325await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default); 1360await TestInRegularAndScriptAsync(code, expected, index: 1, options: new OptionsCollection(GetLanguage()), parseOptions: CSharpParseOptions.Default);
IntroduceUsingStatement\IntroduceUsingStatementTests.cs (1)
23=> TestInRegularAndScriptAsync(initialMarkup, expectedMarkup, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion));
InvertLogical\InvertLogicalTests.cs (3)
19private static readonly ParseOptions CSharp6 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6); 20private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 21private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9);
MakeLocalFunctionStatic\MakeLocalFunctionStaticRefactoringTests.cs (2)
22private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 23private static readonly ParseOptions CSharp8ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs (2)
29private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 30private static readonly ParseOptions CSharp8ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
RemoveUnnecessaryCast\RemoveUnnecessaryCastTests_AsTests.cs (2)
1453""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1468""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)));
RemoveUnusedVariable\RemoveUnusedVariableTests.cs (1)
877""", CSharpParseOptions.Default);
SimplifyTypeNames\SimplifyTypeNamesTests.cs (5)
5096parseOptions: CSharpParseOptions.Default); 5129parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 5156parseOptions: CSharpParseOptions.Default, 5184parseOptions: CSharpParseOptions.Default, 5212parseOptions: CSharpParseOptions.Default,
src\Analyzers\CSharp\Tests\DocumentationComments\AddDocCommentNodesCodeFixProviderTests.cs (2)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular); 33var parseOptions = Regular.WithDocumentationMode(DocumentationMode.Diagnose);
src\Analyzers\CSharp\Tests\DocumentationComments\RemoveDocCommentNodeCodeFixProviderTests.cs (2)
21private static readonly CSharpParseOptions Regular = new(kind: SourceCodeKind.Regular); 33var parseOptions = Regular.WithDocumentationMode(DocumentationMode.Diagnose);
src\Analyzers\CSharp\Tests\InlineDeclaration\CSharpInlineDeclarationTests.cs (2)
217""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 2446""", CSharpParseOptions.Default);
src\Analyzers\CSharp\Tests\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessTests.cs (1)
142""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
src\Analyzers\CSharp\Tests\MakeFieldReadonly\MakeFieldReadonlyTests.cs (1)
24private static readonly ParseOptions s_strictFeatureFlag = CSharpParseOptions.Default.WithFeatures([KeyValuePairUtil.Create("strict", "true")]);
src\Analyzers\CSharp\Tests\MakeLocalFunctionStatic\MakeLocalFunctionStaticTests.cs (2)
30private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 31private static readonly ParseOptions CSharp8ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8);
src\Analyzers\CSharp\Tests\MakeMethodAsynchronous\MakeMethodAsynchronousTests.cs (1)
92await TestAsync(initial, expected, parseOptions: CSharpParseOptions.Default,
src\Analyzers\CSharp\Tests\MakeRefStruct\MakeRefStructTests.cs (3)
24private static readonly CSharpParseOptions s_parseOptions = 25CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3); 75await TestMissingInRegularAndScriptAsync(text, new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12)));
src\Analyzers\CSharp\Tests\MisplacedUsingDirectives\MisplacedUsingDirectivesTests.cs (1)
88initialMarkup, expectedMarkup, options: options, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (2)
8946parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 8969parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueExpressionStatementTests.cs (1)
83parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6));
src\Analyzers\CSharp\Tests\ReplaceDefaultLiteral\ReplaceDefaultLiteralTests.cs (2)
49parseOptions: CSharpParseOptions.Default.WithLanguageVersion(version)); 58new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(version)));
src\Analyzers\CSharp\Tests\UpgradeProject\UpgradeProjectTests.cs (1)
47p => Assert.Equal(expected, ((CSharpParseOptions)p.ParseOptions!).SpecifiedLanguageVersion));
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests.cs (4)
24private readonly ParseOptions CSharp12 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp12); 448CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 468""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5))); 514""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
src\Analyzers\CSharp\Tests\UseAutoProperty\UseAutoPropertyTests_Field.cs (2)
16private readonly ParseOptions CSharp13 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp13); 17private readonly ParseOptions Preview = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview);
src\Analyzers\CSharp\Tests\UseConditionalExpression\UseConditionalExpressionForReturnTests.cs (7)
21private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 22private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 167""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 1012""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1078""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1113""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion))); 1148""", parameters: new(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(languageVersion)));
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (2)
499""", CSharpParseOptions.Default, options: ImplicitTypeEverywhere()); 3326""", CSharpParseOptions.Default, options: ImplicitTypeEverywhere());
src\Analyzers\CSharp\Tests\UseInferredMemberName\UseInferredMemberNameTests.cs (4)
29private static readonly CSharpParseOptions s_parseOptions = 30CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Latest); 87""", count: 0, parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 103""", count: 0, parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7)));
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForCastAndEqualityOperatorTests.cs (7)
95new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 115new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 175""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 205""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 235""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 265""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)); 283""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseIsNullCheck\UseIsNullCheckForReferenceEqualsTests.cs (6)
26private static readonly ParseOptions CSharp7 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7); 27private static readonly ParseOptions CSharp8 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8); 28private static readonly ParseOptions CSharp9 = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9); 99new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 119new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9))); 287""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseLocalFunction\UseLocalFunctionTests.cs (4)
29private static readonly ParseOptions CSharp72ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2); 53""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 4165parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10)); 4181new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests.cs (10)
84""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(version))); 102""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6))); 1170""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1209""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1475""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1506""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1561""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1593""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1656""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8))); 1698""", parameters: new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpAsAndNullCheckTests_FixAllTests.cs (2)
72""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)); 129""", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9));
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
77""", new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
src\Analyzers\CSharp\Tests\UseThrowExpression\UseThrowExpressionTests.cs (1)
150""", new TestParameters(CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
UseExpressionBody\Refactoring\UseExpressionBodyForPropertiesRefactoringTests.cs (1)
308}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6),
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzerTests.cs (1)
68""", parameters: new TestParameters(parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IObjectCreationExpression.cs (1)
18private static readonly CSharpParseOptions ImplicitObjectCreationOptions = TestOptions.Regular9;
Microsoft.CodeAnalysis.CSharp.Scripting (2)
CSharpScriptCompiler.cs (1)
18internal static readonly CSharpParseOptions DefaultParseOptions = new CSharpParseOptions(kind: SourceCodeKind.Script, languageVersion: LanguageVersion.Latest);
ScriptOptionsExtensions.cs (1)
18: (options.ParseOptions is CSharpParseOptions existing) ? existing : throw new InvalidOperationException(string.Format(ScriptingResources.CannotSetLanguageSpecificOption, LanguageNames.CSharp, nameof(LanguageVersion)));
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ScriptOptionsTests.cs (1)
23Assert.Equal(LanguageVersion.CSharp8, ((CSharpParseOptions)options.ParseOptions).LanguageVersion);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (331)
Semantics\AwaitExpressionTests.cs (1)
154var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5));
Semantics\ConditionalOperatorTests.cs (3)
1242private static void TestConditional(string conditionalExpression, string? expectedType, CSharpParseOptions? parseOptions, params DiagnosticDescription[] expectedDiagnostics) 1255private static void TestConditionalCore(string conditionalExpression, string? expectedType, CSharpParseOptions parseOptions, params DiagnosticDescription[] expectedDiagnostics) 1501parseOptions: CSharpParseOptions.Default.WithPreprocessorSymbols("DEBUG"));
Semantics\DynamicTests.cs (11)
4948var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 5072var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 5195var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 5319var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 5451var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 5636var parseOptions = version switch { 12 => TestOptions.Regular12, 13 => TestOptions.Regular13, _ => TestOptions.RegularPreview }; 5668var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 5802var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 5994var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 6117var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13; 6446var parseOptions = testPreview ? TestOptions.RegularPreview : TestOptions.Regular13;
Semantics\ForEachTests.cs (2)
2051var options = new CSharpParseOptions(preprocessorSymbols: ImmutableArray.Create("CONDITIONAL"), documentationMode: DocumentationMode.None); 3251private static BoundForEachStatement GetBoundForEachStatement(string text, CSharpParseOptions options = null, params DiagnosticDescription[] diagnostics)
Semantics\FunctionPointerTests.cs (1)
19private static CSharpCompilation CreateCompilationWithFunctionPointers(string source, CSharpCompilationOptions? options = null, CSharpParseOptions? parseOptions = null, TargetFramework? targetFramework = null)
Semantics\GenericConstraintsTests.cs (4)
351var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 908var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 1390var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2); 2086var oldOptions = new CSharpParseOptions(LanguageVersion.CSharp7_2);
Semantics\GlobalUsingDirectiveTests.cs (2)
3505var parseOptions = TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute(); 3701var parseOptions = TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute();
Semantics\ImplicitObjectCreationTests.cs (1)
19private static readonly CSharpParseOptions ImplicitObjectCreationTestOptions = TestOptions.Regular9;
Semantics\InterceptorsTests.cs (2)
36private static readonly CSharpParseOptions RegularWithInterceptors = TestOptions.Regular.WithFeature("InterceptorsNamespaces", "global"); 149void test(CSharpParseOptions options, string? expectedOutput, params DiagnosticDescription[] expected)
Semantics\InterpolationTests.cs (7)
1154var parseOptions = new CSharpParseOptions( 1261var parseOptions = TestOptions.Regular11; 1365var parseOptions = new CSharpParseOptions( 1421var parseOptions = TestOptions.Regular11; 7994private void InterpolatedStringHandlerArgumentAttribute_MismatchedRefTypes(CSharpParseOptions parseOptions, string mRef, string customHandlerRef, string expression, params DiagnosticDescription[] expectedDiagnostics) 18255CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics( 18274CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics(
Semantics\LocalFunctionTests.cs (15)
23internal static readonly CSharpParseOptions DefaultParseOptions = TestOptions.Regular; 7339var parseOptions = useCSharp10 ? TestOptions.Regular10 : TestOptions.Regular11; 7359static AttributeSyntax parseAttributeSyntax(string source, CSharpParseOptions parseOptions) 7413var parseOptions = useCSharp10 ? TestOptions.Regular10 : TestOptions.Regular11; 7454static ExpressionSyntax parseNameof(string source, CSharpParseOptions parseOptions) 7457static ExpressionSyntax parseIdentifier(string source, CSharpParseOptions parseOptions) 7531static AttributeSyntax parseAttributeSyntax(string source, CSharpParseOptions parseOptions) 7558var parseOptions = useCSharp10 ? TestOptions.Regular10 : TestOptions.Regular11; 7584static AttributeSyntax parseAttributeSyntax(string source, CSharpParseOptions parseOptions) 8914var parseOptions = useCSharp10 ? TestOptions.Regular10 : TestOptions.Regular11; 8940static AttributeSyntax parseAttributeSyntax(string source, CSharpParseOptions parseOptions) 9418var parseOptions = useCSharp10 ? TestOptions.Regular10 : TestOptions.Regular11; 9444static AttributeSyntax parseAttributeSyntax(string source, CSharpParseOptions parseOptions) 9736var parseOptions = useCSharp10 ? TestOptions.Regular10 : TestOptions.Regular11; 9762static AttributeSyntax parseAttributeSyntax(string source, CSharpParseOptions parseOptions)
Semantics\LookupPositionTests.cs (1)
3115var parseOptions = TestOptions.Regular9.WithDocumentationMode(DocumentationMode.Diagnose);
Semantics\LookupTests.cs (1)
26var parseOptions = TestOptions.Regular;
Semantics\NativeIntegerTests.cs (1)
1300var parseOptions = TestOptions.Regular9.WithNoRefSafetyRulesAttribute();
Semantics\NullableContextTests.cs (6)
194void verify(CSharpParseOptions parseOptions, params string[] expectedAnalyzedKeys) 243void verify(CSharpParseOptions parseOptions, params string[] expectedAnalyzedKeys) 302void verify(CSharpParseOptions parseOptions, params string[] expectedAnalyzedKeys) 344void verify(CSharpParseOptions parseOptions, bool expectedFlowState, params string[] expectedAnalyzedKeys) 383void verify(CSharpParseOptions parseOptions, bool expectedFlowState, params string[] expectedAnalyzedKeys) 418void verify(CSharpParseOptions parseOptions, bool expectedFlowState, params string[] expectedAnalyzedKeys)
Semantics\NullableReferenceTypesTests.cs (1)
99CSharpParseOptions parseOptions = null)
Semantics\RawInterpolationTests.cs (2)
1300CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics( 1319CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).VerifyDiagnostics(
Semantics\RefExtensionMethodsTests.cs (6)
2292CreateCompilationWithMscorlib40AndSystemCore(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 2327parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1), 2335parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1), 2372CreateCompilationWithMscorlib40AndSystemCore(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 2431parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1), 2439parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1),
Semantics\RefLocalsAndReturnsTests.cs (5)
266}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 284}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 552}", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_2)); 2677var options = TestOptions.Regular; 2719var options = TestOptions.Regular;
Semantics\StackAllocInitializerTests.cs (1)
1461var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7);
Semantics\StackAllocSpanExpressionsTests.cs (2)
363var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7); 382var parseOptions = new CSharpParseOptions().WithLanguageVersion(LanguageVersion.CSharp7);
Semantics\StructConstructorTests.cs (1)
846private static CSharpParseOptions GetParseOptions(LanguageVersion? languageVersion)
Semantics\TargetTypedConditionalOperatorTests.cs (1)
285CSharpParseOptions? parseOptions,
Semantics\TargetTypedDefaultTests.cs (1)
1718void validateLangVer(string modifier, string type, string value, string equal, string semanticType, CSharpParseOptions parseOptions, params DiagnosticDescription[] diagnostics)
Semantics\TopLevelStatementsTests.cs (1)
29private static CSharpParseOptions DefaultParseOptions => TestOptions.Regular9;
Semantics\UseSiteErrorTests.cs (1)
2305var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
SourceGeneration\GeneratorDriverTests.cs (115)
34var parseOptions = TestOptions.Regular; 54var parseOptions = TestOptions.Regular; 76var parseOptions = TestOptions.Regular; 97var parseOptions = TestOptions.Regular; 126var parseOptions = TestOptions.Regular; 155var parseOptions = TestOptions.Regular; 216var parseOptions = TestOptions.Regular; 248var parseOptions = TestOptions.Regular; 273var parseOptions = TestOptions.Regular; 296var parseOptions = TestOptions.Regular; 317var parseOptions = TestOptions.Regular; 340var parseOptions = TestOptions.Regular; 370var parseOptions = TestOptions.Regular; 401var parseOptions = TestOptions.Regular; 427var parseOptions = TestOptions.Regular; 453var parseOptions = TestOptions.Regular; 482var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview); 521var parseOptions = TestOptions.Regular; 581var parseOptions = TestOptions.Regular; 611var parseOptions = TestOptions.Regular; 656var parseOptions = TestOptions.Regular; 703var parseOptions = TestOptions.Regular; 738var parseOptions = TestOptions.Regular; 775var parseOptions = TestOptions.Regular; 797var parseOptions = TestOptions.Regular; 822var parseOptions = TestOptions.Regular; 850var parseOptions = TestOptions.Regular; 881var parseOptions = TestOptions.Regular; 907var parseOptions = TestOptions.Regular; 934var parseOptions = TestOptions.Regular; 962var parseOptions = TestOptions.Regular; 994var parseOptions = TestOptions.Regular; 1023var parseOptions = TestOptions.Regular; 1058var parseOptions = TestOptions.Regular; 1085var parseOptions = TestOptions.Regular; 1130var parseOptions = TestOptions.Regular; 1157var parseOptions = TestOptions.Regular; 1255var parseOptions = TestOptions.Regular; 1346var parseOptions = TestOptions.RegularPreview; 1384var parseOptions = TestOptions.Regular; 1419var parseOptions = TestOptions.Regular; 1441var parseOptions = TestOptions.RegularPreview; 1466var parseOptions = TestOptions.RegularPreview; 1492var parseOptions = TestOptions.RegularPreview; 1534var parseOptions = TestOptions.RegularPreview; 1563var parseOptions = TestOptions.RegularPreview; 1596var parseOptions = TestOptions.RegularPreview; 1617var parseOptions = TestOptions.RegularPreview; 1679var parseOptions = TestOptions.RegularPreview; 1723var parseOptions = TestOptions.RegularPreview; 1942var parseOptions = TestOptions.RegularPreview; 1978var parseOptions = TestOptions.RegularPreview; 2134var parseOptions = TestOptions.RegularPreview; 2166static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string source) 2193var parseOptions = TestOptions.RegularPreview; 2228static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string source) 2240var parseOptions = TestOptions.RegularPreview; 2302var parseOptions = TestOptions.RegularPreview; 2371static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string source) 2383var parseOptions = TestOptions.RegularPreview; 2455var parseOptions = TestOptions.RegularPreview; 2483var parseOptions = TestOptions.RegularPreview; 2516var newParseOptions = parseOptions.WithDocumentationMode(DocumentationMode.Diagnose); 2546var parseOptions = TestOptions.RegularPreview; 2612var parseOptions = TestOptions.RegularPreview; 2696var parseOptions = TestOptions.RegularPreview; 2883var parseOptions = TestOptions.RegularPreview; 3078var parseOptions = TestOptions.RegularPreview; 3144var parseOptions = TestOptions.RegularPreview; 3190var parseOptions = TestOptions.RegularPreview; 3220var parseOptions = TestOptions.RegularPreview; 3278var parseOptions = TestOptions.RegularPreview; 3304var parseOptions = TestOptions.RegularPreview; 3337var parseOptions = TestOptions.RegularPreview; 3383var parseOptions = TestOptions.RegularPreview; 3411var parseOptions = TestOptions.RegularPreview; 3442var parseOptions = TestOptions.RegularPreview; 3490var parseOptions = TestOptions.RegularPreview; 3534var parseOptions = TestOptions.RegularPreview; 3565var parseOptions = TestOptions.RegularPreview; 3609var parseOptions = TestOptions.RegularPreview; 3641var parseOptions = TestOptions.RegularPreview; 3675var parseOptions = TestOptions.RegularPreview; 3704var parseOptions = TestOptions.RegularPreview; 3735var parseOptions = TestOptions.RegularPreview; 3767var parseOptions = TestOptions.RegularPreview; 3800var parseOptions = TestOptions.RegularPreview; 3829var parseOptions = TestOptions.RegularPreview; 3859var parseOptions = TestOptions.RegularPreview; 3891var parseOptions = TestOptions.RegularPreview; 4005var parseOptions = TestOptions.RegularPreview; 4067var parseOptions = TestOptions.RegularPreview; 4101static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string className, string source) 4149var parseOptions = TestOptions.RegularPreview.WithFeature("InterceptorsNamespaces", "global"); 4354var parseOptions = CSharpParseOptions.Default; 4462var parseOptions = CSharpParseOptions.Default; 4483var parseOptions = CSharpParseOptions.Default; 4492var newParseOptions = parseOptions.WithLanguageVersion(LanguageVersion.CSharp9); 4519var parseOptions = CSharpParseOptions.Default; 4536var parseOptions = CSharpParseOptions.Default; 4554var parseOptions = CSharpParseOptions.Default; 4574var parseOptions = CSharpParseOptions.Default; 4592var parseOptions = CSharpParseOptions.Default; 4610var parseOptions = CSharpParseOptions.Default; 4627var parseOptions = CSharpParseOptions.Default;
SourceGeneration\GeneratorDriverTests_Attributes_FullyQualifiedName.cs (47)
67var parseOptions = TestOptions.RegularPreview; 109var parseOptions = TestOptions.RegularPreview; 146var parseOptions = TestOptions.RegularPreview; 176var parseOptions = TestOptions.RegularPreview; 206var parseOptions = TestOptions.RegularPreview; 235var parseOptions = TestOptions.RegularPreview; 262var parseOptions = TestOptions.RegularPreview; 290var parseOptions = TestOptions.RegularPreview; 319var parseOptions = TestOptions.RegularPreview; 355var parseOptions = TestOptions.RegularPreview; 394var parseOptions = TestOptions.RegularPreview; 423var parseOptions = TestOptions.RegularPreview; 456var parseOptions = TestOptions.RegularPreview; 489var parseOptions = TestOptions.RegularPreview; 521var parseOptions = TestOptions.RegularPreview; 553var parseOptions = TestOptions.RegularPreview; 584var parseOptions = TestOptions.RegularPreview; 615var parseOptions = TestOptions.RegularPreview; 648var parseOptions = TestOptions.RegularPreview; 679var parseOptions = TestOptions.RegularPreview; 708var parseOptions = TestOptions.RegularPreview; 742var parseOptions = TestOptions.RegularPreview; 771var parseOptions = TestOptions.RegularPreview; 808var parseOptions = TestOptions.RegularPreview; 845var parseOptions = TestOptions.RegularPreview; 882var parseOptions = TestOptions.RegularPreview; 919var parseOptions = TestOptions.RegularPreview; 956var parseOptions = TestOptions.RegularPreview; 992var parseOptions = TestOptions.RegularPreview; 1019var parseOptions = TestOptions.RegularPreview; 1056var parseOptions = TestOptions.RegularPreview; 1094var parseOptions = TestOptions.RegularPreview; 1132var parseOptions = TestOptions.RegularPreview; 1170var parseOptions = TestOptions.RegularPreview; 1208var parseOptions = TestOptions.RegularPreview; 1250var parseOptions = TestOptions.RegularPreview; 1297static void replace(ref Compilation compilation, CSharpParseOptions parseOptions, string className, string source) 1329var parseOptions = TestOptions.RegularPreview; 1375var parseOptions = TestOptions.RegularPreview; 1413var parseOptions = TestOptions.RegularPreview; 1460var parseOptions = TestOptions.RegularPreview; 1507var parseOptions = TestOptions.RegularPreview; 1550var parseOptions = TestOptions.RegularPreview; 1598var parseOptions = TestOptions.RegularPreview; 1653var parseOptions = TestOptions.RegularPreview; 1710var parseOptions = TestOptions.RegularPreview; 1764var parseOptions = TestOptions.RegularPreview;
SourceGeneration\GeneratorDriverTests_Attributes_SimpleName.cs (46)
38var parseOptions = TestOptions.RegularPreview; 70var parseOptions = TestOptions.RegularPreview; 96var parseOptions = TestOptions.RegularPreview; 121var parseOptions = TestOptions.RegularPreview; 146var parseOptions = TestOptions.RegularPreview; 174var parseOptions = TestOptions.RegularPreview; 206var parseOptions = TestOptions.RegularPreview; 238var parseOptions = TestOptions.RegularPreview; 272var parseOptions = TestOptions.RegularPreview; 305var parseOptions = TestOptions.RegularPreview; 331var parseOptions = TestOptions.RegularPreview; 357var parseOptions = TestOptions.RegularPreview; 383var parseOptions = TestOptions.RegularPreview; 416var parseOptions = TestOptions.RegularPreview; 444var parseOptions = TestOptions.RegularPreview; 472var parseOptions = TestOptions.RegularPreview; 499var parseOptions = TestOptions.RegularPreview; 530var parseOptions = TestOptions.RegularPreview; 563var parseOptions = TestOptions.RegularPreview; 595var parseOptions = TestOptions.RegularPreview; 627var parseOptions = TestOptions.RegularPreview; 655var parseOptions = TestOptions.RegularPreview; 683var parseOptions = TestOptions.RegularPreview; 711var parseOptions = TestOptions.RegularPreview; 740var parseOptions = TestOptions.RegularPreview; 767var parseOptions = TestOptions.RegularPreview; 794var parseOptions = TestOptions.RegularPreview; 825var parseOptions = TestOptions.RegularPreview; 857var parseOptions = TestOptions.RegularPreview; 886var parseOptions = TestOptions.RegularPreview; 914var parseOptions = TestOptions.RegularPreview; 942var parseOptions = TestOptions.RegularPreview; 971var parseOptions = TestOptions.RegularPreview; 1001var parseOptions = TestOptions.RegularPreview; 1041var parseOptions = TestOptions.RegularPreview; 1089var parseOptions = TestOptions.RegularPreview; 1142var parseOptions = TestOptions.RegularPreview; 1193var parseOptions = TestOptions.RegularPreview; 1248var parseOptions = TestOptions.RegularPreview; 1301var parseOptions = TestOptions.RegularPreview; 1359var parseOptions = TestOptions.RegularPreview; 1407var parseOptions = TestOptions.RegularPreview; 1452var parseOptions = TestOptions.RegularPreview; 1503var parseOptions = TestOptions.RegularPreview; 1554var parseOptions = TestOptions.RegularPreview; 1615var parseOptions = TestOptions.RegularPreview;
SourceGeneration\StateTableTests.cs (2)
1344var options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10);
SourceGeneration\SyntaxAwareGeneratorTests.cs (41)
32var parseOptions = TestOptions.Regular; 58var parseOptions = TestOptions.Regular; 83var parseOptions = TestOptions.Regular; 109var parseOptions = TestOptions.Regular; 134var parseOptions = TestOptions.Regular; 161var parseOptions = TestOptions.Regular; 233var parseOptions = TestOptions.Regular; 272var parseOptions = TestOptions.Regular; 313var parseOptions = TestOptions.Regular; 369var parseOptions = TestOptions.Regular; 411var parseOptions = TestOptions.Regular; 453var parseOptions = TestOptions.Regular; 495var parseOptions = TestOptions.Regular; 549var parseOptions = TestOptions.Regular; 579var parseOptions = TestOptions.Regular; 617var parseOptions = TestOptions.Regular; 671var parseOptions = TestOptions.Regular; 728var parseOptions = TestOptions.Regular; 771var parseOptions = TestOptions.Regular; 816var parseOptions = TestOptions.Regular; 851var parseOptions = TestOptions.RegularPreview; 891var parseOptions = TestOptions.RegularPreview; 933var parseOptions = TestOptions.RegularPreview; 1010var parseOptions = TestOptions.RegularPreview; 1085var parseOptions = TestOptions.RegularPreview; 1166var parseOptions = TestOptions.RegularPreview; 1216var parseOptions = TestOptions.RegularPreview; 1299var parseOptions = TestOptions.RegularPreview; 1376var parseOptions = TestOptions.RegularPreview; 1509var parseOptions = TestOptions.RegularPreview; 1564var parseOptions = TestOptions.RegularPreview; 1613var parseOptions = TestOptions.RegularPreview; 1674var parseOptions = TestOptions.RegularPreview; 1733var parseOptions = TestOptions.RegularPreview; 1786var parseOptions = TestOptions.RegularPreview; 1849var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview); 1890var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview); 1931var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview); 1980var parseOptions = TestOptions.RegularPreview; 2006var parseOptions = TestOptions.RegularPreview; 2044var parseOptions = TestOptions.Regular;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (91)
Compilation\CompilationAPITests.cs (7)
50options: CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Diagnose), 2379var tree1 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 2380var tree2 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 2381var tree3 = SyntaxFactory.ParseSyntaxTree("", CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 3602var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 3637var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 3662var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Compilation\SemanticModelAPITests.cs (1)
3608}", CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Diagnose));
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
3681var parseOptions = TestOptions.Script;
Compilation\UsedAssembliesTests.cs (8)
164yield return (comp.ReplaceSyntaxTree(tree, CSharpTestBase.Parse(builder.ToString(), tree.FilePath, (CSharpParseOptions)tree.Options)), before, after); 190LanguageVersion treeLanguageVersion = ((CSharpParseOptions)tree.Options).LanguageVersion; 191var parseOptions = ((CSharpParseOptions)tree.Options).WithLanguageVersion(treeLanguageVersion > LanguageVersion.CSharp10 ? treeLanguageVersion : LanguageVersion.CSharp10); 256private Compilation AssertUsedAssemblyReferences(string source, MetadataReference[] references, MetadataReference[] expected, CSharpParseOptions parseOptions, CSharpCompilationOptions options = null) 378var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 419var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 5458var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
DeclarationTests.cs (2)
950public override CSharpParseOptions Options 952get { return (CSharpParseOptions)_underlyingTree.Options; }
DocumentationComments\CrefTests.cs (2)
6917var parseOptions = TestOptions.RegularWithDocumentationComments; 6941var parseOptions = TestOptions.RegularWithDocumentationComments;
DocumentationComments\DocumentationModeTests.cs (1)
395private static CSharpParseOptions GetOptions(DocumentationMode mode)
SymbolDisplay\SymbolDisplayTests.cs (1)
3443CSharpParseOptions parseOptions,
Symbols\CheckedUserDefinedOperatorsTests.cs (4)
893foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 924foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 2156foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 3177foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 })
Symbols\CovariantReturnTests.cs (12)
401CSharpParseOptions parseOptions = null) 420CSharpParseOptions parseOptions = null) 440CSharpParseOptions parseOptions = null) 451return comp.AddSyntaxTrees(CSharpSyntaxTree.ParseText(assignments, (CSharpParseOptions)comp.SyntaxTrees[0].Options, path: "assignments.cs", encoding: Encoding.UTF8)); 510var parseOptions = (CSharpParseOptions)comp.SyntaxTrees[0].Options; 3823var parseOptions = withCovariantReturnFeatureEnabled ? TestOptions.WithCovariantReturns : TestOptions.WithoutCovariantReturns; 3942var parseOptions = withCovariantReturnFeatureEnabled ? TestOptions.WithCovariantReturns : TestOptions.WithoutCovariantReturns; 4066var parseOptions = withCovariantReturnFeatureEnabled ? TestOptions.WithCovariantReturns : TestOptions.WithoutCovariantReturns; 4181var parseOptions = withCovariantReturnFeatureEnabled ? TestOptions.WithCovariantReturns : TestOptions.WithoutCovariantReturns; 4302var parseOptions = withCovariantReturnFeatureEnabled ? TestOptions.WithCovariantReturns : TestOptions.WithoutCovariantReturns; 4408var parseOptions = withCovariantReturnFeatureEnabled ? TestOptions.WithCovariantReturns : TestOptions.WithoutCovariantReturns;
Symbols\DefaultInterfaceImplementationTests.cs (4)
9994foreach (var parseOptions in new[] { TestOptions.Regular9, TestOptions.Regular }) 49651var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 49767var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 67994foreach (var parseOptions in new[] { TestOptions.Regular8, TestOptions.Regular9, TestOptions.Regular })
Symbols\ExtensionMethodTests.cs (1)
3807var parseOptions = TestOptions.Script;
Symbols\MissingSpecialMember.cs (2)
485var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute(); 508var parseOptions = TestOptions.Regular.WithNoRefSafetyRulesAttribute();
Symbols\ModuleInitializers\AccessibilityTests.cs (1)
17private static readonly CSharpParseOptions s_parseOptions = TestOptions.Regular9;
Symbols\ModuleInitializers\GenericsTests.cs (1)
16private static readonly CSharpParseOptions s_parseOptions = TestOptions.Regular9;
Symbols\ModuleInitializers\ModuleInitializersTests.cs (1)
23private static readonly CSharpParseOptions s_parseOptions = TestOptions.Regular9;
Symbols\ModuleInitializers\SignatureTests.cs (1)
17private static readonly CSharpParseOptions s_parseOptions = TestOptions.Regular9;
Symbols\ModuleInitializers\TargetsTests.cs (1)
16private static readonly CSharpParseOptions s_parseOptions = TestOptions.Regular9;
Symbols\RequiredMembersTests.cs (1)
22private static CSharpCompilation CreateCompilationWithRequiredMembers(CSharpTestSource source, IEnumerable<MetadataReference>? references = null, CSharpParseOptions? parseOptions = null, CSharpCompilationOptions? options = null, string? assemblyName = null, TargetFramework targetFramework = TargetFramework.Standard)
Symbols\Source\ClsComplianceTests.cs (1)
3496var parseOptions = TestOptions.Regular7;
Symbols\Source\MethodTests.cs (1)
2247var parseOptions = TestOptions.Regular;
Symbols\Source\ModifierTests.cs (2)
273CreateCompilation(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics( 307CreateCompilation(code, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_1)).VerifyDiagnostics(
Symbols\Source\NullablePublicAPITests.cs (1)
1737var featureFlagOff = TestOptions.Regular8.WithFeature("run-nullable-analysis", "never");
Symbols\Source\UsingAliasTests.cs (1)
731var compilation = CreateCompilation(text, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview));
Symbols\StaticAbstractMembersInInterfacesTests.cs (30)
16192foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 16673foreach (var parseOptions in new[] { TestOptions.RegularPreview, TestOptions.Regular10 }) 16853foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 16935foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 17017foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 17088foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 17162foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 17249foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 19920foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 19994foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 20077foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 20157foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 21285foreach (var parseOptions in new[] { TestOptions.RegularPreview, TestOptions.Regular10 }) 21345foreach (var parseOptions in new[] { TestOptions.RegularPreview, TestOptions.Regular10 }) 21448foreach (var parseOptions in new[] { TestOptions.RegularPreview, TestOptions.Regular10 }) 21691foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 21800foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 21902foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 23210foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 24771foreach (var parseOptions in new[] { TestOptions.RegularPreview, TestOptions.Regular10 }) 25013foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 25084foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 25897foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 27436foreach (var parseOptions in new[] { TestOptions.RegularPreview, TestOptions.Regular10 }) 27679foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 27750foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 28884foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 29509foreach (var parseOptions in new[] { TestOptions.RegularPreview, TestOptions.Regular10 }) 29626foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview }) 29732foreach (var parseOptions in new[] { TestOptions.Regular10, TestOptions.RegularPreview })
Symbols\SymbolErrorTests.cs (3)
2114var tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 2541var comp = CreateCompilation(Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5))); 17945Parse(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (399)
IncrementalParsing\BinaryExpression.cs (1)
187private static void MakeChange(SyntaxKind oldSyntaxKind, SyntaxKind newSyntaxKind, bool topLevel = false, CSharpParseOptions options = null)
IncrementalParsing\ChangingAsync.cs (1)
65private static void ParseAndValidate(string text, Action<SyntaxTree> validator, CSharpParseOptions options = null)
IncrementalParsing\ChangingIdentifiers.cs (1)
249Action<ExpressionSyntax> expressionValidator, bool topLevel = false, CSharpParseOptions options = null)
IncrementalParsing\CompoundAssignment.cs (1)
93private static void MakeAssignmentChanges(SyntaxKind oldSyntaxKind, SyntaxKind newSyntaxKind, bool topLevel = false, CSharpParseOptions options = null)
IncrementalParsing\IncrementalParsingTests.cs (2)
21private CSharpParseOptions GetOptions(string[] defines) 35var options = new CSharpParseOptions(languageVersion: languageVersion);
IncrementalParsing\TypeChanges.cs (1)
153private static void ParseAndValidate(string text, Action<SyntaxTree> validator, CSharpParseOptions options = null)
IncrementalParsing\UnaryExpression.cs (1)
69private static void MakeUnaryChanges(SyntaxKind oldSyntaxKind, SyntaxKind newSyntaxKind, bool topLevel = false, CSharpParseOptions options = null)
LexicalAndXml\LexicalTests.cs (9)
22private readonly CSharpParseOptions _options; 23private readonly CSharpParseOptions _options6; 24private readonly CSharpParseOptions _options7; 25private readonly CSharpParseOptions _options72; 26private readonly CSharpParseOptions _binaryOptions; 27private readonly CSharpParseOptions _underscoreOptions; 28private readonly CSharpParseOptions _binaryUnderscoreOptions; 41private IEnumerable<SyntaxToken> Lex(string text, CSharpParseOptions options = null) 46private SyntaxToken LexToken(string text, CSharpParseOptions options = null)
LexicalAndXml\PreprocessorTests.cs (4)
75private CSharpParseOptions GetOptions(SourceCodeKind kind, string[] defines) 87var options = this.GetOptions(kind, defines); 91private CompilationUnitSyntax Parse(string text, CSharpParseOptions options) 99var options = this.GetOptions(SourceCodeKind.Regular, defines);
LexicalAndXml\XmlDocCommentTests.cs (2)
23private CSharpParseOptions GetOptions(string[] defines) 33var options = this.GetOptions(defines);
Parsing\AsyncParsingTests.cs (3)
19protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 24protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions options = null) 29private void TestVersions(Action<CSharpParseOptions> test)
Parsing\AsyncStreamsParsingTests.cs (2)
20protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 25protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions options = null)
Parsing\AwaitParsingTests.cs (2)
17protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 22protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions options = null)
Parsing\CrefParsingTests.cs (7)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 26protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions options) 29var trivia = SyntaxFactory.ParseLeadingTrivia(commentText, options ?? CSharpParseOptions.Default).Single(); 350foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 365foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 381foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 397foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 })
Parsing\CSharpParseOptionsTests.cs (33)
20private void TestProperty<T>(Func<CSharpParseOptions, T, CSharpParseOptions> factory, Func<CSharpParseOptions, T> getter, T validValue) 22var oldOpt1 = CSharpParseOptions.Default; 23var newOpt1 = factory(oldOpt1, validValue); 24var newOpt2 = factory(newOpt1, validValue); 35var po = new CSharpParseOptions().WithFeatures(new[] { kvp }); 37var po2 = po.WithDocumentationMode(DocumentationMode.Diagnose); 49Assert.Equal(0, CSharpParseOptions.Default.WithPreprocessorSymbols(ImmutableArray.Create<string>("A", "B")).WithPreprocessorSymbols(default(ImmutableArray<string>)).PreprocessorSymbols.Length); 50Assert.Equal(0, CSharpParseOptions.Default.WithPreprocessorSymbols(ImmutableArray.Create<string>("A", "B")).WithPreprocessorSymbols((IEnumerable<string>)null).PreprocessorSymbols.Length); 51Assert.Equal(0, CSharpParseOptions.Default.WithPreprocessorSymbols(ImmutableArray.Create<string>("A", "B")).WithPreprocessorSymbols((string[])null).PreprocessorSymbols.Length); 55/// If this test fails, please update the <see cref="CSharpParseOptions.GetHashCode"/> 56/// and <see cref="CSharpParseOptions.Equals(CSharpParseOptions)"/> methods to 64typeof(CSharpParseOptions), 77var options = new CSharpParseOptions(); 117var options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 118var options2 = new CSharpParseOptions(kind: SourceCodeKind.Script); 134var options1 = new CSharpParseOptions(kind: SourceCodeKind.Script); 135var options2 = new CSharpParseOptions(kind: SourceCodeKind.Script); 152var options = new CSharpParseOptions(kind: SourceCodeKind.Interactive); 163var options = new CSharpParseOptions(documentationMode: unchecked((DocumentationMode)100)); 173var options = new CSharpParseOptions(languageVersion: unchecked((LanguageVersion)10000)); 183var options = new CSharpParseOptions(preprocessorSymbols: new[] { "test", "1" }); 194var options = new CSharpParseOptions().WithKind(SourceCodeKind.Interactive); 205var options = new CSharpParseOptions().WithDocumentationMode(unchecked((DocumentationMode)100)); 215var options = new CSharpParseOptions().WithLanguageVersion(unchecked((LanguageVersion)10000)); 225var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "" }); 235var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { " " }); 245var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "Good", "Bad.Symbol" }); 255var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "Good", "Bad\\Symbol" }); 265var options = new CSharpParseOptions().WithPreprocessorSymbols(new[] { "Good", null });
Parsing\DeclarationParsingTests.cs (4)
23protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 585var file = this.ParseFile(text, CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)); 651var file = this.ParseFile(text, CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)); 696var file = this.ParseFile(text, CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview));
Parsing\DeclarationScopeParsingTests.cs (1)
3259var parseOptions = TestOptions.Regular.WithLanguageVersion(langVersion);
Parsing\DeconstructionTests.cs (1)
32protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\ExpressionParsingTests.cs (14)
20protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 211}}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 241}}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)).VerifyDiagnostics(); 267}}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp7_3)).VerifyDiagnostics( 316}}", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8)).VerifyDiagnostics(); 731var expr = this.ParseExpression(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 764var expr = this.ParseExpression(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 6608foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 6631foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 6666foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 6701foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 6724foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 6759foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 6794foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 })
Parsing\FileModifierParsingTests.cs (2)
18protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options) 28private void UsingNode(string text, CSharpParseOptions? options = null, DiagnosticDescription[]? expectedParsingDiagnostics = null, DiagnosticDescription[]? expectedBindingDiagnostics = null)
Parsing\ImplicitObjectCreationParsingTests.cs (1)
16private static readonly CSharpParseOptions DefaultParseOptions = TestOptions.Regular9;
Parsing\LambdaAttributeParsingTests.cs (3)
22protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options) 27protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions? options) 4540var tree = ParseTree(builder.ToString(), CSharpParseOptions.Default);
Parsing\LambdaParameterParsingTests.cs (2)
20protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 25protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions options)
Parsing\LambdaReturnTypeParsingTests.cs (4)
16protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options) 21protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions? options) 288void verify(string source, CSharpParseOptions parseOptions) 318void verify(string source, CSharpParseOptions parseOptions)
Parsing\LineSpanDirectiveParsingTests.cs (3)
18protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options) 23protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions? options) 28private void UsingLineDirective(string text, CSharpParseOptions? options, params DiagnosticDescription[] expectedErrors)
Parsing\MemberDeclarationParsingTests.cs (205)
28private static readonly CSharpParseOptions RequiredMembersOptions = TestOptions.Regular11; 117foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 142foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 153foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 171foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 200foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 248foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 299foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 326foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 369foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 428foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 479foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 562foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 645foreach (var options in new[] { TestOptions.RegularPreview, TestOptions.Regular10, TestOptions.Regular11 }) 776foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 824foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 872foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 915foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 958foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 1005foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 1052foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 1086foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 1134foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 1168foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 1200public void RequiredModifierProperty_01(CSharpParseOptions parseOptions) 1227public void RequiredModifierProperty_02(CSharpParseOptions parseOptions) 1275public void RequiredModifierProperty_04(CSharpParseOptions parseOptions) 1369public void RequiredModifierField_01(CSharpParseOptions parseOptions) 1393public void RequiredModifierField_02(CSharpParseOptions parseOptions) 1438public void RequiredModifierField_04(CSharpParseOptions parseOptions) 1480public void RequiredModifierMethod_01(CSharpParseOptions parseOptions) 1508public void RequiredModifierMethod_02(CSharpParseOptions parseOptions) 1556public void RequiredModifierOperator(CSharpParseOptions parseOptions) 1603public void RequiredModifierConversion_01(CSharpParseOptions parseOptions) 1641public void RequiredModifierConversion_02(CSharpParseOptions parseOptions) 1710public void RequiredModifierIncompleteProperty_01(CSharpParseOptions parseOptions) 1741public void RequiredModifierIncompleteProperty_02(CSharpParseOptions parseOptions) 1767public void RequiredModifierIncompleteMember_01(CSharpParseOptions parseOptions) 1795public void RequiredModifierIncompleteMember_02(CSharpParseOptions parseOptions) 1815public void RequiredModifierIncompleteMember_03(CSharpParseOptions parseOptions) 1835public void RequiredModifierIncompleteMember_04(CSharpParseOptions parseOptions) 2254public void RequiredModifier_LocalNamedRequired_TopLevelStatements(CSharpParseOptions parseOptions) 2347foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 2489foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 2613foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 2719foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 2825foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 2879foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 2959foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3014foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3065foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3125foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3228foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3373foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3501foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3611foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3721foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3779foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3863foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3922foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 3977foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4041foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4116foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4178foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4267foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4401foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4518foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4617foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4716foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4769foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4848foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4902foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 4952foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5011foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5107foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5245foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5366foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5469foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5572foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5629foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5712foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5770foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5824foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5887foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 5961foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6022foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6084foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6159foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6229foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6292foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6392foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6459foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6543foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6643foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6696foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6758foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6812foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6862foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 6921foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7017foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7130foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7234foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7338foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7442foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7499foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7565foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7623foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7677foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7740foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7814foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7875foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7937foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 7994foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8048foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8102foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8161foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8207foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8272foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8321foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8382foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8441foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8487foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8545foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8890foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 8944foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 9006foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 9068foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 9114foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 11920UsingTree(text, options: CSharpParseOptions.Default.WithDocumentationMode(DocumentationMode.Parse), 12414foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 12677foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 12769foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 12844foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 12927foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13010foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13097foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13181foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13260foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13339foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13426foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13513foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13604foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13715foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13789foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13863foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 13945foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14027foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14106foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14192foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14275foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14369foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14460foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14546foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14629foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14704foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14779foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14862foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 14945foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15076foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15210foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15268foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15326foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15384foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15442foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15521foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15600foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15683foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15770foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15861foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 15942foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 16036foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 16150foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 16303foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 16473foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 16582foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 16711foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 16892foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17090foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17160foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17224foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17281foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17354foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17421foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17483foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17553foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17637foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17700foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17770foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17854foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17906foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 17980foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18069foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18170foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18274foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18375foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18473foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18522foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18583foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18708foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18787foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18883foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 18978foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 19059foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 19141foreach (var options in new[] { TestOptions.Script, TestOptions.Regular }) 19213foreach (var options in new[] { TestOptions.Script, TestOptions.Regular })
Parsing\NameAttributeValueParsingTests.cs (2)
22protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 27protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions options)
Parsing\ParserErrorMessageTests.cs (44)
5439var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5442tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)); 5461var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5464tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5526var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5529tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5545var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5548tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5588var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5591tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5623var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5626tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5657var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5660tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)); 5694var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)); 5697tree = Parse(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5927CreateCompilation(test, parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).VerifyDiagnostics( 5946var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5964var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5977var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 5985tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)); 6006var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6013tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)); 6036var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6049tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)); 6078var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6091tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)); 6148SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)).GetDiagnostics().Verify(); 6149SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6160SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6161SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6184SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6185SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6215SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp4)).GetDiagnostics().Verify(); 6216SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6243SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6244SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6271SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp3)).GetDiagnostics().Verify(); 6272SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6365var tree = SyntaxFactory.ParseSyntaxTree(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)); 6380SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp2)).GetDiagnostics().Verify(); 6381SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp1)).GetDiagnostics().Verify(); 6475SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp6)).GetDiagnostics().Verify(); 6477SyntaxFactory.ParseSyntaxTree(source, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp5)).GetDiagnostics().Verify();
Parsing\ParserRegressionTests.cs (1)
23protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\ParsingErrorRecoveryTests.cs (1)
20private new CompilationUnitSyntax ParseTree(string text, CSharpParseOptions options = null)
Parsing\ParsingTests.cs (7)
64public static void ParseAndValidate(string text, CSharpParseOptions options, params DiagnosticDescription[] expectedErrors) 78protected virtual SyntaxTree ParseTree(string text, CSharpParseOptions? options) => SyntaxFactory.ParseSyntaxTree(text, options); 80public CompilationUnitSyntax ParseFile(string text, CSharpParseOptions? parseOptions = null) => 86protected virtual CSharpSyntaxNode ParseNode(string text, CSharpParseOptions? options) => 150protected SyntaxTree UsingTree(string text, CSharpParseOptions? options, params DiagnosticDescription[] expectedErrors) 177protected CSharpSyntaxNode UsingNode(string text, CSharpParseOptions options, params DiagnosticDescription[] expectedErrors) 371var lexer = new Syntax.InternalSyntax.Lexer(Text.SourceText.From(text), CSharpParseOptions.Default);
Parsing\PatternParsingTests.cs (2)
22UsingStatement(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp8), expectedErrors); 6580UsingStatement(text, options: CSharpParseOptions.Default.WithLanguageVersion(langVersion));
Parsing\PatternParsingTests_ListPatterns.cs (2)
15private static CSharpParseOptions RegularWithoutListPatterns => TestOptions.Regular10; 19UsingExpression(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview), expectedErrors);
Parsing\PatternParsingTests2.cs (1)
18UsingExpression(text, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview), expectedErrors);
Parsing\ReadOnlyStructs.cs (1)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\RefReadonlyTests.cs (1)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\RefStructs.cs (1)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\RoundTrippingTests.cs (3)
26internal static void ParseAndRoundTripping(string text, CSharpParseOptions options, int errorCount = 0, int memberCount = 0) 77var parseOptions = TestOptions.Regular; 1579CSharpParseOptions options = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp2);
Parsing\ScriptParsingTests.cs (2)
23protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 33private SyntaxTree ParseAndValidate(string text, CSharpParseOptions options, params ErrorDescription[] errors)
Parsing\SeparatedSyntaxListParsingTests.cs (1)
22protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\SingleLineDeclarationParsingTests.cs (1)
23protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\SuppressNullableWarningExpressionParsingTests.cs (1)
21protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions options)
Parsing\TypeArgumentListParsingTests.cs (1)
17protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\UsingDirectiveParsingTests.cs (1)
16protected override SyntaxTree ParseTree(string text, CSharpParseOptions? options)
Parsing\Utf8StringLiteralsParsingTests.cs (4)
594foreach (var options in new[] { TestOptions.RegularDefault, TestOptions.Regular11, TestOptions.Regular10 }) 612foreach (var options in new[] { TestOptions.RegularDefault, TestOptions.Regular11, TestOptions.Regular10 }) 748foreach (var options in new[] { TestOptions.RegularDefault, TestOptions.Regular11, TestOptions.Regular10 }) 770foreach (var options in new[] { TestOptions.RegularDefault, TestOptions.Regular11, TestOptions.Regular10 })
Parsing\ValueTupleTests.cs (1)
20protected override SyntaxTree ParseTree(string text, CSharpParseOptions options)
Parsing\VerbatimCrefParsingTests.cs (2)
21protected override SyntaxTree ParseTree(string text, CSharpParseOptions options) 26protected override CSharpSyntaxNode ParseNode(string text, CSharpParseOptions options)
Syntax\FieldAndValueKeywordTests.cs (1)
1306var parseOptions = TestOptions.Regular.WithLanguageVersion(languageVersion);
Syntax\Mocks\MockCSharpSyntaxTree.cs (3)
19public override CSharpParseOptions Options { get; } 25CSharpParseOptions? options = null, 59=> new MockCSharpSyntaxTree((CSharpSyntaxNode)root, _sourceText, (CSharpParseOptions)options, FilePath);
Syntax\SyntaxTreeTests.cs (5)
80var parseOptions = CSharpParseOptions.Default; 245var newOptions = new CSharpParseOptions(); 263var newOptions = new CSharpParseOptions(); 278var newOptions = new CSharpParseOptions();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (108)
CSharpTestBase.cs (47)
811CSharpParseOptions parseOptions = null, 847CSharpParseOptions parseOptions = null, 884CSharpParseOptions parseOptions = null, 925CSharpParseOptions parseOptions = null, 961CSharpParseOptions parseOptions = null, 997CSharpParseOptions parseOptions = null, 1081public static SyntaxTree Parse(string text, string filename = "", CSharpParseOptions options = null, Encoding encoding = null, SourceHashAlgorithm checksumAlgorithm = SourceHashAlgorithm.Sha1) 1084public static SyntaxTree[] Parse(IEnumerable<string> sources, CSharpParseOptions options = null) 1094public static SyntaxTree[] Parse(CSharpParseOptions options = null, params string[] sources) 1104public static SyntaxTree ParseWithRoundTripCheck(string text, CSharpParseOptions options = null) 1123CSharpParseOptions parseOptions = null, 1132CSharpParseOptions parseOptions = null, 1144CSharpParseOptions parseOptions = null, 1152CSharpParseOptions parseOptions = null, 1161CSharpParseOptions parseOptions = null, 1170CSharpParseOptions parseOptions = null, 1179CSharpParseOptions parseOptions = null, 1188CSharpParseOptions parseOptions = null, 1196CSharpParseOptions parseOptions = null, 1204CSharpParseOptions parseOptions = null, 1212CSharpParseOptions parseOptions = null, 1220CSharpParseOptions parseOptions = null, 1228CSharpParseOptions parseOptions = null, 1241CSharpParseOptions parseOptions = null, 1268CSharpParseOptions parseOptions = null, 1281CSharpParseOptions parseOptions = null, 1291CSharpParseOptions parseOptions, 1416var options = (CSharpParseOptions)trees[0].Options; 1440CSharpParseOptions parseOptions = null) 1457CSharpParseOptions parseOptions = null, 1480CSharpParseOptions parseOptions = null, 2057CSharpParseOptions parseOptions = null, 2109CSharpParseOptions parseOptions = null, 2145CSharpParseOptions parseOptions = null, 2166CSharpParseOptions parseOptions = null, 2203CSharpParseOptions parseOptions = null, 2224CSharpParseOptions parseOptions = null, 2242CSharpParseOptions parseOptions = null, 2257protected static CSharpCompilation CreateCompilationWithSpan(CSharpTestSource tree, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2274protected static CSharpCompilation CreateCompilationWithMscorlibAndSpan(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2292protected static CSharpCompilation CreateCompilationWithMscorlibAndSpanSrc(string text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2306protected static CSharpCompilation CreateCompilationWithIndex(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2317protected static CSharpCompilation CreateCompilationWithIndexAndRange(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2328protected static CSharpCompilation CreateCompilationWithIndexAndRangeAndSpan(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null) 2339protected static CSharpCompilation CreateCompilationWithSpanAndMemoryExtensions(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null, TargetFramework targetFramework = TargetFramework.NetCoreApp) 2357protected static CSharpCompilation CreateCompilationWithIndexAndRangeAndSpanAndMemoryExtensions(CSharpTestSource text, CSharpCompilationOptions options = null, CSharpParseOptions parseOptions = null, TargetFramework targetFramework = TargetFramework.NetCoreApp)
CSharpTestSource.cs (2)
37CSharpParseOptions options = null, 46public SyntaxTree[] GetSyntaxTrees(CSharpParseOptions parseOptions, string sourceFileName = "")
SemanticModelTestBase.cs (2)
114protected CompilationUtils.SemanticInfoSummary GetSemanticInfoForTest<TNode>(string testSrc, CSharpParseOptions parseOptions = null) where TNode : SyntaxNode 120internal CompilationUtils.SemanticInfoSummary GetSemanticInfoForTestExperimental<TNode>(string testSrc, MessageID feature, CSharpParseOptions parseOptions = null) where TNode : SyntaxNode
TestOptions.cs (57)
19public static readonly CSharpParseOptions Regular = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.Parse); 20public static readonly CSharpParseOptions Script = Regular.WithKind(SourceCodeKind.Script); 21public static readonly CSharpParseOptions Regular1 = Regular.WithLanguageVersion(LanguageVersion.CSharp1); 22public static readonly CSharpParseOptions Regular2 = Regular.WithLanguageVersion(LanguageVersion.CSharp2); 23public static readonly CSharpParseOptions Regular3 = Regular.WithLanguageVersion(LanguageVersion.CSharp3); 24public static readonly CSharpParseOptions Regular4 = Regular.WithLanguageVersion(LanguageVersion.CSharp4); 25public static readonly CSharpParseOptions Regular5 = Regular.WithLanguageVersion(LanguageVersion.CSharp5); 26public static readonly CSharpParseOptions Regular6 = Regular.WithLanguageVersion(LanguageVersion.CSharp6); 27public static readonly CSharpParseOptions Regular7 = Regular.WithLanguageVersion(LanguageVersion.CSharp7); 28public static readonly CSharpParseOptions Regular7_1 = Regular.WithLanguageVersion(LanguageVersion.CSharp7_1); 29public static readonly CSharpParseOptions Regular7_2 = Regular.WithLanguageVersion(LanguageVersion.CSharp7_2); 30public static readonly CSharpParseOptions Regular7_3 = Regular.WithLanguageVersion(LanguageVersion.CSharp7_3); 31public static readonly CSharpParseOptions RegularDefault = Regular.WithLanguageVersion(LanguageVersion.Default); 37public static readonly CSharpParseOptions RegularNext = Regular.WithLanguageVersion(LanguageVersion.Preview); 39public static readonly CSharpParseOptions RegularPreview = Regular.WithLanguageVersion(LanguageVersion.Preview); 40public static readonly CSharpParseOptions Regular8 = Regular.WithLanguageVersion(LanguageVersion.CSharp8); 41public static readonly CSharpParseOptions Regular9 = Regular.WithLanguageVersion(LanguageVersion.CSharp9); 42public static readonly CSharpParseOptions Regular10 = Regular.WithLanguageVersion(LanguageVersion.CSharp10); 43public static readonly CSharpParseOptions Regular11 = Regular.WithLanguageVersion(LanguageVersion.CSharp11); 44public static readonly CSharpParseOptions Regular12 = Regular.WithLanguageVersion(LanguageVersion.CSharp12); 45public static readonly CSharpParseOptions Regular13 = Regular.WithLanguageVersion(LanguageVersion.CSharp13); 46public static readonly CSharpParseOptions RegularWithDocumentationComments = Regular.WithDocumentationMode(DocumentationMode.Diagnose); 47public static readonly CSharpParseOptions RegularPreviewWithDocumentationComments = RegularPreview.WithDocumentationMode(DocumentationMode.Diagnose); 48public static readonly CSharpParseOptions RegularWithLegacyStrongName = Regular.WithFeature("UseLegacyStrongNameProvider"); 49public static readonly CSharpParseOptions WithoutImprovedOverloadCandidates = Regular.WithLanguageVersion(MessageID.IDS_FeatureImprovedOverloadCandidates.RequiredVersion() - 1); 50public static readonly CSharpParseOptions WithCovariantReturns = Regular.WithLanguageVersion(MessageID.IDS_FeatureCovariantReturnsForOverrides.RequiredVersion()); 51public static readonly CSharpParseOptions WithoutCovariantReturns = Regular.WithLanguageVersion(LanguageVersion.CSharp8); 53public static readonly CSharpParseOptions RegularWithExtendedPartialMethods = RegularPreview; 54public static readonly CSharpParseOptions RegularWithFileScopedNamespaces = Regular.WithLanguageVersion(MessageID.IDS_FeatureFileScopedNamespace.RequiredVersion()); 57public static readonly CSharpParseOptions ExperimentalParseOptions = 63public static readonly CSharpParseOptions Regular6WithV7SwitchBinder = Regular6.WithFeatures(new Dictionary<string, string>() { { "testV7SwitchBinder", "true" } }); 65public static readonly CSharpParseOptions RegularWithoutRecursivePatterns = Regular7_3; 66public static readonly CSharpParseOptions RegularWithRecursivePatterns = Regular8; 67public static readonly CSharpParseOptions RegularWithoutPatternCombinators = Regular8; 68public static readonly CSharpParseOptions RegularWithPatternCombinators = RegularPreview; 69public static readonly CSharpParseOptions RegularWithExtendedPropertyPatterns = RegularPreview; 70public static readonly CSharpParseOptions RegularWithListPatterns = RegularPreview; 106public static CSharpParseOptions WithStrictFeature(this CSharpParseOptions options) 111public static CSharpParseOptions WithPEVerifyCompatFeature(this CSharpParseOptions options) 116public static CSharpParseOptions WithLocalFunctionsFeature(this CSharpParseOptions options) 121public static CSharpParseOptions WithRefsFeature(this CSharpParseOptions options) 126public static CSharpParseOptions WithTuplesFeature(this CSharpParseOptions options) 131public static CSharpParseOptions WithNullablePublicOnly(this CSharpParseOptions options) 136public static CSharpParseOptions WithNoRefSafetyRulesAttribute(this CSharpParseOptions options) 141public static CSharpParseOptions WithDisableLengthBasedSwitch(this CSharpParseOptions options) 146public static CSharpParseOptions WithFeature(this CSharpParseOptions options, string feature, string value = "true") 151internal static CSharpParseOptions WithExperimental(this CSharpParseOptions options, params MessageID[] features)
Microsoft.CodeAnalysis.CSharp.Workspaces (24)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
630if (((CSharpParseOptions)container.SyntaxTree.Options).Kind == SourceCodeKind.Script)
Serialization\CSharpOptionsSerializationService.cs (3)
40var csharpOptions = (CSharpParseOptions)options; 72var options = new CSharpParseOptions(languageVersion, documentationMode, kind, preprocessorSymbolNames);
Simplification\Reducers\AbstractCSharpReducer.AbstractReductionRewriter.cs (2)
24protected CSharpParseOptions? ParseOptions { get; private set; } 44ParseOptions = (CSharpParseOptions)parseOptions;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
20CSharpParseOptions parseOptions,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParseOptionsExtensions.cs (1)
10=> ((CSharpParseOptions)options).LanguageVersion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
24=> ((CSharpParseOptions)node.SyntaxTree.Options).LanguageVersion;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\CSharpInferredMemberNameSimplifier.cs (1)
13internal static bool CanSimplifyTupleElementName(ArgumentSyntax node, CSharpParseOptions parseOptions)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
38=> new(context, (CSharpCodeGenerationOptions)options, this, ((CSharpParseOptions)parseOptions).LanguageVersion);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxGeneratorInternal.cs (1)
167=> ((CSharpParseOptions)options).LanguageVersion >= LanguageVersion.CSharp7;
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (1)
57=> CSharpGeneratorDriver.Create(generators, additionalTexts, (CSharpParseOptions)parseOptions, optionsProvider, new GeneratorDriverOptions(baseDirectory: generatedFilesBaseDirectory));
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.cs (8)
21private static readonly CSharpParseOptions _parseOptionWithLatestLanguageVersion = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview); 30=> CSharpParseOptions.Default; 50var csharpOptions1 = (CSharpParseOptions)options1; 51var csharpOptions2 = (CSharpParseOptions)options2; 61return new ParsedSyntaxTree(text, (CSharpSyntaxNode)root, (CSharpParseOptions)options, filePath, encoding, checksumAlgorithm);
Workspace\LanguageServices\CSharpSyntaxTreeFactoryService.ParsedSyntaxTree.cs (3)
23public override CSharpParseOptions Options { get; } 31CSharpParseOptions options, 82(CSharpParseOptions)options,
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (8)
CodeGeneration\SyntaxGeneratorTests.cs (1)
4000.AddSyntaxTrees(ParseSyntaxTree(src, options: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)));
CSharpCommandLineParserServiceTests.cs (5)
20private CSharpParseOptions GetParseOptions(params string[] args) 26var options = GetParseOptions("/features:test"); 33var options = GetParseOptions("/features:test=dog"); 40var options = GetParseOptions("/features:test1", "/features:test2"); 48var options = GetParseOptions("/features:test1=dog", "/features:test2=cat");
Formatting\CSharpFormattingTestBase.cs (1)
23=> SyntaxFactory.ParseCompilationUnit(text, options: (CSharpParseOptions)parseOptions);
Formatting\FormattingTests.cs (1)
7481var parseOptions = new CSharpParseOptions();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
QuickInfo\AbstractQuickInfoSourceTests.cs (1)
44CSharpParseOptions parseOptions = null);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
CodeGeneration\CodeGenerationTests.cs (1)
994: TestWorkspace.CreateCSharp(file, (CS.CSharpParseOptions)parseOptions, (CS.CSharpCompilationOptions)compilationOptions);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (4)
Simplification\AbstractSimplificationTests.vb (2)
20Private Protected Shared Async Function TestAsync(definition As XElement, expected As XElement, Optional options As OptionsCollection = Nothing, Optional csharpParseOptions As CSharpParseOptions = Nothing) As System.Threading.Tasks.Task 27Protected Shared Async Function CreateTestWorkspaceAsync(definition As XElement, Optional csharpParseOptions As CSharpParseOptions = Nothing) As Task(Of EditorTestWorkspace)
Simplification\CastSimplificationTests.vb (2)
515Await TestAsync(input, expected, csharpParseOptions:=CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9)) 546Await TestAsync(input, expected, csharpParseOptions:=CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp10))
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
253var parseOptions = TestOptions.RegularPreview.WithNoRefSafetyRulesAttribute();
EditAndContinue\Extensions.cs (1)
95LanguageNames.CSharp => CSharpParseOptions.Default.WithNoRefSafetyRulesAttribute(),
Utils\Options.cs (2)
13internal static readonly CSharpParseOptions Script = new CSharpParseOptions(kind: SourceCodeKind.Script); 14internal static readonly CSharpParseOptions Regular = new CSharpParseOptions(kind: SourceCodeKind.Regular);
Microsoft.CodeAnalysis.Rebuild (5)
CSharpCompilationFactory.cs (5)
19public new CSharpParseOptions ParseOptions { get; } 28CSharpParseOptions parseOptions, 56private static (CSharpCompilationOptions, CSharpParseOptions) CreateCSharpCompilationOptions(string assemblyFileName, CompilationOptionsReader optionsReader) 77var parseOptions = CSharpParseOptions.Default.WithLanguageVersion(langVersion)
Microsoft.CodeAnalysis.Rebuild.UnitTests (10)
CSharpDeterministicKeyBuilderTests.cs (10)
23public sealed class CSharpDeterministicKeyBuilderTests : DeterministicKeyBuilderTests<CSharpCompilation, CSharpCompilationOptions, CSharpParseOptions> 27protected override SyntaxTree ParseSyntaxTree(string content, string fileName, SourceHashAlgorithm hashAlgorithm, CSharpParseOptions? parseOptions) => 46protected override CSharpParseOptions GetParseOptions() => CSharpParseOptions.Default; 58verifyCount<CSharpParseOptions>(12); 326var parseOptions = CSharpParseOptions.Default.WithLanguageVersion(languageVersion); 358var parseOptions = CSharpParseOptions.Default.WithPreprocessorSymbols(values); 427syntaxTrees: new[] { CSharpSyntaxTree.ParseText(@"// this is a comment", CSharpParseOptions.Default.WithLanguageVersion(CSharp.LanguageVersion.CSharp10)) },
Microsoft.CodeAnalysis.Test.Utilities (8)
CommonTestBase.cs (7)
262CSharp.CSharpParseOptions parseOptions = null, 273CSharp.CSharpParseOptions parseOptions = null, 316CSharp.CSharpParseOptions parseOptions = null, 327CSharp.CSharpParseOptions parseOptions = null, 338CSharp.CSharpParseOptions parseOptions = null, 350CSharp.CSharpParseOptions parseOptions = null, 363parseOptions = CSharp.CSharpParseOptions.Default.WithLanguageVersion(CSharp.LanguageVersion.Default).WithDocumentationMode(DocumentationMode.None);
Syntax\TokenUtilities.cs (1)
100return CS.SyntaxFactory.ParseCompilationUnit(expectedText, options: (CS.CSharpParseOptions)options);
Microsoft.CodeAnalysis.UnitTests (2)
Diagnostics\AnalysisContextInfoTests.cs (2)
26var parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None) 108private static Compilation CreateCompilation(string source, CSharpParseOptions parseOptions = null)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (8)
MSBuildWorkspaceTestBase.cs (4)
38protected async Task AssertCSParseOptionsAsync<T>(T expected, Func<CS.CSharpParseOptions, T> actual) 40var options = await LoadCSharpParseOptionsAsync(); 65protected async Task<CS.CSharpParseOptions> LoadCSharpParseOptionsAsync() 71return (CS.CSharpParseOptions)project.ParseOptions;
VisualStudioMSBuildWorkspaceTests.cs (4)
2552var parseOptions = (CS.CSharpParseOptions)project.ParseOptions; 2588var csoptions = (CS.CSharpParseOptions)csproject.ParseOptions;
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Workspaces\TestWorkspace_XmlConsumption.cs (1)
313return ((CSharpParseOptions)parseOptions).WithLanguageVersion(languageVersion);
Workspaces\TestWorkspace_XmlCreation.cs (2)
104var csharpOptions = parseOptions as CSharpParseOptions;
Microsoft.CodeAnalysis.Workspaces.UnitTests (21)
Host\LanguageServices\TestCSharpCompilationFactoryServiceWithIncrementalGeneratorTracking.cs (1)
60return CSharpGeneratorDriver.Create(generators, additionalTexts, (CSharpParseOptions)parseOptions, optionsProvider, new GeneratorDriverOptions(IncrementalGeneratorOutputKind.None, trackIncrementalGeneratorSteps: true, baseDirectory: TempRoot.Root));
SolutionTests\SolutionTests.cs (18)
70parseOptions1 ??= CSharpParseOptions.Default; 71parseOptions2 ??= CSharpParseOptions.Default; 275solution = solution.WithProjectParseOptions(projectId, CSharpParseOptions.Default.WithKind(SourceCodeKind.Script)); 589var parseOptions1 = CSharpParseOptions.Default.WithPreprocessorSymbols("UNIQUE_NAME"); 590var parseOptions2 = CSharpParseOptions.Default; 681""", CSharpParseOptions.Default.WithPreprocessorSymbols("UNIQUE_NAME"), CSharpParseOptions.Default); 831var parseOptions1 = CSharpParseOptions.Default; 1420parseOptions: CS.CSharpParseOptions.Default, 1766var options = new CSharpParseOptions(CS.LanguageVersion.CSharp1); 3046var newParseOptions = new CSharpParseOptions(preprocessorSymbols: ["AFTER"]); 4416var options = (CSharpParseOptions)document1.Project.ParseOptions; 5805.WithParseOptions(CSharpParseOptions.Default.WithPreprocessorSymbols("DEBUG")) 5815.WithParseOptions(CSharpParseOptions.Default.WithPreprocessorSymbols("RELEASE"))
WorkspaceTests\AdhocWorkspaceTests.cs (2)
386var parseOptions = proj.ParseOptions as CS.CSharpParseOptions;
Microsoft.DotNet.GenFacades (1)
TypeParser.cs (1)
135CSharpParseOptions options = new CSharpParseOptions(languageVersion: languageVersion, preprocessorSymbols: constants);
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
631if (((CSharpParseOptions)syntaxTree.Options).LanguageVersion < LanguageVersion.CSharp12)
Microsoft.ML.CodeAnalyzer.Tests (3)
Code\BestFriendTest.cs (1)
69projectA = projectA.WithParseOptions(((CSharpParseOptions)projectA.ParseOptions).WithLanguageVersion(LanguageVersion.CSharp7_2));
Helpers\CSharpCodeFixVerifier`2.cs (2)
72var parseOptions = (CSharpParseOptions)solution.GetProject(projectId).ParseOptions;
Microsoft.VisualStudio.LanguageServices.CSharp (9)
ChangeSignature\CSharpChangeSignatureViewModelFactoryService.cs (1)
21private static readonly CSharpParseOptions s_langVersionLatestParseOptions = new(LanguageVersion.Preview);
LanguageService\CSharpEditorFactory.cs (1)
33if (project.ParseOptions is CSharpParseOptions parseOptions &&
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
229return ((CSharpParseOptions)parseOptions).WithKind(SourceCodeKind.Regular)
Utilities\CSharpParseOptionsChangingService.cs (6)
27var oldCSharpOptions = (CSharpParseOptions)oldOptions; 28var newCSharpOptions = (CSharpParseOptions)newOptions; 58var csharpOptions = (CSharpParseOptions)options;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (14)
ProjectSystemShim\CPS\AdditionalPropertiesTests.cs (4)
57var oldParseOptions = (CSharpParseOptions)project.ParseOptions; 84var oldParseOptions = (CSharpParseOptions)project.ParseOptions;
ProjectSystemShim\LegacyProject\CSharpCompilerOptionsTests.cs (10)
36var options = (CSharpParseOptions)workspaceProject.ParseOptions; 50var options = (CSharpParseOptions)workspaceProject.ParseOptions; 64var options = (CSharpParseOptions)workspaceProject.ParseOptions; 191var oldParseOptions = (CSharpParseOptions)project.ParseOptions; 222var oldParseOptions = (CSharpParseOptions)project.ParseOptions;
Roslyn.VisualStudio.Next.UnitTests (1)
Services\AssetProviderTests.cs (1)
35await TestAssetAsync(Microsoft.CodeAnalysis.CSharp.CSharpParseOptions.Default);
StackDepthTest (1)
Program.cs (1)
77var parseOptions = new CSharpParseOptions(kind: SourceCodeKind.Regular, documentationMode: DocumentationMode.None);
System.Windows.Forms.Analyzers.CSharp.Tests (2)
Analyzers\Verifiers\CSharpIncrementalSourceGeneratorVerifier.cs (2)
38var parseOptions = (CSharpParseOptions)base.CreateParseOptions();