From bc34adab288de237bf5f9d0b950019821dbd368d Mon Sep 17 00:00:00 2001 From: David Barbet Date: Wed, 1 Mar 2023 14:16:40 -0800 Subject: [PATCH 1/6] Upgrade roslyn to 4.6.0-2.23128.12 --- CHANGELOG.md | 3 +++ build/Packages.props | 2 +- src/OmniSharp.Abstractions/Configuration.cs | 2 +- src/OmniSharp.Http.Driver/app.config | 10 +++++----- src/OmniSharp.LanguageServerProtocol/app.config | 10 +++++----- src/OmniSharp.Roslyn/OmniSharpTextLoader.cs | 2 +- src/OmniSharp.Roslyn/OmniSharpWorkspace.cs | 5 +---- src/OmniSharp.Stdio.Driver/app.config | 10 +++++----- .../CustomRoslynAnalyzerFacts.cs | 2 ++ tests/app.config | 10 +++++----- 10 files changed, 29 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db87395622..95c69c236c 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.5] - not yet released +* Update to Roslyn `4.6.0-2.23128.12` (PR:[#2511](https://github.com/OmniSharp/omnisharp-roslyn/pull/2511)) + ## [1.39.4] - 2023-01-18 * Disable snippets in sync completion (PR: [#2497](https://github.com/OmniSharp/omnisharp-roslyn/pull/2497)) diff --git a/build/Packages.props b/build/Packages.props index 3b3e58d619..70a9e3b274 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -6,7 +6,7 @@ 17.4.1 17.3.1 6.4.0-preview.1.53 - 4.5.0-2.22527.10 + 4.6.0-2.23128.12 2.4.1 diff --git a/src/OmniSharp.Abstractions/Configuration.cs b/src/OmniSharp.Abstractions/Configuration.cs index 7c05a8844c..bbf725618c 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.5.0.0"; + public const string RoslynVersion = "4.6.0.0"; public const string RoslynPublicKeyToken = "31bf3856ad364e35"; public readonly static string RoslynFeatures = GetRoslynAssemblyFullName("Microsoft.CodeAnalysis.Features"); diff --git a/src/OmniSharp.Http.Driver/app.config b/src/OmniSharp.Http.Driver/app.config index 245d100fff..0c3edb7eab 100644 --- a/src/OmniSharp.Http.Driver/app.config +++ b/src/OmniSharp.Http.Driver/app.config @@ -7,23 +7,23 @@ - + - + - + - + - + diff --git a/src/OmniSharp.LanguageServerProtocol/app.config b/src/OmniSharp.LanguageServerProtocol/app.config index 97f01c3667..6d294e5044 100644 --- a/src/OmniSharp.LanguageServerProtocol/app.config +++ b/src/OmniSharp.LanguageServerProtocol/app.config @@ -7,23 +7,23 @@ - + - + - + - + - + diff --git a/src/OmniSharp.Roslyn/OmniSharpTextLoader.cs b/src/OmniSharp.Roslyn/OmniSharpTextLoader.cs index bff71242ce..f4a8b2f77f 100644 --- a/src/OmniSharp.Roslyn/OmniSharpTextLoader.cs +++ b/src/OmniSharp.Roslyn/OmniSharpTextLoader.cs @@ -26,7 +26,7 @@ public OmniSharpTextLoader(string filePath) this._filePath = filePath; } - public override Task LoadTextAndVersionAsync(Workspace workspace, DocumentId documentId, CancellationToken cancellationToken) + public override Task LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) { var prevLastWriteTime = File.GetLastWriteTimeUtc(_filePath); diff --git a/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs b/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs index c3be40bc63..075d5de6df 100644 --- a/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs +++ b/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs @@ -509,10 +509,7 @@ public DelegatingTextLoader(Document fromDocument) _fromDocument = fromDocument ?? throw new ArgumentNullException(nameof(fromDocument)); } - public override async Task LoadTextAndVersionAsync( - Workspace workspace, - DocumentId documentId, - CancellationToken cancellationToken) + public override async Task LoadTextAndVersionAsync(LoadTextOptions options, CancellationToken cancellationToken) { var sourceText = await _fromDocument.GetTextAsync(); var version = await _fromDocument.GetTextVersionAsync(); diff --git a/src/OmniSharp.Stdio.Driver/app.config b/src/OmniSharp.Stdio.Driver/app.config index 245d100fff..0c3edb7eab 100644 --- a/src/OmniSharp.Stdio.Driver/app.config +++ b/src/OmniSharp.Stdio.Driver/app.config @@ -7,23 +7,23 @@ - + - + - + - + - + diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs index 922f993c53..83e8be56d4 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs @@ -42,7 +42,9 @@ public override ImmutableArray GetAnalyzersForAllLanguages() } [DiagnosticAnalyzer(LanguageNames.CSharp)] +#pragma warning disable RS1036 // Specify analyzer banned API enforcement setting public class TestDiagnosticAnalyzer : DiagnosticAnalyzer +#pragma warning restore RS1036 // Specify analyzer banned API enforcement setting { public TestDiagnosticAnalyzer(string id, bool isEnabledByDefault) { diff --git a/tests/app.config b/tests/app.config index d07754e1d6..19bd64ad7b 100644 --- a/tests/app.config +++ b/tests/app.config @@ -7,23 +7,23 @@ - + - + - + - + - + From a87f2861a25746a379162278ba6d00bd43438416 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 2 Mar 2023 11:22:18 -0800 Subject: [PATCH 2/6] Include external access in binding redirect --- src/OmniSharp.Http.Driver/app.config | 8 ++++++++ src/OmniSharp.LanguageServerProtocol/app.config | 8 ++++++++ src/OmniSharp.Stdio.Driver/app.config | 8 ++++++++ tests/app.config | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/src/OmniSharp.Http.Driver/app.config b/src/OmniSharp.Http.Driver/app.config index 0c3edb7eab..4db76b59d6 100644 --- a/src/OmniSharp.Http.Driver/app.config +++ b/src/OmniSharp.Http.Driver/app.config @@ -25,6 +25,14 @@ + + + + + + + + diff --git a/src/OmniSharp.LanguageServerProtocol/app.config b/src/OmniSharp.LanguageServerProtocol/app.config index 6d294e5044..cf6a6217d0 100644 --- a/src/OmniSharp.LanguageServerProtocol/app.config +++ b/src/OmniSharp.LanguageServerProtocol/app.config @@ -25,6 +25,14 @@ + + + + + + + + diff --git a/src/OmniSharp.Stdio.Driver/app.config b/src/OmniSharp.Stdio.Driver/app.config index 0c3edb7eab..4db76b59d6 100644 --- a/src/OmniSharp.Stdio.Driver/app.config +++ b/src/OmniSharp.Stdio.Driver/app.config @@ -25,6 +25,14 @@ + + + + + + + + diff --git a/tests/app.config b/tests/app.config index 19bd64ad7b..53b48f3aa8 100644 --- a/tests/app.config +++ b/tests/app.config @@ -25,6 +25,14 @@ + + + + + + + + From 18659cc264dc8136c220a78f0e7a3bb1a6500b7b Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 2 Mar 2023 14:32:34 -0800 Subject: [PATCH 3/6] react to change in completion ordering --- tests/OmniSharp.Roslyn.CSharp.Tests/CompletionFacts.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/CompletionFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/CompletionFacts.cs index 9d2fc512b9..44d693526a 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/CompletionFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/CompletionFacts.cs @@ -299,7 +299,7 @@ public async Task ImportCompletion_OnLine0(string filename, bool useAsyncComplet using var host = useAsyncCompletion ? GetAsyncCompletionAndImportCompletionHost() : GetImportCompletionHost(); var completions = await FindCompletionsWithImportedAsync(filename, input, host); - var resolved = await ResolveCompletionAsync(completions.Items.Last(c => c.TextEdit.NewText == "Console"), host); + var resolved = await ResolveCompletionAsync(completions.Items.First(c => c.TextEdit.NewText == "Console"), host); Assert.Single(resolved.Item.AdditionalTextEdits); var additionalEdit = resolved.Item.AdditionalTextEdits[0]; From 777608f842cd34e52f2629967ffa12fe0d297ac9 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Fri, 3 Mar 2023 16:03:48 -0800 Subject: [PATCH 4/6] Use version of roslyn with multitargeting external access --- CHANGELOG.md | 2 +- build/Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95c69c236c..1322be9074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All changes to the project will be documented in this file. ## [1.39.5] - not yet released -* Update to Roslyn `4.6.0-2.23128.12` (PR:[#2511](https://github.com/OmniSharp/omnisharp-roslyn/pull/2511)) +* Update to Roslyn `4.6.0-3.23153.5` (PR:[#2511](https://github.com/OmniSharp/omnisharp-roslyn/pull/2511)) ## [1.39.4] - 2023-01-18 * Disable snippets in sync completion (PR: [#2497](https://github.com/OmniSharp/omnisharp-roslyn/pull/2497)) diff --git a/build/Packages.props b/build/Packages.props index 70a9e3b274..1cef69ccd1 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -6,7 +6,7 @@ 17.4.1 17.3.1 6.4.0-preview.1.53 - 4.6.0-2.23128.12 + 4.6.0-3.23153.5 2.4.1 From 94ca8e573527f50b1a622ed712c0b35d522af80c Mon Sep 17 00:00:00 2001 From: David Barbet Date: Fri, 3 Mar 2023 16:52:17 -0800 Subject: [PATCH 5/6] Fix fix all tests to account for null action --- .../Services/Refactoring/RunFixAllCodeActionService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/RunFixAllCodeActionService.cs b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/RunFixAllCodeActionService.cs index f04b9a8db9..68999640df 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/RunFixAllCodeActionService.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Refactoring/RunFixAllCodeActionService.cs @@ -173,7 +173,7 @@ private async Task FixSpecificDiagnosticIdAsync(Document document, str document.Project, codeFixProvider, roslynScope, - action.EquivalenceKey, + action?.EquivalenceKey, ImmutableArray.Create(diagnosticId), _fixAllDiagnosticProvider, _ => codeActionOptions, From 85101fd87e1537c7df0dd85623461ff9a1954087 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Fri, 3 Mar 2023 17:59:29 -0800 Subject: [PATCH 6/6] Fix LSP completion tests --- tests/OmniSharp.Lsp.Tests/OmnisharpCompletionHandlerFacts.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/OmniSharp.Lsp.Tests/OmnisharpCompletionHandlerFacts.cs b/tests/OmniSharp.Lsp.Tests/OmnisharpCompletionHandlerFacts.cs index 7d8f0f810d..4d5133dd80 100644 --- a/tests/OmniSharp.Lsp.Tests/OmnisharpCompletionHandlerFacts.cs +++ b/tests/OmniSharp.Lsp.Tests/OmnisharpCompletionHandlerFacts.cs @@ -283,7 +283,7 @@ public async Task ImportCompletion_OnLine0(string filename) await EnableImportCompletion(); var completions = await FindCompletionsWithImportedAsync(filename, input); - var resolved = await ResolveCompletionAsync(completions.Items.Last(c => c.TextEdit.TextEdit.NewText == "Console")); + var resolved = await ResolveCompletionAsync(completions.Items.First(c => c.TextEdit.TextEdit.NewText == "Console")); Assert.Single(resolved.AdditionalTextEdits); var additionalEdit = resolved.AdditionalTextEdits.First();