From efac4eec33fc040f31cb693327055ce77ec81706 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 30 Sep 2024 23:24:26 -0700 Subject: [PATCH 01/18] Update Roslyn to 4.13.0-1.24477.2 --- .github/workflows/build.yml | 12 ++---------- .github/workflows/tests-net6.yml | 12 ++---------- .github/workflows/tests.yml | 12 ++---------- .pipelines/init.yml | 2 +- Directory.Packages.props | 6 +++--- azure-pipelines.yml | 2 +- build.json | 4 ++-- global.json | 2 +- src/OmniSharp.Abstractions/Configuration.cs | 2 +- .../Utilities/ShadowCopyAnalyzerAssemblyLoader.cs | 4 +++- test-assets/test-projects/Net80Project/global.json | 4 ++-- test-assets/test-projects/Net90Project/global.json | 4 ++-- .../AbstractMSBuildTestFixture.cs | 4 +--- .../ProjectLoadListenerTests.cs | 4 ++-- tests/OmniSharp.Tests/DotNetCliServiceFacts.cs | 2 +- 15 files changed, 26 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 103608c881..9084eab0ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,8 @@ name: 'Build' env: - DotNetVersion: "9.0.100-preview.6.24328.19" - DotNetVersion2: "8.0.303" + DotNetVersion: "9.0.100-rc.1.24452.12" + DotNetVersion2: "8.0.402" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" @@ -36,14 +36,6 @@ jobs: clean: 'false' fetch-depth: '0' - # TODO: Need to figure out the correct way to install mono on linux / mac - # Currently the latest image has mono 6.12 - # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md - # - name: 🔨 Use Mono ${{ env.MonoVersion }} SDK - # uses: maxim-lobanov/setup-xamarin@v1 - # with: - # mono-version: ${{ env.MonoVersion }} - - name: Setup NuGet.exe uses: nuget/setup-nuget@v1 with: diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index dd1abc62ab..9423a17c24 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -1,8 +1,8 @@ name: 'Tests net6.0' env: - DotNetVersion: "9.0.100-preview.6.24328.19" - DotNetVersion2: "8.0.303" + DotNetVersion: "9.0.100-rc.1.24452.12" + DotNetVersion2: "8.0.402" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" @@ -39,14 +39,6 @@ jobs: clean: 'false' fetch-depth: '0' - # TODO: Need to figure out the correct way to install mono on linux / mac - # Currently the latest image has mono 6.12 - # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md - # - name: 🔨 Use Mono ${{ env.MonoVersion }} SDK - # uses: maxim-lobanov/setup-xamarin@v1 - # with: - # mono-version: ${{ env.MonoVersion }} - - name: Setup NuGet.exe uses: nuget/setup-nuget@v1 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 97ff146410..76cc0ed060 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,8 +1,8 @@ name: 'Tests' env: - DotNetVersion: "9.0.100-preview.6.24328.19" - DotNetVersion2: "8.0.303" + DotNetVersion: "9.0.100-rc.1.24452.12" + DotNetVersion2: "8.0.402" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" @@ -39,14 +39,6 @@ jobs: clean: 'false' fetch-depth: '0' - # TODO: Need to figure out the correct way to install mono on linux / mac - # Currently the latest image has mono 6.12 - # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md - # - name: 🔨 Use Mono ${{ env.MonoVersion }} SDK - # uses: maxim-lobanov/setup-xamarin@v1 - # with: - # mono-version: ${{ env.MonoVersion }} - - name: Setup NuGet.exe uses: nuget/setup-nuget@v1 with: diff --git a/.pipelines/init.yml b/.pipelines/init.yml index a44c330558..1c62103326 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -1,7 +1,7 @@ parameters: # Configuration: Release Verbosity: Normal - DotNetVersion: "8.0.201" + DotNetVersion: "8.0.402" CakeVersion: "1.1.0" NuGetVersion: "5.7.0" MonoVersion: "" diff --git a/Directory.Packages.props b/Directory.Packages.props index 35f2d16dd4..a3cb8fe89b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,8 +8,8 @@ 8.0.0 17.8.0 17.3.2 - 6.11.0-rc.110 - 4.12.0-1.24358.3 + 6.12.0-preview.1.81 + 4.13.0-1.24477.2 2.6.1 @@ -19,7 +19,7 @@ - + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 395ed76d5d..9cd42adf89 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ resources: variables: Verbosity: Diagnostic - DotNetVersion: "8.0.303" + DotNetVersion: "8.0.402" CakeVersion: "3.0.0" NuGetVersion: "6.5.0" GitVersionVersion: "5.0.1" diff --git a/build.json b/build.json index 380e357bfc..3163068852 100644 --- a/build.json +++ b/build.json @@ -4,8 +4,8 @@ "DotNetVersions": [ "6.0.203", "7.0.410", - "8.0.303", - "9.0.100-preview.6.24328.19" + "8.0.402", + "9.0.100-rc.1.24452.12" ], "RequiredMonoVersion": "6.6.0", "DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext", diff --git a/global.json b/global.json index 7ec84ad344..adac13ab26 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.303", + "version": "8.0.402", "rollForward": "latestMinor" } } \ No newline at end of file diff --git a/src/OmniSharp.Abstractions/Configuration.cs b/src/OmniSharp.Abstractions/Configuration.cs index 3fd36a2469..6041f77589 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.12.0.0"; + public const string RoslynVersion = "4.13.0.0"; public const string RoslynPublicKeyToken = "31bf3856ad364e35"; public readonly static string RoslynFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Features"); diff --git a/src/OmniSharp.Roslyn/Utilities/ShadowCopyAnalyzerAssemblyLoader.cs b/src/OmniSharp.Roslyn/Utilities/ShadowCopyAnalyzerAssemblyLoader.cs index a1bfd24717..6a518e1233 100644 --- a/src/OmniSharp.Roslyn/Utilities/ShadowCopyAnalyzerAssemblyLoader.cs +++ b/src/OmniSharp.Roslyn/Utilities/ShadowCopyAnalyzerAssemblyLoader.cs @@ -5,6 +5,8 @@ namespace OmniSharp.Roslyn.Utilities { public static class ShadowCopyAnalyzerAssemblyLoader { - public static readonly IAnalyzerAssemblyLoader Instance = OmnisharpAnalyzerAssemblyLoaderFactory.CreateShadowCopyAnalyzerAssemblyLoader(); + public static readonly IAnalyzerAssemblyLoader Instance = CreateShadowCopyLoader(); + + public static IAnalyzerAssemblyLoader CreateShadowCopyLoader() => OmnisharpAnalyzerAssemblyLoaderFactory.CreateShadowCopyAnalyzerAssemblyLoader(); } } diff --git a/test-assets/test-projects/Net80Project/global.json b/test-assets/test-projects/Net80Project/global.json index 4ce8f1ee66..2867160e66 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.303" + "version": "8.0.402" } -} \ No newline at end of file +} diff --git a/test-assets/test-projects/Net90Project/global.json b/test-assets/test-projects/Net90Project/global.json index d2da1deed6..7d5f3699de 100644 --- a/test-assets/test-projects/Net90Project/global.json +++ b/test-assets/test-projects/Net90Project/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "9.0.100-preview.6.24328.19" + "version": "9.0.100-rc.1.24452.12" } -} \ No newline at end of file +} diff --git a/tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs b/tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs index 37c1cdc6d2..440304e278 100644 --- a/tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs +++ b/tests/OmniSharp.MSBuild.Tests/AbstractMSBuildTestFixture.cs @@ -16,13 +16,11 @@ public abstract class AbstractMSBuildTestFixture : AbstractTestFixture, IDisposa { private readonly IAssemblyLoader _assemblyLoader; private readonly IMSBuildLocator _msbuildLocator; - private readonly IAnalyzerAssemblyLoader _analyzerAssemblyLoader; public AbstractMSBuildTestFixture(ITestOutputHelper output) : base(output) { _assemblyLoader = new AssemblyLoader(this.LoggerFactory); - _analyzerAssemblyLoader = ShadowCopyAnalyzerAssemblyLoader.Instance; // Since we can only load MSBuild once into our process we need to include // prerelease version so that our .NET 7 tests will pass. @@ -47,7 +45,7 @@ protected OmniSharpTestHost CreateMSBuildTestHost(string path, IEnumerable Date: Mon, 30 Sep 2024 23:27:59 -0700 Subject: [PATCH 02/18] Update GH action --- .github/workflows/build.yml | 10 +++++----- .github/workflows/tests-net6.yml | 2 +- .github/workflows/tests.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9084eab0ce..0f0242985d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,7 +63,7 @@ jobs: dotnet cake --configuration=Release --verbosity=Verbose --target=CI --publish-all --archive - name: ⬆ Publish Logs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: @@ -71,7 +71,7 @@ jobs: path: '${{ env.Artifacts }}/logs/' - name: ⬆ Publish Packages - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: @@ -79,7 +79,7 @@ jobs: path: '${{ env.Artifacts }}/package/' - name: ⬆ Publish Deployment - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: @@ -87,7 +87,7 @@ jobs: path: '${{ env.Artifacts }}/deployment/' - name: ⬆ Publish NuGet - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: @@ -95,7 +95,7 @@ jobs: path: '${{ env.Artifacts }}/nuget/' - name: ⬆ Publish Scripts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index 9423a17c24..b492d5da86 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -74,7 +74,7 @@ jobs: TEST_PROJECT: ${{ matrix.testProjects }} - name: ⬆ Publish Logs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 76cc0ed060..40bdd6fba5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -74,7 +74,7 @@ jobs: TEST_PROJECT: ${{ matrix.testProjects }} - name: ⬆ Publish Logs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: From 746634c1680961f36efb542f9b7ebdb7bc20d382 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 1 Oct 2024 00:05:54 -0700 Subject: [PATCH 03/18] Fix ImplementType CodeAction Identifier --- tests/OmniSharp.Roslyn.CSharp.Tests/ImplementTypeFacts.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/ImplementTypeFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/ImplementTypeFacts.cs index f4a245c226..a0744e6827 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/ImplementTypeFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/ImplementTypeFacts.cs @@ -120,7 +120,7 @@ private async Task VerifyImplementType(string code, string expectedChange, Dicti Column = point.Offset, FileName = testFile.FileName, Buffer = testFile.Content.Code, - Identifier = "False;False;True:global::IFoo;AssemblyName;Microsoft.CodeAnalysis.ImplementInterface.AbstractImplementInterfaceService+ImplementInterfaceCodeAction;", + Identifier = "False;False;True:global::IFoo;Microsoft.CodeAnalysis.ImplementInterface.AbstractImplementInterfaceService+ImplementInterfaceCodeAction;", WantsTextChanges = true, WantsAllCodeActionOperations = true }; From 7a022d4e458aefd64d99f00a341652eed6b0c25f Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 1 Oct 2024 00:20:10 -0700 Subject: [PATCH 04/18] Fix CodeAction Tests --- tests/TestUtility/TestServiceProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestUtility/TestServiceProvider.cs b/tests/TestUtility/TestServiceProvider.cs index c14088dac5..b92cff1a09 100644 --- a/tests/TestUtility/TestServiceProvider.cs +++ b/tests/TestUtility/TestServiceProvider.cs @@ -87,7 +87,7 @@ public static IServiceProvider Create( var configuration = CreateConfiguration(configurationData); var msbuildLocator = CreateMSBuildLocator(loggerFactory, assemblyLoader, configurationData); var sharedTextWriter = CreateSharedTextWriter(testOutput); - var analyzerAssemblyLoader = ShadowCopyAnalyzerAssemblyLoader.Instance; + var analyzerAssemblyLoader = ShadowCopyAnalyzerAssemblyLoader.CreateShadowCopyLoader(); return new TestServiceProvider( environment, loggerFactory, assemblyLoader, analyzerAssemblyLoader, sharedTextWriter, From 90e8ce5e0777efb6f945dae9de7f34af6347c069 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Wed, 18 Dec 2024 02:20:54 -0800 Subject: [PATCH 05/18] Update Roslyn to 4.13.x --- .editorconfig | 5 ++ Directory.Packages.props | 10 ++-- src/OmniSharp.Host/WorkspaceInitializer.cs | 52 +++++++++++++++++++ .../Refactoring/RunFixAllCodeActionService.cs | 5 -- .../Refactoring/V2/BaseCodeActionService.cs | 6 --- .../Workers/Refactoring/FixUsingsWorker.cs | 2 - .../Utilities/CodeActionOptionsFactory.cs | 16 ------ src/OmniSharp.Script/ScriptProjectProvider.cs | 6 +-- .../OmniSharpSemanticTokensHandlerFacts.cs | 10 ++-- .../CodeActionsWithOptionsFacts.cs | 2 +- .../SemanticHighlightFacts.cs | 2 +- 11 files changed, 72 insertions(+), 44 deletions(-) delete mode 100644 src/OmniSharp.Roslyn/Utilities/CodeActionOptionsFactory.cs diff --git a/.editorconfig b/.editorconfig index 4dfeb2b533..3a12f63c44 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,3 +23,8 @@ indent_size = 4 [*.{yml,yaml}] indent_size = 2 + +[tests/**/*.cs] +dotnet_diagnostic.RS1038.severity = none +dotnet_diagnostic.RS1041.severity = none +dotnet_diagnostic.RS1042.severity = none diff --git a/Directory.Packages.props b/Directory.Packages.props index a3cb8fe89b..ff3e4d3544 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,8 +8,8 @@ 8.0.0 17.8.0 17.3.2 - 6.12.0-preview.1.81 - 4.13.0-1.24477.2 + 6.13.0-rc.95 + 4.13.0-3.24617.3 2.6.1 @@ -43,7 +43,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -88,7 +88,7 @@ - + diff --git a/src/OmniSharp.Host/WorkspaceInitializer.cs b/src/OmniSharp.Host/WorkspaceInitializer.cs index 273a213bdc..9d82116f46 100644 --- a/src/OmniSharp.Host/WorkspaceInitializer.cs +++ b/src/OmniSharp.Host/WorkspaceInitializer.cs @@ -1,6 +1,8 @@ using System; using System.Composition.Hosting; using System.Linq; +using Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.ImplementType; +using Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.Options; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -33,6 +35,7 @@ public static void Initialize(IServiceProvider serviceProvider, CompositionHost logger.LogDebug("Starting with OmniSharp options: {options}", options.CurrentValue); ProvideWorkspaceOptions(compositionHost, workspace, options, logger, omnisharpEnvironment); + ProvideFallbackAnalyzerConfigOptions(workspace, options, logger); // when configuration options change // run workspace options providers automatically @@ -40,6 +43,7 @@ public static void Initialize(IServiceProvider serviceProvider, CompositionHost { logger.LogDebug("OmniSharp options changed: {options}", options.CurrentValue); ProvideWorkspaceOptions(compositionHost, workspace, options, logger, omnisharpEnvironment); + ProvideFallbackAnalyzerConfigOptions(workspace, options, logger); }); var projectSystems = compositionHost.GetExports(); @@ -100,5 +104,53 @@ private static void ProvideWorkspaceOptions( } } } + + private static void ProvideFallbackAnalyzerConfigOptions( + OmniSharpWorkspace workspace, + IOptionsMonitor options, + ILogger logger) + { + logger.LogInformation($"Updating the solution's fallback AnalyzerConfigOptions."); + OmniSharpSolutionAnalyzerConfigOptionsUpdater.UpdateOptions(workspace, ToOmniSharpEditorConfigOptions(options.CurrentValue)); + } + + private static OmniSharpEditorConfigOptions ToOmniSharpEditorConfigOptions(OmniSharpOptions options) + { + var lineFormattingOptions = new OmniSharpLineFormattingOptions + { + NewLine = options.FormattingOptions.NewLine, + UseTabs = options.FormattingOptions.UseTabs, + TabSize = options.FormattingOptions.TabSize, + IndentationSize = options.FormattingOptions.IndentationSize, + }; + + var implementTypeOptions = new OmniSharpImplementTypeOptions + { + InsertionBehavior = ToOmniSharpInsertionBehavior(options.ImplementTypeOptions.InsertionBehavior), + PropertyGenerationBehavior = ToOmniSharpPropertyGenerationBehavior(options.ImplementTypeOptions.PropertyGenerationBehavior), + }; + + return new OmniSharpEditorConfigOptions + { + LineFormattingOptions = lineFormattingOptions, + ImplementTypeOptions = implementTypeOptions, + }; + + static OmniSharpImplementTypeInsertionBehavior ToOmniSharpInsertionBehavior(ImplementTypeInsertionBehavior insertionBehavior) + => insertionBehavior switch + { + ImplementTypeInsertionBehavior.WithOtherMembersOfTheSameKind => OmniSharpImplementTypeInsertionBehavior.WithOtherMembersOfTheSameKind, + ImplementTypeInsertionBehavior.AtTheEnd => OmniSharpImplementTypeInsertionBehavior.AtTheEnd, + _ => throw new ArgumentException(nameof(insertionBehavior)) + }; + + static OmniSharpImplementTypePropertyGenerationBehavior ToOmniSharpPropertyGenerationBehavior(ImplementTypePropertyGenerationBehavior propertyGenerationBehavior) + => propertyGenerationBehavior switch + { + ImplementTypePropertyGenerationBehavior.PreferThrowingProperties => OmniSharpImplementTypePropertyGenerationBehavior.PreferThrowingProperties, + ImplementTypePropertyGenerationBehavior.PreferAutoProperties => OmniSharpImplementTypePropertyGenerationBehavior.PreferAutoProperties, + _ => throw new ArgumentException(nameof(propertyGenerationBehavior)) + }; + } } } diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/RunFixAllCodeActionService.cs b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/RunFixAllCodeActionService.cs index 68999640df..a980ae73d6 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/RunFixAllCodeActionService.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/RunFixAllCodeActionService.cs @@ -15,7 +15,6 @@ using OmniSharp.Abstractions.Models.V1.FixAll; using OmniSharp.Mef; using OmniSharp.Options; -using OmniSharp.Roslyn.CodeActions; using OmniSharp.Roslyn.CSharp.Services.Refactoring.V2; using OmniSharp.Roslyn.CSharp.Workers.Diagnostics; using OmniSharp.Services; @@ -140,8 +139,6 @@ private async Task FixSpecificDiagnosticIdAsync(Document document, str _logger.LogTrace("{0} is still present in the document. Getting fixes.", diagnosticId); - var codeActionOptions = CodeActionOptionsFactory.Create(Options); - CodeAction action = null; var context = OmniSharpCodeFixContextFactory.CreateCodeFixContext( document, @@ -154,7 +151,6 @@ private async Task FixSpecificDiagnosticIdAsync(Document document, str action = a; } }, - codeActionOptions, cancellationToken); await codeFixProvider.RegisterCodeFixesAsync(context).ConfigureAwait(false); @@ -176,7 +172,6 @@ private async Task FixSpecificDiagnosticIdAsync(Document document, str action?.EquivalenceKey, ImmutableArray.Create(diagnosticId), _fixAllDiagnosticProvider, - _ => codeActionOptions, cancellationToken); _logger.LogTrace("Finding FixAll fix for {0}.", diagnosticId); diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs index 7e6f996b54..b947c99de2 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/V2/BaseCodeActionService.cs @@ -20,7 +20,6 @@ using OmniSharp.Models; using OmniSharp.Models.V2.CodeActions; using OmniSharp.Options; -using OmniSharp.Roslyn.CodeActions; using OmniSharp.Roslyn.CSharp.Helpers; using OmniSharp.Roslyn.CSharp.Services.Diagnostics; using OmniSharp.Roslyn.CSharp.Workers.Diagnostics; @@ -137,8 +136,6 @@ private async Task CollectCodeFixesActions(Document document, TextSpan span, Lis private async Task AppendFixesAsync(Document document, TextSpan span, IEnumerable diagnostics, List<(CodeAction CodeAction, string CodeActionKind)> codeActions) { - var codeActionOptions = CodeActionOptionsFactory.Create(Options); - foreach (var codeFixProvider in GetSortedCodeFixProviders(document)) { var fixableDiagnostics = diagnostics.Where(d => HasFix(codeFixProvider, d.Id)).ToImmutableArray(); @@ -150,7 +147,6 @@ private async Task AppendFixesAsync(Document document, TextSpan span, IEnumerabl span, fixableDiagnostics, (a, _) => codeActions.Add((a, CodeActionKind.QuickFix)), - codeActionOptions, CancellationToken.None); try @@ -184,7 +180,6 @@ private bool HasFix(CodeFixProvider codeFixProvider, string diagnosticId) private async Task CollectRefactoringActions(Document document, TextSpan span, List<(CodeAction CodeAction, string CodeActionKind)> codeActions) { - var codeActionOptions = CodeActionOptionsFactory.Create(Options); var availableRefactorings = OrderedCodeRefactoringProviders.Value; foreach (var codeRefactoringProvider in availableRefactorings) @@ -211,7 +206,6 @@ private async Task CollectRefactoringActions(Document document, TextSpan span, L } codeActions.Add((a, kind)); }, - codeActionOptions, CancellationToken.None); await codeRefactoringProvider.ComputeRefactoringsAsync(context); diff --git a/src/OmniSharp.Roslyn.CSharp/Workers/Refactoring/FixUsingsWorker.cs b/src/OmniSharp.Roslyn.CSharp/Workers/Refactoring/FixUsingsWorker.cs index c92d524a5f..0be3964fed 100644 --- a/src/OmniSharp.Roslyn.CSharp/Workers/Refactoring/FixUsingsWorker.cs +++ b/src/OmniSharp.Roslyn.CSharp/Workers/Refactoring/FixUsingsWorker.cs @@ -13,7 +13,6 @@ using Microsoft.CodeAnalysis.Text; using OmniSharp.Models; using OmniSharp.Options; -using OmniSharp.Roslyn.CodeActions; using OmniSharp.Roslyn.CSharp.Services.CodeActions; using OmniSharp.Services; @@ -246,7 +245,6 @@ private async Task> GetCodeFixOperationsAsyn var context = OmniSharpCodeFixContextFactory.CreateCodeFixContext( document, span, diagnostics, registerCodeFix: (a, d) => codeFixes.Add(a), - CodeActionOptionsFactory.Create(_options), cancellationToken: CancellationToken.None); // Note: We're intentionally not checking CodeFixProvider.FixableDiagnosticIds here. diff --git a/src/OmniSharp.Roslyn/Utilities/CodeActionOptionsFactory.cs b/src/OmniSharp.Roslyn/Utilities/CodeActionOptionsFactory.cs deleted file mode 100644 index 08887f1628..0000000000 --- a/src/OmniSharp.Roslyn/Utilities/CodeActionOptionsFactory.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.CodeActions; -using Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.ImplementType; -using OmniSharp.Options; - -namespace OmniSharp.Roslyn.CodeActions -{ - internal static class CodeActionOptionsFactory - { - public static OmniSharpCodeActionOptions Create(OmniSharpOptions options) - => new OmniSharpCodeActionOptions( - new OmniSharpImplementTypeOptions( - (OmniSharpImplementTypeInsertionBehavior)options.ImplementTypeOptions.InsertionBehavior, - (OmniSharpImplementTypePropertyGenerationBehavior)options.ImplementTypeOptions.PropertyGenerationBehavior), - OmniSharpLineFormattingOptionsProvider.CreateFromOptions(options)); - } -} diff --git a/src/OmniSharp.Script/ScriptProjectProvider.cs b/src/OmniSharp.Script/ScriptProjectProvider.cs index 5df64ab1db..3d577b76bb 100644 --- a/src/OmniSharp.Script/ScriptProjectProvider.cs +++ b/src/OmniSharp.Script/ScriptProjectProvider.cs @@ -25,7 +25,7 @@ public class ScriptProjectProvider private const string IgnoreCorLibraryDuplicatedTypesField = "IgnoreCorLibraryDuplicatedTypes"; private const string RuntimeMetadataReferenceResolverType = "Microsoft.CodeAnalysis.Scripting.Hosting.RuntimeMetadataReferenceResolver"; private const string ResolverField = "_resolver"; - private const string FileReferenceProviderField = "_fileReferenceProvider"; + private const string CreateFromFileFuncField = "_createFromFileFunc"; // aligned with CSI.exe // https://github.com/dotnet/roslyn/blob/version-3.2.0/src/Interactive/csi/csi.desktop.rsp @@ -248,8 +248,8 @@ private void InjectXMLDocumentationProviderIntoRuntimeMetadataReferenceResolver( if (runtimeMetadataReferenceResolverValue != null) { var runtimeMetadataReferenceResolverType = typeof(CommandLineScriptGlobals).GetTypeInfo().Assembly.GetType(RuntimeMetadataReferenceResolverType); - var fileReferenceProviderField = runtimeMetadataReferenceResolverType?.GetField(FileReferenceProviderField, BindingFlags.Instance | BindingFlags.NonPublic); - fileReferenceProviderField.SetValue(runtimeMetadataReferenceResolverValue, new Func((path, properties) => + var createFromFileFuncField = runtimeMetadataReferenceResolverType?.GetField(CreateFromFileFuncField, BindingFlags.Instance | BindingFlags.NonPublic); + createFromFileFuncField.SetValue(runtimeMetadataReferenceResolverValue, new Func((path, properties) => { var documentationFile = Path.ChangeExtension(path, ".xml"); var documentationProvider = File.Exists(documentationFile) diff --git a/tests/OmniSharp.Lsp.Tests/OmniSharpSemanticTokensHandlerFacts.cs b/tests/OmniSharp.Lsp.Tests/OmniSharpSemanticTokensHandlerFacts.cs index 2326a0494e..4989f79a7c 100644 --- a/tests/OmniSharp.Lsp.Tests/OmniSharpSemanticTokensHandlerFacts.cs +++ b/tests/OmniSharp.Lsp.Tests/OmniSharpSemanticTokensHandlerFacts.cs @@ -1,19 +1,19 @@ using System; +using System.Collections.Generic; +using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Text; +using OmniSharp.Extensions.LanguageServer.Protocol.Client; +using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Extensions.LanguageServer.Protocol.Models; using OmniSharp.Lsp.Tests; -using OmniSharp.Extensions.LanguageServer.Protocol.Document; using OmniSharp.Models.SemanticHighlight; using OmniSharp.Models.V2; using TestUtility; using Xunit; using Xunit.Abstractions; using Range = OmniSharp.Models.V2.Range; -using System.Collections.Generic; -using System.IO; -using OmniSharp.Extensions.LanguageServer.Protocol.Client; namespace OmniSharp.Roslyn.CSharp.Tests { @@ -165,7 +165,7 @@ public async Task C2() { Operator("="), String("\"hello\""), Punctuation(";"), - Keyword("await"), + ControlKeyword("await"), ControlKeyword("foreach"), Punctuation("("), Keyword("var"), diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/CodeActionsWithOptionsFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/CodeActionsWithOptionsFacts.cs index 6e3e7ea6c9..c7cd021451 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/CodeActionsWithOptionsFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/CodeActionsWithOptionsFacts.cs @@ -85,7 +85,7 @@ public Class1(string propertyHere) public string PropertyHere { get; set; } }"; - var response = await RunRefactoringAsync(code, "Generate constructor..."); + var response = await RunRefactoringAsync(code, "Generate constructor from members..."); AssertUtils.AssertIgnoringIndent(expected, ((ModifiedFileResponse)response.Changes.First()).Buffer); } diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs index 73bac30a7c..d367a1f875 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/SemanticHighlightFacts.cs @@ -187,7 +187,7 @@ public async Task C2() { Operator("="), String("\"hello\""), Punctuation(";"), - Keyword("await"), + ControlKeyword("await"), ControlKeyword("foreach"), Punctuation("("), Keyword("var"), From b6073a64e39b15a39c01e91a3cc5354cd8edeacc Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 19 Dec 2024 11:48:40 -0800 Subject: [PATCH 06/18] Update Roslyn to 4.13.0-3.24619.2 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ff3e4d3544..2e5d80e782 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,7 +9,7 @@ 17.8.0 17.3.2 6.13.0-rc.95 - 4.13.0-3.24617.3 + 4.13.0-3.24619.2 2.6.1 From fda7d2d25be39a6b6e511a53ed3b499e37028538 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 19 Dec 2024 16:29:45 -0800 Subject: [PATCH 07/18] Update Roslyn to 4.13.0-24619.4 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 2e5d80e782..27d7bd84e2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,7 +9,7 @@ 17.8.0 17.3.2 6.13.0-rc.95 - 4.13.0-3.24619.2 + 4.13.0-3.24619.4 2.6.1 From 43ea413dad835943399775cb8a2282037e1750a0 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 19 Dec 2024 19:21:14 -0800 Subject: [PATCH 08/18] Update Roslyn to 4.13.0-3.24619.11 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 27d7bd84e2..bee96b7a50 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,7 +9,7 @@ 17.8.0 17.3.2 6.13.0-rc.95 - 4.13.0-3.24619.4 + 4.13.0-3.24619.11 2.6.1 From 0c655e6e81a69e800bb3230ee1bf5010ceb39eb7 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 19 Dec 2024 19:39:07 -0800 Subject: [PATCH 09/18] Use MacOS 14 im CI --- .github/workflows/build.yml | 2 +- .github/workflows/tests-net6.yml | 2 +- .github/workflows/tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f0242985d..a38980467e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2022, macos-12] + os: [ubuntu-20.04, windows-2022, macos-14] name: 'Build' steps: - name: Checkout diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index b492d5da86..707424bb3f 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2022, macos-12] + os: [ubuntu-20.04, windows-2022, macos-14] testProjects: - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.DotNetTest.Tests,OmniSharp.Cake.Tests - OmniSharp.Lsp.Tests,OmniSharp.Script.Tests,OmniSharp.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40bdd6fba5..d36abcc785 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2022, macos-12] + os: [ubuntu-20.04, windows-2022, macos-14] testProjects: - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.DotNetTest.Tests,OmniSharp.Cake.Tests - OmniSharp.Lsp.Tests,OmniSharp.Script.Tests,OmniSharp.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests From 7a196b8be0696d23597da9546eab0500a865bac3 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 20 Dec 2024 15:04:26 -0800 Subject: [PATCH 10/18] Update SDKs --- .github/workflows/build.yml | 4 ++-- .github/workflows/tests-net6.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- .pipelines/init.yml | 2 +- azure-pipelines.yml | 2 +- build.json | 4 ++-- global.json | 2 +- test-assets/test-projects/Net80Project/global.json | 2 +- test-assets/test-projects/Net90Project/global.json | 2 +- tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs | 4 ++-- tests/OmniSharp.Tests/DotNetCliServiceFacts.cs | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a38980467e..c6b9433090 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,8 @@ name: 'Build' env: - DotNetVersion: "9.0.100-rc.1.24452.12" - DotNetVersion2: "8.0.402" + DotNetVersion: "9.0.101" + DotNetVersion2: "8.0.404" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index 707424bb3f..e804156072 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -1,8 +1,8 @@ name: 'Tests net6.0' env: - DotNetVersion: "9.0.100-rc.1.24452.12" - DotNetVersion2: "8.0.402" + DotNetVersion: "9.0.101" + DotNetVersion2: "8.0.404" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d36abcc785..731fea639c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,8 +1,8 @@ name: 'Tests' env: - DotNetVersion: "9.0.100-rc.1.24452.12" - DotNetVersion2: "8.0.402" + DotNetVersion: "9.0.101" + DotNetVersion2: "8.0.404" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" diff --git a/.pipelines/init.yml b/.pipelines/init.yml index 1c62103326..9d7b102aca 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -1,7 +1,7 @@ parameters: # Configuration: Release Verbosity: Normal - DotNetVersion: "8.0.402" + DotNetVersion: "8.0.404" CakeVersion: "1.1.0" NuGetVersion: "5.7.0" MonoVersion: "" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9cd42adf89..27a461d070 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ resources: variables: Verbosity: Diagnostic - DotNetVersion: "8.0.402" + DotNetVersion: "8.0.404" CakeVersion: "3.0.0" NuGetVersion: "6.5.0" GitVersionVersion: "5.0.1" diff --git a/build.json b/build.json index 3163068852..fa4f21b31f 100644 --- a/build.json +++ b/build.json @@ -4,8 +4,8 @@ "DotNetVersions": [ "6.0.203", "7.0.410", - "8.0.402", - "9.0.100-rc.1.24452.12" + "8.0.404", + "9.0.101" ], "RequiredMonoVersion": "6.6.0", "DownloadURL": "https://roslynomnisharp.blob.core.windows.net/ext", diff --git a/global.json b/global.json index adac13ab26..d1f8903477 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.402", + "version": "8.0.404", "rollForward": "latestMinor" } } \ 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 2867160e66..b832c3a01d 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.402" + "version": "8.0.404" } } diff --git a/test-assets/test-projects/Net90Project/global.json b/test-assets/test-projects/Net90Project/global.json index 7d5f3699de..5879450d69 100644 --- a/test-assets/test-projects/Net90Project/global.json +++ b/test-assets/test-projects/Net90Project/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "9.0.100-rc.1.24452.12" + "version": "9.0.101" } } diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index aad13fbb5a..3d407e00c0 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -243,7 +243,7 @@ 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.402"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("8.0.404"), emitter.ReceivedMessages[0].SdkVersion); } [ConditionalFact(typeof(DotnetRuntimeOnly))] @@ -255,7 +255,7 @@ public async Task The_correct_sdk_version_is_emitted_NET9() 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-rc.1.24452.12"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("9.0.101"), emitter.ReceivedMessages[0].SdkVersion); } private string GetHashedFileExtension(string fileExtension) diff --git a/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs b/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs index 2a155a7fb3..3ba7563ef5 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.402"; + private const string DotNetVersion = "8.0.404"; private int Major { get; } private int Minor { get; } private int Patch { get; } From 7efafedbd72bdb4597f9ff137a187935684784df Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 20 Dec 2024 15:04:46 -0800 Subject: [PATCH 11/18] Update Roslyn to 4.13.0-3.24620.4 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index bee96b7a50..9d3bd25f5a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,7 +9,7 @@ 17.8.0 17.3.2 6.13.0-rc.95 - 4.13.0-3.24619.11 + 4.13.0-3.24620.4 2.6.1 From c9a993724f4a3f785283c4f03fd2b097eb313221 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 20 Dec 2024 15:18:42 -0800 Subject: [PATCH 12/18] Make required service changes --- .../ExtractClassWorkspaceService.cs | 4 +-- .../ExtractInterfaceWorkspaceService.cs | 6 ++--- .../NotificationWorkspaceService.cs | 25 +++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 src/OmniSharp.Roslyn/WorkspaceServices/NotificationWorkspaceService.cs diff --git a/src/OmniSharp.Roslyn/WorkspaceServices/ExtractClassWorkspaceService.cs b/src/OmniSharp.Roslyn/WorkspaceServices/ExtractClassWorkspaceService.cs index eed75d08ab..279f777ab8 100644 --- a/src/OmniSharp.Roslyn/WorkspaceServices/ExtractClassWorkspaceService.cs +++ b/src/OmniSharp.Roslyn/WorkspaceServices/ExtractClassWorkspaceService.cs @@ -16,7 +16,7 @@ public ExtractClassWorkspaceService() { } - public Task GetExtractClassOptionsAsync(Document document, INamedTypeSymbol originalType, ImmutableArray selectedMembers) + public OmniSharpExtractClassOptions GetExtractClassOptions(Document document, INamedTypeSymbol originalType, ImmutableArray selectedMembers) { var symbolsToUse = selectedMembers.IsEmpty ? originalType.GetMembers().Where(member => member switch @@ -29,7 +29,7 @@ public Task GetExtractClassOptionsAsync(Document d var memberAnalysisResults = symbolsToUse.Select(m => new OmniSharpExtractClassMemberAnalysisResult(m, makeAbstract: false)).ToImmutableArray(); const string name = "NewBaseType"; - return Task.FromResult(new OmniSharpExtractClassOptions($"{name}.cs", name, true, memberAnalysisResults)); + return new OmniSharpExtractClassOptions($"{name}.cs", name, true, memberAnalysisResults); } } } diff --git a/src/OmniSharp.Roslyn/WorkspaceServices/ExtractInterfaceWorkspaceService.cs b/src/OmniSharp.Roslyn/WorkspaceServices/ExtractInterfaceWorkspaceService.cs index 113c6e36a5..4dd5825d4a 100644 --- a/src/OmniSharp.Roslyn/WorkspaceServices/ExtractInterfaceWorkspaceService.cs +++ b/src/OmniSharp.Roslyn/WorkspaceServices/ExtractInterfaceWorkspaceService.cs @@ -16,14 +16,14 @@ public ExtractInterfaceWorkspaceService() { } - public Task GetExtractInterfaceOptionsAsync(List extractableMembers, string defaultInterfaceName) + public OmniSharpExtractInterfaceOptionsResult GetExtractInterfaceOptions(List extractableMembers, string defaultInterfaceName) { - return Task.FromResult(new OmniSharpExtractInterfaceOptionsResult( + return new OmniSharpExtractInterfaceOptionsResult( isCancelled: false, extractableMembers.ToImmutableArray(), defaultInterfaceName, $"{defaultInterfaceName}.cs", - OmniSharpExtractInterfaceOptionsResult.OmniSharpExtractLocation.SameFile)); + OmniSharpExtractInterfaceOptionsResult.OmniSharpExtractLocation.SameFile); } } } diff --git a/src/OmniSharp.Roslyn/WorkspaceServices/NotificationWorkspaceService.cs b/src/OmniSharp.Roslyn/WorkspaceServices/NotificationWorkspaceService.cs new file mode 100644 index 0000000000..5ef1e023f8 --- /dev/null +++ b/src/OmniSharp.Roslyn/WorkspaceServices/NotificationWorkspaceService.cs @@ -0,0 +1,25 @@ +using System.Composition; +using Microsoft.CodeAnalysis.ExternalAccess.OmniSharp.Notification; + +namespace OmniSharp +{ + [Shared] + [Export(typeof(IOmniSharpNotificationService))] + internal class NotificationWorkspaceService : IOmniSharpNotificationService + { + [ImportingConstructor] + public NotificationWorkspaceService() + { + } + + public bool ConfirmMessageBox(string message, string title = null, OmniSharpNotificationSeverity severity = OmniSharpNotificationSeverity.Warning) + { + return true; + } + + public void SendNotification(string message, string title = null, OmniSharpNotificationSeverity severity = OmniSharpNotificationSeverity.Warning) + { + return; + } + } +} From 48d6a78f19c9896a78e59e7adebd2de20279eef1 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 20 Dec 2024 15:26:32 -0800 Subject: [PATCH 13/18] Pin .NET 9 sdk in global.json --- .pipelines/init.yml | 2 +- global.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/init.yml b/.pipelines/init.yml index 9d7b102aca..57577f3364 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -1,7 +1,7 @@ parameters: # Configuration: Release Verbosity: Normal - DotNetVersion: "8.0.404" + DotNetVersion: "9.0.101" CakeVersion: "1.1.0" NuGetVersion: "5.7.0" MonoVersion: "" diff --git a/global.json b/global.json index d1f8903477..38106f5072 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.404", + "version": "9.0.101", "rollForward": "latestMinor" } } \ No newline at end of file From 05f99d7f8e82eb732ba5a3ed1b998664f7ca5fc1 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Fri, 20 Dec 2024 21:16:09 -0800 Subject: [PATCH 14/18] Downgrade .net 8 sdk --- .github/workflows/build.yml | 2 +- .github/workflows/tests-net6.yml | 2 +- .github/workflows/tests.yml | 2 +- .pipelines/init.yml | 2 +- azure-pipelines.yml | 2 +- build.json | 2 +- global.json | 2 +- test-assets/test-projects/Net80Project/global.json | 2 +- tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs | 2 +- tests/OmniSharp.Tests/DotNetCliServiceFacts.cs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6b9433090..b6bbe692d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: 'Build' env: DotNetVersion: "9.0.101" - DotNetVersion2: "8.0.404" + DotNetVersion2: "8.0.307" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index e804156072..70caef2cdd 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -2,7 +2,7 @@ name: 'Tests net6.0' env: DotNetVersion: "9.0.101" - DotNetVersion2: "8.0.404" + DotNetVersion2: "8.0.307" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 731fea639c..01777a50f7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,7 @@ name: 'Tests' env: DotNetVersion: "9.0.101" - DotNetVersion2: "8.0.404" + DotNetVersion2: "8.0.307" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" diff --git a/.pipelines/init.yml b/.pipelines/init.yml index 57577f3364..343c6f107a 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -1,7 +1,7 @@ parameters: # Configuration: Release Verbosity: Normal - DotNetVersion: "9.0.101" + DotNetVersion: "8.0.307" CakeVersion: "1.1.0" NuGetVersion: "5.7.0" MonoVersion: "" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 27a461d070..d894eaf996 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ resources: variables: Verbosity: Diagnostic - DotNetVersion: "8.0.404" + DotNetVersion: "8.0.307" CakeVersion: "3.0.0" NuGetVersion: "6.5.0" GitVersionVersion: "5.0.1" diff --git a/build.json b/build.json index fa4f21b31f..41cab89880 100644 --- a/build.json +++ b/build.json @@ -4,7 +4,7 @@ "DotNetVersions": [ "6.0.203", "7.0.410", - "8.0.404", + "8.0.307", "9.0.101" ], "RequiredMonoVersion": "6.6.0", diff --git a/global.json b/global.json index 38106f5072..d5e8663624 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.101", + "version": "8.0.307", "rollForward": "latestMinor" } } \ 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 b832c3a01d..03540d9cc5 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.404" + "version": "8.0.307" } } diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index 3d407e00c0..bee946fef1 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -243,7 +243,7 @@ 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.404"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("8.0.307"), emitter.ReceivedMessages[0].SdkVersion); } [ConditionalFact(typeof(DotnetRuntimeOnly))] diff --git a/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs b/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs index 3ba7563ef5..092352d170 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.404"; + private const string DotNetVersion = "8.0.307"; private int Major { get; } private int Minor { get; } private int Patch { get; } From 293644744322aba9fd245848883c10d1e5333de6 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 30 Dec 2024 14:01:51 -0800 Subject: [PATCH 15/18] Update OmniSharp.DotNetTest libraries and tests --- .config/dotnet-tools.json | 2 +- Directory.Packages.props | 2 +- azure-pipelines.yml | 2 +- .../AntlrGeneratedFiles/Test.csproj | 4 +-- .../csharp-console/csharp-console.csproj | 2 +- .../MSTestProject/MSTestProject.csproj | 6 ++--- .../NUnitTestProject/NUnitTestProject.csproj | 6 ++--- .../ProjectWithSdkProperty.csproj | 4 +-- .../XunitTestProject/XunitTestProject.csproj | 6 ++--- .../RunTestsInContextTests.cs | 26 +++++++++---------- tools/packages.config | 2 +- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 831d039b64..1f95b27bf6 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "3.0.0", + "version": "4.2.0", "commands": [ "dotnet-cake" ] diff --git a/Directory.Packages.props b/Directory.Packages.props index 9d3bd25f5a..5977aa3523 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -17,7 +17,7 @@ - + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d894eaf996..219400dc1b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,7 +18,7 @@ resources: variables: Verbosity: Diagnostic DotNetVersion: "8.0.307" - CakeVersion: "3.0.0" + CakeVersion: "4.2.0" NuGetVersion: "6.5.0" GitVersionVersion: "5.0.1" MonoVersion: "6.12.0" diff --git a/test-assets/test-projects/AntlrGeneratedFiles/Test.csproj b/test-assets/test-projects/AntlrGeneratedFiles/Test.csproj index 1b5e60c302..33bf99bff7 100644 --- a/test-assets/test-projects/AntlrGeneratedFiles/Test.csproj +++ b/test-assets/test-projects/AntlrGeneratedFiles/Test.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp2.0 + net6.0 @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/test-assets/test-projects/CSharpAndFSharp/csharp-console/csharp-console.csproj b/test-assets/test-projects/CSharpAndFSharp/csharp-console/csharp-console.csproj index af64f07386..4769beb54a 100644 --- a/test-assets/test-projects/CSharpAndFSharp/csharp-console/csharp-console.csproj +++ b/test-assets/test-projects/CSharpAndFSharp/csharp-console/csharp-console.csproj @@ -6,7 +6,7 @@ Exe - netcoreapp2.0 + net6.0 diff --git a/test-assets/test-projects/MSTestProject/MSTestProject.csproj b/test-assets/test-projects/MSTestProject/MSTestProject.csproj index 9b99d6a4f2..6cd6dc69e0 100644 --- a/test-assets/test-projects/MSTestProject/MSTestProject.csproj +++ b/test-assets/test-projects/MSTestProject/MSTestProject.csproj @@ -5,9 +5,9 @@ - - - + + + diff --git a/test-assets/test-projects/NUnitTestProject/NUnitTestProject.csproj b/test-assets/test-projects/NUnitTestProject/NUnitTestProject.csproj index f20d3a62b8..739e4e0620 100644 --- a/test-assets/test-projects/NUnitTestProject/NUnitTestProject.csproj +++ b/test-assets/test-projects/NUnitTestProject/NUnitTestProject.csproj @@ -5,9 +5,9 @@ - - - + + + diff --git a/test-assets/test-projects/ProjectWithSdkProperty/ProjectWithSdkProperty.csproj b/test-assets/test-projects/ProjectWithSdkProperty/ProjectWithSdkProperty.csproj index f5028bf9db..cda04dc701 100644 --- a/test-assets/test-projects/ProjectWithSdkProperty/ProjectWithSdkProperty.csproj +++ b/test-assets/test-projects/ProjectWithSdkProperty/ProjectWithSdkProperty.csproj @@ -2,6 +2,6 @@ Exe - netcoreapp2.0 + net6.0 - \ No newline at end of file + diff --git a/test-assets/test-projects/XunitTestProject/XunitTestProject.csproj b/test-assets/test-projects/XunitTestProject/XunitTestProject.csproj index 6992809036..dd9d983d46 100644 --- a/test-assets/test-projects/XunitTestProject/XunitTestProject.csproj +++ b/test-assets/test-projects/XunitTestProject/XunitTestProject.csproj @@ -5,9 +5,9 @@ - - - + + + diff --git a/tests/OmniSharp.DotNetTest.Tests/RunTestsInContextTests.cs b/tests/OmniSharp.DotNetTest.Tests/RunTestsInContextTests.cs index 0da017472c..4e9337d5ba 100644 --- a/tests/OmniSharp.DotNetTest.Tests/RunTestsInContextTests.cs +++ b/tests/OmniSharp.DotNetTest.Tests/RunTestsInContextTests.cs @@ -133,9 +133,9 @@ public async Task InvokeInTestBody(int line, int column, string projectName) [InlineData(12, 26, NUnitTestProject, 2)] [InlineData(13, 26, NUnitTestProject, 2)] - [InlineData(21, 28, MSTestProject, 3)] - [InlineData(17, 17, MSTestProject, 3)] - [InlineData(18, 17, MSTestProject, 3)] + [InlineData(21, 28, MSTestProject, 2)] + [InlineData(17, 17, MSTestProject, 2)] + [InlineData(18, 17, MSTestProject, 2)] public async Task InvokeParameterizedTest(int line, int column, string projectName, int expectedNumTests) { var response = await RunDotNetTestAsync( @@ -197,26 +197,26 @@ public async Task InvokeParameterizedTest(int line, int column, string projectNa [InlineData(76, 0, NUnitTestProject, 4)] // Class Header - [InlineData(6, 4, MSTestProject, 10)] - [InlineData(6, 13, MSTestProject, 10)] - [InlineData(6, 17, MSTestProject, 10)] - [InlineData(7, 0, MSTestProject, 10)] - [InlineData(7, 4, MSTestProject, 10)] + [InlineData(6, 4, MSTestProject, 8)] + [InlineData(6, 13, MSTestProject, 8)] + [InlineData(6, 17, MSTestProject, 8)] + [InlineData(7, 0, MSTestProject, 8)] + [InlineData(7, 4, MSTestProject, 8)] // Before [TestMethod] - [InlineData(10, 7, MSTestProject, 10)] + [InlineData(10, 7, MSTestProject, 8)] // After closing brace - [InlineData(14, 9, MSTestProject, 10)] + [InlineData(14, 9, MSTestProject, 8)] // Between test methods - [InlineData(15, 0, MSTestProject, 10)] + [InlineData(15, 0, MSTestProject, 8)] // In non-test method - [InlineData(54, 0, MSTestProject, 10)] + [InlineData(54, 0, MSTestProject, 8)] // In non-test method - [InlineData(63, 0, MSTestProject, 10)] + [InlineData(63, 0, MSTestProject, 8)] public async Task NoContainingMethodInvokesClass(int line, int column, string projectName, int expectedNumTests) { var response = await RunDotNetTestAsync( diff --git a/tools/packages.config b/tools/packages.config index ce93b9a314..47b4bec102 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -1,7 +1,7 @@ - + From 073d39f84f1cefe918118a068aa83433ad486dfb Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 30 Dec 2024 14:59:03 -0800 Subject: [PATCH 16/18] Set fallback AnalyzerConfigOptions when test host is cleared. --- tests/TestUtility/OmniSharpTestHost.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/TestUtility/OmniSharpTestHost.cs b/tests/TestUtility/OmniSharpTestHost.cs index 65cdbf25a1..01ffb730fb 100644 --- a/tests/TestUtility/OmniSharpTestHost.cs +++ b/tests/TestUtility/OmniSharpTestHost.cs @@ -163,6 +163,10 @@ public void ClearWorkspace() { Workspace.RemoveProject(projectId); } + + // The fallback AnalyzerConfigOptions seem to be reset when all the Projects are removed from the Workspace. + // Calling initialize again here will set them so that they are available. + WorkspaceInitializer.Initialize(_serviceProvider, _compositionHost); } public Task GetResponse( From 9a86cdb013cbc445fb32a92dacf004353ec65b4e Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 30 Dec 2024 15:00:42 -0800 Subject: [PATCH 17/18] Downgrade .NET 8 sdk --- .github/workflows/build.yml | 33 +++++++++---------- .github/workflows/tests-net6.yml | 17 +++++----- .github/workflows/tests.yml | 17 +++++----- .pipelines/init.yml | 2 +- azure-pipelines.yml | 2 +- build.json | 2 +- global.json | 4 +-- .../test-projects/Net80Project/global.json | 2 +- .../ProjectLoadListenerTests.cs | 2 +- .../OmniSharp.Tests/DotNetCliServiceFacts.cs | 2 +- 10 files changed, 40 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6bbe692d5..c34bf5baba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,7 @@ - -name: 'Build' +name: "Build" env: DotNetVersion: "9.0.101" - DotNetVersion2: "8.0.307" + DotNetVersion2: "8.0.303" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" @@ -19,7 +18,7 @@ on: - master - feature/* tags: - - '*' + - "*" workflow_dispatch: jobs: build: @@ -28,13 +27,13 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, windows-2022, macos-14] - name: 'Build' + name: "Build" steps: - name: Checkout uses: actions/checkout@v2 with: - clean: 'false' - fetch-depth: '0' + clean: "false" + fetch-depth: "0" - name: Setup NuGet.exe uses: nuget/setup-nuget@v1 @@ -67,37 +66,37 @@ jobs: continue-on-error: true if: ${{ always() }} with: - name: 'logs - ${{ github.workflow }} ${{ matrix.os }}' - path: '${{ env.Artifacts }}/logs/' + name: "logs - ${{ github.workflow }} ${{ matrix.os }}" + path: "${{ env.Artifacts }}/logs/" - name: ⬆ Publish Packages uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: - name: 'packages' - path: '${{ env.Artifacts }}/package/' + name: "packages" + path: "${{ env.Artifacts }}/package/" - name: ⬆ Publish Deployment uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: - name: 'deployment' - path: '${{ env.Artifacts }}/deployment/' + name: "deployment" + path: "${{ env.Artifacts }}/deployment/" - name: ⬆ Publish NuGet uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: - name: 'nuget' - path: '${{ env.Artifacts }}/nuget/' + name: "nuget" + path: "${{ env.Artifacts }}/nuget/" - name: ⬆ Publish Scripts uses: actions/upload-artifact@v4 continue-on-error: true if: ${{ always() }} with: - name: 'scripts - ${{ matrix.os }}' - path: '${{ env.Artifacts }}/scripts/' + name: "scripts - ${{ matrix.os }}" + path: "${{ env.Artifacts }}/scripts/" diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index 70caef2cdd..4b2e5e7344 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -1,8 +1,7 @@ - -name: 'Tests net6.0' +name: "Tests net6.0" env: DotNetVersion: "9.0.101" - DotNetVersion2: "8.0.307" + DotNetVersion2: "8.0.303" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" @@ -19,7 +18,7 @@ on: - master - feature/* tags: - - '*' + - "*" workflow_dispatch: jobs: build: @@ -31,13 +30,13 @@ jobs: testProjects: - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.DotNetTest.Tests,OmniSharp.Cake.Tests - OmniSharp.Lsp.Tests,OmniSharp.Script.Tests,OmniSharp.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests - name: 'Test' + name: "Test" steps: - name: Checkout uses: actions/checkout@v2 with: - clean: 'false' - fetch-depth: '0' + clean: "false" + fetch-depth: "0" - name: Setup NuGet.exe uses: nuget/setup-nuget@v1 @@ -78,5 +77,5 @@ jobs: continue-on-error: true if: ${{ always() }} with: - name: 'logs - ${{ github.workflow }} ${{ matrix.os }}' - path: '${{ env.Artifacts }}/logs/' + name: "logs - ${{ github.workflow }} ${{ matrix.os }}" + path: "${{ env.Artifacts }}/logs/" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 01777a50f7..ec3c459fbf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,8 +1,7 @@ - -name: 'Tests' +name: "Tests" env: DotNetVersion: "9.0.101" - DotNetVersion2: "8.0.307" + DotNetVersion2: "8.0.303" DotNetVersion3: "7.0.410" DotNetVersion4: "6.0.203" # This is the last version Mono supports. It is used for our Mono CI tests. NuGetVersion: "6.5.0" @@ -19,7 +18,7 @@ on: - master - feature/* tags: - - '*' + - "*" workflow_dispatch: jobs: build: @@ -31,13 +30,13 @@ jobs: testProjects: - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.DotNetTest.Tests,OmniSharp.Cake.Tests - OmniSharp.Lsp.Tests,OmniSharp.Script.Tests,OmniSharp.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests - name: 'Test' + name: "Test" steps: - name: Checkout uses: actions/checkout@v2 with: - clean: 'false' - fetch-depth: '0' + clean: "false" + fetch-depth: "0" - name: Setup NuGet.exe uses: nuget/setup-nuget@v1 @@ -78,5 +77,5 @@ jobs: continue-on-error: true if: ${{ always() }} with: - name: 'logs - ${{ github.workflow }} ${{ matrix.os }}' - path: '${{ env.Artifacts }}/logs/' + name: "logs - ${{ github.workflow }} ${{ matrix.os }}" + path: "${{ env.Artifacts }}/logs/" diff --git a/.pipelines/init.yml b/.pipelines/init.yml index 343c6f107a..4af3c00879 100644 --- a/.pipelines/init.yml +++ b/.pipelines/init.yml @@ -1,7 +1,7 @@ parameters: # Configuration: Release Verbosity: Normal - DotNetVersion: "8.0.307" + DotNetVersion: "8.0.303" CakeVersion: "1.1.0" NuGetVersion: "5.7.0" MonoVersion: "" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 219400dc1b..c6881ded55 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ resources: variables: Verbosity: Diagnostic - DotNetVersion: "8.0.307" + DotNetVersion: "8.0.303" CakeVersion: "4.2.0" NuGetVersion: "6.5.0" GitVersionVersion: "5.0.1" diff --git a/build.json b/build.json index 41cab89880..ca061e1357 100644 --- a/build.json +++ b/build.json @@ -4,7 +4,7 @@ "DotNetVersions": [ "6.0.203", "7.0.410", - "8.0.307", + "8.0.303", "9.0.101" ], "RequiredMonoVersion": "6.6.0", diff --git a/global.json b/global.json index d5e8663624..419f2c3844 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.307", + "version": "8.0.303", "rollForward": "latestMinor" } -} \ 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 03540d9cc5..7cc48a4e22 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.307" + "version": "8.0.303" } } diff --git a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs index bee946fef1..ceb5d2ebf4 100644 --- a/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs +++ b/tests/OmniSharp.MSBuild.Tests/ProjectLoadListenerTests.cs @@ -243,7 +243,7 @@ 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.307"), emitter.ReceivedMessages[0].SdkVersion); + Assert.Equal(GetHashedFileExtension("8.0.303"), emitter.ReceivedMessages[0].SdkVersion); } [ConditionalFact(typeof(DotnetRuntimeOnly))] diff --git a/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs b/tests/OmniSharp.Tests/DotNetCliServiceFacts.cs index 092352d170..ef5c41f2ef 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.307"; + private const string DotNetVersion = "8.0.303"; private int Major { get; } private int Minor { get; } private int Patch { get; } From 1f765d8d9b9cd85c26b6795e06136f835907b2e1 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Mon, 30 Dec 2024 16:01:51 -0800 Subject: [PATCH 18/18] Use macos-13 for CI --- .github/workflows/build.yml | 2 +- .github/workflows/tests-net6.yml | 2 +- .github/workflows/tests.yml | 2 +- azure-pipelines.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c34bf5baba..14aed7e897 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2022, macos-14] + os: [ubuntu-20.04, windows-2022, macos-13] name: "Build" steps: - name: Checkout diff --git a/.github/workflows/tests-net6.yml b/.github/workflows/tests-net6.yml index 4b2e5e7344..b81ec771f6 100644 --- a/.github/workflows/tests-net6.yml +++ b/.github/workflows/tests-net6.yml @@ -26,7 +26,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2022, macos-14] + os: [ubuntu-20.04, windows-2022, macos-13] testProjects: - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.DotNetTest.Tests,OmniSharp.Cake.Tests - OmniSharp.Lsp.Tests,OmniSharp.Script.Tests,OmniSharp.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ec3c459fbf..2a7e21de61 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,7 +26,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2022, macos-14] + os: [ubuntu-20.04, windows-2022, macos-13] testProjects: - OmniSharp.MSBuild.Tests,OmniSharp.Roslyn.CSharp.Tests,OmniSharp.DotNetTest.Tests,OmniSharp.Cake.Tests - OmniSharp.Lsp.Tests,OmniSharp.Script.Tests,OmniSharp.Tests,OmniSharp.Stdio.Tests,OmniSharp.Http.Tests diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c6881ded55..8adb258226 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -91,7 +91,7 @@ stages: - job: macOS pool: - vmImage: "macos-12" + vmImage: "macos-13" dependsOn: GitVersion steps: - template: ./.pipelines/init.yml