Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on the Roslyn lexer by default for .NET 10 Razor projects #45808

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/RazorSdk/Targets/Sdk.Razor.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ Copyright (c) .NET Foundation. All rights reserved.

<!-- Resolve the TFM-specific attributes conditionally. -->
<Choose>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '10.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
<_TargetingNET50OrLater>true</_TargetingNET50OrLater>
<_TargetingNET60OrLater>true</_TargetingNET60OrLater>
<_TargetingNET70OrLater>true</_TargetingNET70OrLater>
<_TargetingNET80OrLater>true</_TargetingNET80OrLater>
<_TargetingNET90OrLater>true</_TargetingNET90OrLater>
<_TargetingNET100OrLater>true</_TargetingNET100OrLater>
<UseRazorSourceGenerator Condition="'$(Language)' == 'C#' AND '$(UseRazorSourceGenerator)' == '' ">true</UseRazorSourceGenerator>
<RazorLangVersion Condition="'$(RazorLangVersion)' == '' ">9.0</RazorLangVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is intentionally 9.0 not 10.0 because we want to switch to newer lang version only later in the cycle?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct; I also expect that putting 10.0 here would break until the razor compiler knows what that is.

<_RazorUseRoslynTokenizer Condition="'$(_RazorUseRoslynTokenizer)'==''">true</_RazorUseRoslynTokenizer>
<Features Condition="'$(_RazorUseRoslynTokenizer)'=='true'">use-roslyn-tokenizer=true;$(Features)</Features>
</PropertyGroup>
</When>
<When Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '9.0')) ">
<PropertyGroup>
<_TargetingNETCoreApp30OrLater>true</_TargetingNETCoreApp30OrLater>
Expand Down
Loading