Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/bcfce
Browse files Browse the repository at this point in the history
* upstream/main: (45 commits)
  Adjust an assert in EmitArgument (dotnet#75067)
  Switch to new VMR control set (dotnet#75056)
  Disallow ref assignment to ternary or another ref assignment (dotnet#75076)
  Move some emit tests from Emit2 to Emit3 to avoid hitting UserString heap limit (dotnet#75091)
  BindAttributeCore - use proper binder to avoid an attribute binding cycle (dotnet#75060)
  Remove buggy IsPublic method from TypeAttributesExtensions (dotnet#75081)
  Include initial filter node when searching for nodes to order modifiers
  Remove additional Gitter link (dotnet#75086)
  Remove newlines between test run information sections
  Log messages for Test Results
  Fix stack adjustment when emitting stackalloc (dotnet#75042)
  Lock translation of strings used to demonstrate identifier naming styles
  docs: Correct SDK version in documentation to match global.json (dotnet#75038)
  Add a test observing lack of an issue. (dotnet#75057)
  Fix preview refresh on selection for enum flags checkboxes
  Semantic snippets: handle case with inline statement snippets before member access expression (dotnet#74966)
  Configure release/vscode branch for nuget publishing
  Remove MS.CA.Test.Resources.Proprietary PackageReference (dotnet#75037)
  Allow suppressing nullability warnings in more ref scenarios (dotnet#74498)
  Update dependencies from https://github.com/dotnet/arcade build 20240909.6 (dotnet#75040)
  ...
  • Loading branch information
333fred committed Sep 13, 2024
2 parents 4747e57 + 483c6ad commit fc51036
Show file tree
Hide file tree
Showing 254 changed files with 5,653 additions and 1,934 deletions.
3 changes: 1 addition & 2 deletions Directory.Build.rsp
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Workaround for https://github.com/dotnet/sdk/issues/41791
-p:_IsDisjointMSBuildVersion=false
# This file intentionally left blank to avoid accidental import during build.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ If you are interested in fixing issues and contributing directly to the code bas

The Roslyn community can be found on [GitHub Discussions](https://github.com/dotnet/roslyn/discussions), where you can ask questions, voice ideas, and share your projects.

To chat with other community members, you can join the Roslyn [Discord](https://discord.com/invite/tGJvv88) or [Gitter](https://gitter.im/dotnet/roslyn).
To chat with other community members, you can join the Roslyn channel on the [CSharp Community Discord](https://discord.com/invite/tGJvv88).

Our [Code of Conduct](CODE-OF-CONDUCT.md) applies to all Roslyn community channels and has adopted the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Particularly for developers who aren't experienced with .NET Core development on
1. Install [VS Code](https://code.visualstudio.com/Download)
- After you install VS Code, install the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp)
- Important tip: You can look up editor commands by name by hitting *Ctrl+Shift+P*, or by hitting *Ctrl+P* and typing a `>` character. This will help you get familiar with editor commands mentioned below. On a Mac, use ** instead of *Ctrl*.
1. Install the [.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) which matches the `sdk.version` property in [global.json](../../global.json#L3)
1. Install the [.NET 9.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) which matches the `sdk.version` property in [global.json](../../global.json#L3)
3. You can build from VS Code by running the *Run Build Task* command, then selecting an appropriate task such as *build* or *build current project* (the latter builds the containing project for the current file you're viewing in the editor).
4. You can run tests from VS Code by opening a test class in the editor, then using the *Run Tests in Context* and *Debug Tests in Context* editor commands. You may want to bind these commands to keyboard shortcuts that match their Visual Studio equivalents (**Ctrl+R, T** for *Run Tests in Context* and **Ctrl+R, Ctrl+T** for *Debug Tests in Context*).
5. You can launch a new VS Code instance with the language server from your current code by running the "launch vscode with language server" task.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The minimal required version of .NET Framework is 4.7.2.
- Ensure C# and Visual Basic, MSBuild, and .NET Core are included in the selected individual components
- Ensure "Use previews of the .NET Core SDK" is checked in Tools -> Options -> Environment -> Preview Features
- Restart Visual Studio
1. Install the [.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) which matches the `sdk.version` property in [global.json](../../global.json#L3)
1. Install the [.NET 9.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/9.0) which matches the `sdk.version` property in [global.json](../../global.json#L3)
1. [PowerShell 5.0 or newer](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell). If you are on Windows 10, you are fine; you'll only need to upgrade if you're on earlier versions of Windows. The download link is under the ["Upgrading existing Windows PowerShell"](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell) heading.
1. Run Restore.cmd
1. Open Roslyn.sln
Expand Down
2 changes: 1 addition & 1 deletion docs/features/incremental-generators.cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ Now, consider that the generator author wants to optionally allow opting in/out
This value of `MyGenerator_EnableLogging` will be emitted to a generated analyzer config file, for each of the additional files in the compilation, with an item name of `build_metadata.AdditionalFiles.MyGenerator_EnableLogging`. The generator can read this value in the context of each additional file:

```cs
context.AdditionalFilesProvider
context.AdditionalTextsProvider
.Combine(context.AnalyzerConfigOptionsProvider)
.Select((pair, ctx) =>
pair.Right.GetOptions(pair.Left).TryGetValue("build_metadata.AdditionalFiles.MyGenerator_EnableLogging", out var perFileLoggingSwitch)
Expand Down
7 changes: 3 additions & 4 deletions eng/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
https://github.com/dotnet/sdk/blob/main/src/Layout/redist/minimumMSBuildVersion#L1
-->

<ItemGroup Condition="'$(DotnetBuildFromSource)' == 'true'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<PackageVersion Include="Microsoft.Build" Version="17.3.4" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.3.4" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.3.4" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.3.4" />
</ItemGroup>

<ItemGroup Condition="'$(DotnetBuildFromSource)' != 'true' and '$(TargetFramework)' != 'net472'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetFramework)' != 'net472'">
<PackageVersion Include="Microsoft.Build" Version="17.7.2" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.7.2" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.7.2" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.7.2" />
</ItemGroup>

<ItemGroup Condition="'$(DotnetBuildFromSource)' != 'true' and '$(TargetFramework)' == 'net472'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetFramework)' == 'net472'">
<PackageVersion Include="Microsoft.Build" Version="17.10.4" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.10.4" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.10.4" />
Expand Down Expand Up @@ -255,7 +255,6 @@
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Analyzer.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeFix.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.CodeRefactoring.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Test.Resources.Proprietary" Version="2.0.44" />
<PackageVersion Include="Microsoft.DiaSymReader.Converter" Version="1.1.0-beta2-22302-02" />
<PackageVersion Include="Microsoft.DiaSymReader.Converter.Xml" Version="1.1.0-beta2-22302-02" />
<PackageVersion Include="Microsoft.Metadata.Visualizer" Version="1.0.0-beta3.21075.2" />
Expand Down
1 change: 1 addition & 0 deletions eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<Target Name="ConfigureInnerBuildArg" BeforeTargets="GetSourceBuildCommandConfiguration">
<PropertyGroup>
<InnerBuildArgs>$(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)Roslyn.sln"</InnerBuildArgs>
<InnerBuildArgs Condition="'$(DotNetBuildSourceOnly)'=='true'">$(InnerBuildArgs) /p:RestoreUseStaticGraphEvaluation=false</InnerBuildArgs>
</PropertyGroup>
</Target>

Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24429.5">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24459.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>d21db44e84b9038ea7b2add139adee2303d46800</Sha>
<Sha>65260b148c869ada772a5843863c54737cd2361e</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24429.5">
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24459.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>d21db44e84b9038ea7b2add139adee2303d46800</Sha>
<Sha>65260b148c869ada772a5843863c54737cd2361e</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="1.0.0-beta.23475.1" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
Expand All @@ -156,9 +156,9 @@
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>5d10d428050c0d6afef30a072c4ae68776621877</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.24429.5">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.24459.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>d21db44e84b9038ea7b2add139adee2303d46800</Sha>
<Sha>65260b148c869ada772a5843863c54737cd2361e</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview.23468.1">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
<SystemIdentityModelTokensJwtVersion>6.34.0</SystemIdentityModelTokensJwtVersion>
<!-- TODO: remove https://github.com/dotnet/roslyn/issues/71827 -->
<MicrosoftDotNetXliffTasksVersion Condition="'$(DotnetBuildFromSource)' != 'true'">9.0.0-beta.24076.5</MicrosoftDotNetXliffTasksVersion>
<MicrosoftDotNetXliffTasksVersion Condition="'$(DotNetBuildSourceOnly)' != 'true'">9.0.0-beta.24076.5</MicrosoftDotNetXliffTasksVersion>
<MicrosoftIdentityClientVersion>4.61.3</MicrosoftIdentityClientVersion>
<SystemIdentityModelTokensJwtVersion>6.34.0</SystemIdentityModelTokensJwtVersion>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ function BuildSolution() {
# Workaround for some machines in the AzDO pool not allowing long paths
$ibcDir = $RepoRoot

# Set DotNetBuildFromSource to 'true' if we're simulating building for source-build.
$buildFromSource = if ($sourceBuild) { "/p:DotNetBuildFromSource=true" } else { "" }
# Set DotNetBuildSourceOnly to 'true' if we're simulating building for source-build.
$buildFromSource = if ($sourceBuild) { "/p:DotNetBuildSourceOnly=true" } else { "" }

$generateDocumentationFile = if ($skipDocumentation) { "/p:GenerateDocumentationFile=false" } else { "" }
$roslynUseHardLinks = if ($ci) { "/p:ROSLYNUSEHARDLINKS=true" } else { "" }
Expand Down
12 changes: 8 additions & 4 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ while [[ $# > 0 ]]; do
--warnaserror)
warn_as_error=true
;;
--sourcebuild|/p:arcadebuildfromsource=true)
# Arcade specifies /p:ArcadeBuildFromSource=true instead of --sourceBuild, but that's not developer friendly so we
# have an alias.
--sourcebuild)
source_build=true
# RestoreUseStaticGraphEvaluation will cause prebuilts
restoreUseStaticGraphEvaluation=false
Expand Down Expand Up @@ -281,6 +279,12 @@ function BuildSolution {
roslyn_use_hard_links="/p:ROSLYNUSEHARDLINKS=true"
fi

local source_build_args=""
if [[ "$source_build" == true ]]; then
source_build_args="/p:DotNetBuildSourceOnly=true \
/p:DotNetBuildRepo=true"
fi

# Setting /p:TreatWarningsAsErrors=true is a workaround for https://github.com/Microsoft/msbuild/issues/3062.
# We don't pass /warnaserror to msbuild (warn_as_error is set to false by default above), but set
# /p:TreatWarningsAsErrors=true so that compiler reported warnings, other than IDE0055 are treated as errors.
Expand All @@ -302,7 +306,7 @@ function BuildSolution {
/p:ContinuousIntegrationBuild=$ci \
/p:TreatWarningsAsErrors=true \
/p:TestRuntimeAdditionalArguments=$test_runtime_args \
/p:ArcadeBuildFromSource=$source_build \
$source_build_args \
$test_runtime \
$mono_tool \
$generate_documentation_file \
Expand Down
9 changes: 9 additions & 0 deletions eng/config/PublishData.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@
},
"comment-about-servicing-branches": "For a list of VS versions under servicing, see https://docs.microsoft.com/en-us/visualstudio/releases/2019/servicing#support-options-for-enterprise-and-professional-customers",
"branches": {
"release/vscode": {
"nugetKind": [
"Shipping",
"NonShipping"
],
"vsBranch": "main",
"insertionCreateDraftPR": true,
"insertionTitlePrefix": "[Validation]"
},
"dev15.9.x-vs-deps": {
"nugetKind": "PerBuildPreRelease",
"vsBranch": "rel/d15.9",
Expand Down
2 changes: 1 addition & 1 deletion eng/generate-vssdk-versions.csx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ foreach (var (id, version) in properties)
else if (!seenMsbuild)
{
Console.WriteLine($$"""
<ItemGroup Condition="'$(DotnetBuildFromSource)' != 'true' and '$(TargetFramework)' == 'net472'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(TargetFramework)' == 'net472'">
<PackageVersion Include="Microsoft.Build" Version="{{version}}" />
<PackageVersion Include="Microsoft.Build.Framework" Version="{{version}}" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="{{version}}" />
Expand Down
2 changes: 1 addition & 1 deletion eng/targets/DiaSymReaderNative.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package can't be referenced directly but rather has to have it's assets manually copied
out. This logic is responsible for doing that.
-->
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true'">
<Content Include="$(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\Microsoft.DiaSymReader.Native.x86.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
Expand Down
2 changes: 1 addition & 1 deletion eng/targets/Imports.BeforeArcade.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<!-- do not restore or use the 8.0 app host in source-build -->
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<UseAppHost>false</UseAppHost>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion eng/targets/Imports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
<UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.CompareVersions" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
<UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.SingleError" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />

<Target Name="_CheckRequiredMSBuildVersion" BeforeTargets="BeforeBuild" Condition="'$(DotNetBuildFromSource)' != 'true'">
<Target Name="_CheckRequiredMSBuildVersion" BeforeTargets="BeforeBuild" Condition="'$(DotNetBuildSourceOnly)' != 'true'">
<CompareVersions Left="$(MSBuildVersion)" Right="$(MinimumMSBuildVersion)">
<Output TaskParameter="Result" PropertyName="_VersionComparisonResult"/>
</CompareVersions>
Expand Down
14 changes: 4 additions & 10 deletions eng/targets/Settings.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateFullPaths>true</GenerateFullPaths>
<EnableWindowsTargeting Condition="'$(DotNetBuildFromSource)' != 'true'">true</EnableWindowsTargeting>
<EnableWindowsTargeting Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</EnableWindowsTargeting>

<!-- Set to non-existent file to prevent common targets from importing Microsoft.CodeAnalysis.targets -->
<CodeAnalysisTargets>NON_EXISTENT_FILE</CodeAnalysisTargets>
Expand Down Expand Up @@ -61,12 +61,6 @@
<!-- TODO -->
<_SkipUpgradeNetAnalyzersNuGetWarning>true</_SkipUpgradeNetAnalyzersNuGetWarning>

<!--
Needed to avoid error NU1010: The PackageReference items Microsoft.Net.Compilers.Toolset.Framework do not have corresponding PackageVersion.
Related to https://github.com/dotnet/sdk/issues/41791.
-->
<BuildWithNetFrameworkHostedCompiler>false</BuildWithNetFrameworkHostedCompiler>

<!-- https://github.com/dotnet/msbuild/issues/10306 -->
<CoreCompileDependsOn>$(CoreCompileDependsOn);ResolveKeySource</CoreCompileDependsOn>
</PropertyGroup>
Expand Down Expand Up @@ -160,7 +154,7 @@
<!--
Analyzers
-->
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" PrivateAssets="all" />
<PackageReference Include="Roslyn.Diagnostics.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" PrivateAssets="all" />
Expand All @@ -175,7 +169,7 @@
<!--
Code indexing targets to help generating LSIF from indexing builds.
-->
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true'">
<PackageReference Include="RichCodeNav.EnvVarDump" PrivateAssets="all" />
</ItemGroup>

Expand Down Expand Up @@ -255,7 +249,7 @@
</When>
</Choose>

<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<!-- https://github.com/dotnet/roslyn/issues/38433 Vbc does not like the extra semicolon -->
<DefineConstants Condition="'$(DefineConstants)' != ''">DOTNET_BUILD_FROM_SOURCE;$(DefineConstants)</DefineConstants>
<DefineConstants Condition="'$(DefineConstants)' == ''">DOTNET_BUILD_FROM_SOURCE</DefineConstants>
Expand Down
4 changes: 2 additions & 2 deletions eng/targets/TargetFrameworks.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
bootstrap toolset in other repos doing (1). Those can be using a NetPrevious runtime hence
the toolset must support that.
-->
<When Condition="'$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' != 'Product'">
<When Condition="'$(DotNetBuildSourceOnly)' == 'true' AND '$(DotNetBuildOrchestrator)' != 'true'">
<PropertyGroup>
<!-- TODO until we figure out what is up with NetPrevious -->
<NetPrevious>$(NetMinimum)</NetPrevious>
Expand All @@ -50,7 +50,7 @@
<!--
2. Source build the product: this is the all up build of the product which needs only NetCurrent
-->
<When Condition="'$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' == 'Product'">
<When Condition="'$(DotNetBuildSourceOnly)' == 'true' AND '$(DotNetBuildOrchestrator)' == 'true'">
<PropertyGroup>
<NetRoslyn>$(NetCurrent)</NetRoslyn>
<NetRoslynSourceBuild>$(NetCurrent);$(NetPrevious)</NetRoslynSourceBuild>
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24429.5",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24429.5",
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24459.6",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24459.6",
"Microsoft.Build.Traversal": "3.4.0"
}
}
18 changes: 18 additions & 0 deletions src/Analyzers/CSharp/Tests/OrderModifiers/OrderModifiersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,4 +558,22 @@ file abstract class C
}
""");
}

[Fact, WorkItem("https://github.com/dotnet/vscode-csharp/issues/7553")]
public async Task TestEmptySelection()
{
await TestInRegularAndScript1Async(
"""
namespace M;
[||]static internal class C
{
}
""",
"""
namespace M;
internal static class C
{
}
""", TestParameters.Default.WithIncludeDiagnosticsOutsideSelection(false));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context, CompilationOpt
return;
}

Recurse(context, preferredOrder, option.Notification, context.GetAnalysisRoot(findInTrivia: false));
var analysisRoot = context.GetAnalysisRoot(findInTrivia: false);

// Check the root node first to see if it has any modifiers that need reordering.
CheckModifiers(context, preferredOrder, option.Notification, analysisRoot);

// Recurse to check the child nodes.
Recurse(context, preferredOrder, option.Notification, analysisRoot);
}

protected abstract void Recurse(
Expand Down
Loading

0 comments on commit fc51036

Please sign in to comment.