2 writes to LanguageVersion
Microsoft.CodeAnalysis.CSharp (2)
CSharpParseOptions.cs (2)
72this.LanguageVersion = languageVersion.MapSpecifiedToEffectiveVersion(); 107return new CSharpParseOptions(this) { SpecifiedLanguageVersion = version, LanguageVersion = effectiveLanguageVersion };
59 references to LanguageVersion
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
DependencyInjection\RazorRuntimeCompilationMvcCoreBuilderExtensions.cs (1)
110builder.SetCSharpLanguageVersion(csharpCompiler.ParseOptions.LanguageVersion);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CSharpCompilerTest.cs (1)
125Assert.Equal(LanguageVersion.CSharp8, parseOptions.LanguageVersion);
Microsoft.CodeAnalysis.CSharp (16)
CommandLine\CSharpCommandLineParser.cs (2)
1536if (nullableContextOptions != NullableContextOptions.Disable && parseOptions.LanguageVersion < MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion()) 1539"nullable", nullableContextOptions, parseOptions.LanguageVersion.ToDisplayString(),
Compilation\CSharpCompilation.cs (1)
534var version = ((CSharpParseOptions)tree.Options).LanguageVersion;
Compilation\CSharpDeterministicKeyBuilder.cs (1)
49writer.Write("languageVersion", csharpOptions.LanguageVersion);
CSharpParseOptions.cs (3)
238if (!LanguageVersion.IsValid()) 240builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadLanguageVersion, LanguageVersion.ToString())); 266LanguageVersion availableVersion = LanguageVersion;
Errors\MessageID.cs (1)
447=> options.IsFeatureEnabled(feature) ? null : GetDisabledFeatureDiagnosticInfo(feature, options.LanguageVersion);
Parser\DirectiveParser.cs (2)
345if (this.Options.LanguageVersion != LanguageVersion.Preview && 349ErrorCode error = this.Options.LanguageVersion.GetErrorCode();
Symbols\Source\ModifierUtils.cs (2)
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\SourcePropertySymbol.cs (1)
452LanguageVersion availableVersion = ((CSharpParseOptions)location.SourceTree.Options).LanguageVersion;
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
169LanguageVersion availableVersion = ((CSharpParseOptions)location.SourceTree.Options).LanguageVersion;
Symbols\Symbol_Attributes.cs (1)
697if (parseOptions.LanguageVersion == LanguageVersion.CSharp1)
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
72if (csOptions.LanguageVersion < LanguageVersion.CSharp7)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
25if (parseOptions.LanguageVersion < LanguageVersion.CSharp7_1 ||
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)
21if (parseOptions.LanguageVersion < LanguageVersion.CSharp7_1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
112return mappedVersion >= parseOptions.LanguageVersion &&
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.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
1612Assert.Equal(expectedVersion, parsedArgs.ParseOptions.LanguageVersion); 1617Assert.Equal(expectedVersion, scriptParsedArgs.ParseOptions.LanguageVersion); 1647Assert.Equal(defaultEffectiveVersion, parsedArgs.ParseOptions.LanguageVersion); 1660Assert.Equal(latestEffectiveVersion, parsedArgs.ParseOptions.LanguageVersion);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (2)
2839<Project Language=""C#"" AssemblyName=""Assembly1"" CommonReferences=""true"" LanguageVersion=""{TestOptions.Regular11.LanguageVersion.ToDisplayString()}""> 2878<Project Language=""C#"" AssemblyName=""Assembly1"" CommonReferences=""true"" LanguageVersion=""{TestOptions.Regular11.LanguageVersion.ToDisplayString()}"">
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
PDB\CSharpDeterministicBuildCompilationTests.cs (3)
148parseOptions.LanguageVersion.MapSpecifiedToEffectiveVersion().ToDisplayString(), 211parseOptions.LanguageVersion.MapSpecifiedToEffectiveVersion().ToDisplayString(), 272parseOptions.LanguageVersion.MapSpecifiedToEffectiveVersion().ToDisplayString(),
Microsoft.CodeAnalysis.CSharp.Features (5)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
64ParseOptions: CSharpParseOptions { LanguageVersion: >= LanguageVersion.CSharp8 },
MetadataAsSource\CSharpMetadataAsSourceService.cs (1)
107if (options.LanguageVersion < LanguageVersion.CSharp8)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
89if (parseOptions.LanguageVersion < LanguageVersion.CSharp8)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
72if (csOptions.LanguageVersion < LanguageVersion.CSharp7)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (1)
112return mappedVersion >= parseOptions.LanguageVersion &&
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ScriptOptionsTests.cs (1)
23Assert.Equal(LanguageVersion.CSharp8, ((CSharpParseOptions)options.ParseOptions).LanguageVersion);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\BetterCandidates.cs (1)
32Debug.Assert(TestOptions.Regular.LanguageVersion >= MessageID.IDS_FeatureImprovedOverloadCandidates.RequiredVersion());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Compilation\UsedAssembliesTests.cs (1)
190LanguageVersion treeLanguageVersion = ((CSharpParseOptions)tree.Options).LanguageVersion;
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\CSharpParseOptionsTests.cs (1)
45TestProperty((old, value) => old.WithLanguageVersion(value), opt => opt.LanguageVersion, LanguageVersion.CSharp3);
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\DefaultExpressionSyntaxExtensions.cs (1)
25if (parseOptions.LanguageVersion < LanguageVersion.CSharp7_1 ||
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)
21if (parseOptions.LanguageVersion < LanguageVersion.CSharp7_1)
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.Workspaces.MSBuild.UnitTests (4)
VisualStudioMSBuildWorkspaceTests.cs (4)
1609await AssertCSParseOptionsAsync(CS.LanguageVersion.CSharp1, options => options.LanguageVersion); 1616await AssertCSParseOptionsAsync(CS.LanguageVersion.CSharp2, options => options.LanguageVersion); 1623await AssertCSParseOptionsAsync(CS.LanguageVersion.CSharp3, options => options.LanguageVersion); 1630await AssertCSParseOptionsAsync(CS.LanguageVersion.CSharp7_3.MapSpecifiedToEffectiveVersion(), options => options.LanguageVersion);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Workspaces\TestWorkspace_XmlCreation.cs (1)
108return new XAttribute(LanguageVersionAttributeName, CodeAnalysis.CSharp.LanguageVersionFacts.ToDisplayString(csharpOptions.LanguageVersion));
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
631if (((CSharpParseOptions)syntaxTree.Options).LanguageVersion < LanguageVersion.CSharp12)
Microsoft.VisualStudio.LanguageServices.CSharp (2)
Utilities\CSharpParseOptionsChangingService.cs (2)
40else if (newCSharpOptions.LanguageVersion == LanguageVersion.Preview) 52return newCSharpOptions.LanguageVersion <= parsedMaxLanguageVersion;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
ProjectSystemShim\LegacyProject\CSharpCompilerOptionsTests.cs (1)
66Assert.Equal(LanguageVersion.CSharp6, options.LanguageVersion);