diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74a9c20cb2..c72e32c07e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,10 @@ name: 'Build' env: - DotNetVersion: "8.0.100" - DotNetVersion2: "7.0.404" - DotNetVersion3: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. + DotNetVersion: "9.0.100-preview.1.24101.2" + DotNetVersion2: "8.0.201" + DotNetVersion3: "7.0.406" + DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ @@ -52,6 +53,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + ${{ env.DotNetVersion4 }} ${{ env.DotNetVersion3 }} ${{ env.DotNetVersion2 }} ${{ env.DotNetVersion }} diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index 3600c6285a..2672d41098 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -1,9 +1,10 @@ name: 'Tests net6.0' env: - DotNetVersion: "8.0.100" - DotNetVersion2: "7.0.404" - DotNetVersion3: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. + DotNetVersion: "9.0.100-preview.1.24101.2" + DotNetVersion2: "8.0.201" + DotNetVersion3: "7.0.406" + DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ @@ -55,6 +56,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + ${{ env.DotNetVersion4 }} ${{ env.DotNetVersion3 }} ${{ env.DotNetVersion2 }} ${{ env.DotNetVersion }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7fbebfd7b5..b7f5d7ea1f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,9 +1,10 @@ name: 'Tests' env: - DotNetVersion: "8.0.100" - DotNetVersion2: "7.0.404" - DotNetVersion3: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. + DotNetVersion: "9.0.100-preview.1.24101.2" + DotNetVersion2: "8.0.201" + DotNetVersion3: "7.0.406" + DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" MonoVersion: "6.12.0" Artifacts: ${{ github.workspace }}/artifacts/ @@ -55,6 +56,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: | + ${{ env.DotNetVersion4 }} ${{ env.DotNetVersion3 }} ${{ env.DotNetVersion2 }} ${{ env.DotNetVersion }} diff --git a/.pipelines/init.yml b/.pipelines/init.yml index d89ad13d59..8adcb81d47 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -1,9 +1,10 @@ parameters: # Configuration: Release Verbosity: Normal - DotNetVersion: "8.0.100" - DotNetVersion2: "7.0.404" - DotNetVersion3: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. + DotNetVersion: "9.0.100-preview.1.24101.2" + DotNetVersion2: "8.0.201" + DotNetVersion3: "7.0.406" + DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. CakeVersion: "1.1.0" NuGetVersion: "5.7.0" MonoVersion: '' @@ -35,6 +36,11 @@ steps: inputs: packageType: 'sdk' version: ${{ parameters.DotNetVersion3 }} + - task: UseDotNet@2 + displayName: Install dotnet $(DotNetVersion4) + inputs: + packageType: 'sdk' + version: ${{ parameters.DotNetVersion4 }} - task: DotNetCoreCLI@2 displayName: 'dotnet install cake' inputs: diff --git a/CHANGELOG.md b/CHANGELOG.md index dd96c86601..81f56468f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to the project will be documented in this file. +## [1.39.12] - Not Released +* Update SDKs and Roslyn ([#2603](https://github.com/OmniSharp/omnisharp-roslyn/pull/2603)) + ## [1.39.11] - 2023-12-19 * Update changelog (PR: [#2591](https://github.com/OmniSharp/omnisharp-roslyn/pull/2591)) * Update Readme text and fix broken link. ([#2581](https://github.com/OmniSharp/omnisharp-roslyn/issues/2581), PR: [#2582](https://github.com/OmniSharp/omnisharp-roslyn/pull/2582)) diff --git a/Directory.Packages.props b/Directory.Packages.props index 81e3c97cd0..ee9fe8fafb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,8 +8,8 @@ 8.0.0 17.8.0 17.3.2 - 6.8.0-rc.122 - 4.9.0-3.23611.3 + 6.10.0-preview.1.18 + 4.10.0-2.24112.8 2.6.1 @@ -42,7 +42,6 @@ - @@ -82,7 +81,7 @@ - + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 00c578bd29..a10f46cdf5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,7 +32,7 @@ resources: variables: Verbosity: Diagnostic - DotNetVersion: "8.0.100" + DotNetVersion: "8.0.201" CakeVersion: "3.0.0" NuGetVersion: "6.5.0" GitVersionVersion: "5.0.1" diff --git a/build.cake b/build.cake index 5857a75d8b..52563779b7 100644 --- a/build.cake +++ b/build.cake @@ -159,24 +159,18 @@ Task("PrepareTestAssets:CommonTestAssets") { DotNetBuild(folder, new DotNetBuildSettings() { - ToolPath = env.DotNetCommand, WorkingDirectory = folder, - Verbosity = DotNetVerbosity.Minimal + Verbosity = DotNetVerbosity.Minimal, }); } - catch + catch when (project == "ExternAlias") { // ExternalAlias has issues once in a while, try building again to get it working. - if (project == "ExternAlias") + DotNetBuild(folder, new DotNetBuildSettings() { - - DotNetBuild(folder, new DotNetBuildSettings() - { - ToolPath = env.DotNetCommand, - WorkingDirectory = folder, - Verbosity = DotNetVerbosity.Minimal - }); - } + WorkingDirectory = folder, + Verbosity = DotNetVerbosity.Minimal + }); } }); @@ -190,7 +184,6 @@ Task("PrepareTestAssets:RestoreOnlyTestAssets") DotNetRestore(new DotNetRestoreSettings() { - ToolPath = env.DotNetCommand, WorkingDirectory = folder, Verbosity = DotNetVerbosity.Minimal }); @@ -207,7 +200,6 @@ Task("PrepareTestAssets:WindowsOnlyTestAssets") DotNetBuild(folder, new DotNetBuildSettings() { - ToolPath = env.DotNetCommand, WorkingDirectory = folder, Verbosity = DotNetVerbosity.Minimal }); @@ -302,7 +294,7 @@ Task("Test") .IsDependentOn("PrepareTestAssets") .Does(() => { - var testTargetFramework = useDotNetTest ? "net7.0" : "net472"; + var testTargetFramework = useDotNetTest ? "net8.0" : "net472"; var testProjects = string.IsNullOrEmpty(testProjectArgument) ? buildPlan.TestProjects : testProjectArgument.Split(','); foreach (var testProject in testProjects) { diff --git a/build.json b/build.json index 3fa3d3f998..988db58b03 100644 --- a/build.json +++ b/build.json @@ -3,8 +3,9 @@ "DotNetChannel": "Preview", "DotNetVersions": [ "6.0.203", - "7.0.404", - "8.0.100" + "7.0.406", + "8.0.201", + "9.0.100-preview.1.24101.2" ], "RequiredMonoVersion": "6.6.0", "DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext", diff --git a/global.json b/global.json index 9b4f20aac0..054010bf22 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "8.0.201", "rollForward": "latestMinor" } -} +} \ No newline at end of file diff --git a/src/OmniSharp.Abstractions/Configuration.cs b/src/OmniSharp.Abstractions/Configuration.cs index 1c5355f25a..51031d62b4 100644 --- a/src/OmniSharp.Abstractions/Configuration.cs +++ b/src/OmniSharp.Abstractions/Configuration.cs @@ -4,7 +4,7 @@ internal static class Configuration { public static bool ZeroBasedIndices = false; - public const string RoslynVersion = "4.9.0.0"; + public const string RoslynVersion = "4.10.0.0"; public const string RoslynPublicKeyToken = "31bf3856ad364e35"; public readonly static string RoslynFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Features"); diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs index afd8544778..7e6f996b54 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs @@ -227,7 +227,7 @@ private IEnumerable ConvertToAvailableCodeAction(IEnumerabl { return actions.SelectMany(action => { - var nestedActions = action.CodeAction.GetNestedCodeActions(); + var nestedActions = action.CodeAction.NestedActions; if (!nestedActions.IsDefaultOrEmpty) { return nestedActions.Select(nestedAction => new AvailableCodeAction(nestedAction, action.CodeActionKind, action.CodeAction)); diff --git a/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj b/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj index da76c088f5..468d3b235f 100644 --- a/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj +++ b/src/OmniSharp.Roslyn/OmniSharp.Roslyn.csproj @@ -21,9 +21,6 @@ - - - diff --git a/test-assets/test-projects/Net70Project/global.json b/test-assets/test-projects/Net70Project/global.json index 64c469899c..7575cd33e5 100644 --- a/test-assets/test-projects/Net70Project/global.json +++ b/test-assets/test-projects/Net70Project/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.404" + "version": "7.0.406" } -} +} \ No newline at end of file diff --git a/test-assets/test-projects/Net80Project/global.json b/test-assets/test-projects/Net80Project/global.json index 48e1c84489..215edb91a5 100644 --- a/test-assets/test-projects/Net80Project/global.json +++ b/test-assets/test-projects/Net80Project/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100" + "version": "8.0.201" } -} +} \ No newline at end of file diff --git a/test-assets/test-projects/Net90Project/Net90Project.csproj b/test-assets/test-projects/Net90Project/Net90Project.csproj new file mode 100644 index 0000000000..92e46ddacc --- /dev/null +++ b/test-assets/test-projects/Net90Project/Net90Project.csproj @@ -0,0 +1,8 @@ + + + + Exe + net9.0 + + + diff --git a/test-assets/test-projects/Net90Project/Program.cs b/test-assets/test-projects/Net90Project/Program.cs new file mode 100644 index 0000000000..dbae8113d5 --- /dev/null +++ b/test-assets/test-projects/Net90Project/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace ProjectAndSolution +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/test-assets/test-projects/Net90Project/global.json b/test-assets/test-projects/Net90Project/global.json new file mode 100644 index 0000000000..d96cd4631a --- /dev/null +++ b/test-assets/test-projects/Net90Project/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "9.0.100-preview.1.24101.2" + } +} \ No newline at end of file diff --git a/tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj b/tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj index 7358d5b9ad..e4d1b86590 100644 --- a/tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj +++ b/tests/OmniSharp.Cake.Tests/OmniSharp.Cake.Tests.csproj @@ -1,7 +1,7 @@ - net7.0;net472 + net8.0;net472 AnyCPU true diff --git a/tests/OmniSharp.DotNetTest.Tests/OmniSharp.DotNetTest.Tests.csproj b/tests/OmniSharp.DotNetTest.Tests/OmniSharp.DotNetTest.Tests.csproj index 53dbc5e0ba..9e1f3a508d 100644 --- a/tests/OmniSharp.DotNetTest.Tests/OmniSharp.DotNetTest.Tests.csproj +++ b/tests/OmniSharp.DotNetTest.Tests/OmniSharp.DotNetTest.Tests.csproj @@ -1,7 +1,7 @@  - net7.0;net472 + net8.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj b/tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj index caf8cc7aef..c96aa05f91 100644 --- a/tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj +++ b/tests/OmniSharp.Http.Tests/OmniSharp.Http.Tests.csproj @@ -1,7 +1,7 @@  - net7.0;net472 + net8.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj b/tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj index b66f7bbab2..f755678976 100644 --- a/tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj +++ b/tests/OmniSharp.Lsp.Tests/OmniSharp.Lsp.Tests.csproj @@ -1,7 +1,7 @@  - net7.0;net472 + net8.0;net472 AnyCPU true diff --git a/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj b/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj index 3d775335ce..cd98225368 100644 --- a/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj +++ b/tests/OmniSharp.MSBuild.Tests/OmniSharp.MSBuild.Tests.csproj @@ -1,7 +1,7 @@  - net7.0;net472 + net8.0;net472 AnyCPU true diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index cc5af5a928..098f32e58d 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -231,7 +231,7 @@ public async Task The_correct_sdk_version_is_emitted_NET7() using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net70Project"); using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); Assert.Single(emitter.ReceivedMessages); - Assert.Equal(GetHashedFileExtension("7.0.404"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("7.0.406"), emitter.ReceivedMessages[0].SdkVersion); } [ConditionalFact(typeof(DotnetRuntimeOnly))] @@ -243,7 +243,19 @@ public async Task The_correct_sdk_version_is_emitted_NET8() using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net80Project"); using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); Assert.Single(emitter.ReceivedMessages); - Assert.Equal(GetHashedFileExtension("8.0.100"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("8.0.201"), emitter.ReceivedMessages[0].SdkVersion); + } + + [ConditionalFact(typeof(DotnetRuntimeOnly))] + public async Task The_correct_sdk_version_is_emitted_NET9() + { + // Arrange + var emitter = new ProjectLoadTestEventEmitter(); + + using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net90Project"); + using var host = CreateMSBuildTestHost(testProject.Directory, emitter.AsExportDescriptionProvider(LoggerFactory)); + Assert.Single(emitter.ReceivedMessages); + Assert.Equal(GetHashedFileExtension("9.0.100-preview.1.24101.2"), emitter.ReceivedMessages[0].SdkVersion); } private string GetHashedFileExtension(string fileExtension) diff --git a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs index d6a9b8d879..8022711017 100644 --- a/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/WorkspaceInformationTests.cs @@ -114,6 +114,34 @@ public async Task Net70Project() Assert.Contains(project.TargetFrameworks[0].ShortName, new[] { "net70", "net7.0" }); } + [ConditionalFact(typeof(NonMonoRuntimeOnly))] + public async Task Net80Project() + { + using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net80Project"); + using var host = CreateMSBuildTestHost(testProject.Directory); + var workspaceInfo = await host.RequestMSBuildWorkspaceInfoAsync(); + + Assert.NotNull(workspaceInfo.Projects); + var project = Assert.Single(workspaceInfo.Projects); + Assert.Equal("Net80Project", project.AssemblyName); + Assert.Equal(".NETCoreApp,Version=v8.0", project.TargetFramework); + Assert.Contains(project.TargetFrameworks[0].ShortName, new[] { "net80", "net8.0" }); + } + + [ConditionalFact(typeof(NonMonoRuntimeOnly))] + public async Task Net90Project() + { + using var testProject = await TestAssets.Instance.GetTestProjectAsync("Net90Project"); + using var host = CreateMSBuildTestHost(testProject.Directory); + var workspaceInfo = await host.RequestMSBuildWorkspaceInfoAsync(); + + Assert.NotNull(workspaceInfo.Projects); + var project = Assert.Single(workspaceInfo.Projects); + Assert.Equal("Net90Project", project.AssemblyName); + Assert.Equal(".NETCoreApp,Version=v9.0", project.TargetFramework); + Assert.Contains(project.TargetFrameworks[0].ShortName, new[] { "net79", "net9.0" }); + } + [Fact] public async Task TwoProjectsWithSolution() { diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj b/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj index 3b23c45f77..fb56a8dc38 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/OmniSharp.Roslyn.CSharp.Tests.csproj @@ -1,7 +1,7 @@  - net7.0;net472 + net8.0;net472 AnyCPU true CS0618 diff --git a/tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj b/tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj index a80a60b605..4ca199f0e8 100644 --- a/tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj +++ b/tests/OmniSharp.Script.Tests/OmniSharp.Script.Tests.csproj @@ -1,7 +1,7 @@ - net7.0;net472 + net8.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj b/tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj index f9cec764d1..6a77fb4db2 100644 --- a/tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj +++ b/tests/OmniSharp.Stdio.Tests/OmniSharp.Stdio.Tests.csproj @@ -1,7 +1,7 @@  - net7.0;net472 + net8.0;net472 AnyCPU true diff --git a/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs b/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs index d88c9a0017..ddf0e4d245 100644 --- a/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs +++ b/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs @@ -7,7 +7,7 @@ namespace OmniSharp.Tests { public class DotNetCliServiceFacts : AbstractTestFixture { - private const string DotNetVersion = "8.0.100"; + private const string DotNetVersion = "8.0.201"; private int Major { get; } private int Minor { get; } private int Patch { get; } diff --git a/tests/OmniSharp.Tests/OmniSharp.Tests.csproj b/tests/OmniSharp.Tests/OmniSharp.Tests.csproj index b29a508103..b668f9d085 100644 --- a/tests/OmniSharp.Tests/OmniSharp.Tests.csproj +++ b/tests/OmniSharp.Tests/OmniSharp.Tests.csproj @@ -1,7 +1,7 @@  - net7.0;net472 + net8.0;net472 AnyCPU true diff --git a/tests/TestUtility/TestUtility.csproj b/tests/TestUtility/TestUtility.csproj index 934ca791b1..1270434733 100644 --- a/tests/TestUtility/TestUtility.csproj +++ b/tests/TestUtility/TestUtility.csproj @@ -1,7 +1,7 @@  - net7.0;net472 + net8.0;net472 AnyCPU diff --git a/tools/packages.config b/tools/packages.config index 1da49565b7..ce93b9a314 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -3,7 +3,7 @@ - +