347 references to 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>("InterceptorsNamespaces", "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>("InterceptorsNamespaces", "Microsoft.AspNetCore.Http.Generated") });
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CSharpCompiler.cs (1)
216var parseOptions = new CSharpParseOptions(preprocessorSymbols: (IEnumerable<string>)defines);
Microsoft.CodeAnalysis.CSharp (1)
CSharpParseOptions.cs (1)
22public static CSharpParseOptions Default { get; } = new CSharpParseOptions();
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)
1836""", 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)
2728""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 2762""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 2783""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 3002""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3019""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 3114""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3137""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 3251""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3288""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 5466""", optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 7769""", PreferDiscard, new CSharpParseOptions(LanguageVersion.CSharp9)); 8229""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8245""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8269""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8293""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8313""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8464""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8487""", PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 8878""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)); 8916""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9118""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9139""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 9156""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9182""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9250""", options: PreferDiscard, parseOptions: new CSharpParseOptions(languageVersion)); 9268""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 9300""", 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(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)
3094[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)
35parseOptions = new CSharpParseOptions().WithFeatures(featuresMapped);
ExtractMethod\ExtractMethodTests.cs (1)
10420await TestExtractMethodAsync(code, expected, parseOptions: new CSharpParseOptions(kind: SourceCodeKind.Script));
ExtractMethod\ExtractMethodTests.LanguageInteraction.cs (1)
1388await 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)
4427await TestInRegularAndScriptAsync(source, output, parseOptions: new CSharpParseOptions(CodeAnalysis.CSharp.LanguageVersion.CSharp7_3)); 4471await 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(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)
52var unusedParseOptions = new CSharpParseOptions(LanguageVersion.CSharp1);
GenerateVariable\GenerateVariableTests.cs (1)
4820index: 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)
1836""", 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)
2728""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 2762""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 2783""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 3002""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3019""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 3114""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3137""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 3251""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 3288""", optionName: optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp9)); 5466""", optionName, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 7769""", PreferDiscard, new CSharpParseOptions(LanguageVersion.CSharp9)); 8229""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8245""", parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8269""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8293""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8313""", optionName: nameof(PreferDiscard), parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8464""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 8487""", PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion)); 8878""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp7_3)); 8916""", options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9118""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9139""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 9156""", new TestParameters(options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8))); 9182""", options: PreferDiscard, parseOptions: new CSharpParseOptions(LanguageVersion.CSharp8)); 9250""", options: PreferDiscard, parseOptions: new CSharpParseOptions(languageVersion)); 9268""", new TestParameters(options: PreferUnusedLocal, parseOptions: new CSharpParseOptions(languageVersion))); 9300""", 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)
7519var 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)
2095solution = solution.WithProjectParseOptions(project.Id, new CSharpParseOptions(LanguageVersion.CSharp10)); 3127solution = 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 (10)
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))
Semantics\OverloadResolutionPriorityTests.vb (8)
105" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 1011" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 1762" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2015" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2066" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2114" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2149" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference() 2189" + OverloadResolutionPriorityAttributeDefinitionCS, parseOptions:=New CSharpParseOptions(CSharp.LanguageVersion.Latest)).EmitToImageReference()
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);