From 31f0e178b111f6b3b242821d1ee3acb4cb59d5f9 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Tue, 20 Dec 2022 16:38:51 -0800 Subject: [PATCH 1/9] Initial version bump --- CHANGELOG.md | 3 +++ build/Packages.props | 4 ++-- src/OmniSharp.Abstractions/Configuration.cs | 2 +- src/OmniSharp.Http.Driver/app.config | 12 ++++++------ src/OmniSharp.LanguageServerProtocol/app.config | 10 +++++----- .../Services/Completion/CompletionListBuilder.cs | 3 ++- .../Completion/CompletionListBuilder_Async.cs | 10 ++++++++-- .../Intellisense/CompletionItemExtensions.cs | 2 +- .../Navigation/SourceGeneratedFileService.cs | 4 ++-- src/OmniSharp.Stdio.Driver/app.config | 12 ++++++------ tests/app.config | 12 ++++++------ tools/packages.config | 6 +++--- 12 files changed, 45 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 624f7c9ae3..0d115c0d4c 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.3] +* Update Roslyn to 4.5.0-2.22527.10 + ## [1.39.2] - 2022-10-26 * Add missing LSP Handlers (PR: [#2463](https://github.com/OmniSharp/omnisharp-roslyn/pull/2463)) * Add the TypeDefinitionHandler to the LSP (PR: [#2461](https://github.com/OmniSharp/omnisharp-roslyn/pull/2461)) diff --git a/build/Packages.props b/build/Packages.props index 0a2ad0c390..80fbfece16 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -6,7 +6,7 @@ 17.3.0 17.3.1 6.4.0-preview.1.53 - 4.4.0-3.22429.3 + 4.5.0-2.22527.10 2.4.1 @@ -75,7 +75,7 @@ - + diff --git a/src/OmniSharp.Abstractions/Configuration.cs b/src/OmniSharp.Abstractions/Configuration.cs index 9236ee4381..7c05a8844c 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.4.0.0"; + public const string RoslynVersion = "4.5.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 959bf24795..245d100fff 100644 --- a/src/OmniSharp.Http.Driver/app.config +++ b/src/OmniSharp.Http.Driver/app.config @@ -7,23 +7,23 @@ - + - + - + - + - + @@ -65,7 +65,7 @@ - diff --git a/src/OmniSharp.LanguageServerProtocol/app.config b/src/OmniSharp.LanguageServerProtocol/app.config index b9268318f4..97f01c3667 100644 --- a/src/OmniSharp.LanguageServerProtocol/app.config +++ b/src/OmniSharp.LanguageServerProtocol/app.config @@ -7,23 +7,23 @@ - + - + - + - + - + diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder.cs b/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder.cs index 9f822e61fa..e6ca7e2c72 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder.cs @@ -64,7 +64,8 @@ internal static partial class CompletionListBuilder internal const string XmlDocCommentCompletionProvider = "Microsoft.CodeAnalysis.CSharp.Completion.Providers.XmlDocCommentCompletionProvider"; internal const string TypeImportCompletionProvider = "Microsoft.CodeAnalysis.CSharp.Completion.Providers.TypeImportCompletionProvider"; internal const string ExtensionMethodImportCompletionProvider = "Microsoft.CodeAnalysis.CSharp.Completion.Providers.ExtensionMethodImportCompletionProvider"; - internal const string AggregateEmeddedLanguageCompletionProvider = "Microsoft.CodeAnalysis.CSharp.Completion.Providers.AggregateEmbeddedLanguageCompletionProvider"; + internal const string AggregateEmbeddedLanguageCompletionProvider = "Microsoft.CodeAnalysis.CSharp.Completion.Providers.AggregateEmbeddedLanguageCompletionProvider"; + internal const string SnippetCompletionProvider = "Microsoft.CodeAnalysis.CSharp.Completion.CompletionProviders.Snippets.CSharpSnippetCompletionProvider"; internal static async Task<(IReadOnlyList, bool)> BuildCompletionItems( Document document, diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs b/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs index 1543c7267e..6ab6ad6762 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs @@ -46,8 +46,14 @@ internal static partial class CompletionListBuilder bool hasAfterInsertStep = false; if (completion.IsComplexTextEdit) { - // The completion is somehow expensive. Currently, this one of two categories: import completion, or override/partial - // completion. + // To-do: Add support for snippet items: https://github.com/OmniSharp/omnisharp-roslyn/issues/2485 + if (completion.GetProviderName() == SnippetCompletionProvider) + { + continue; + } + + + // The completion is somehow expensive. Currently, this one of two categories: import completion or override/partial completion. Debug.Assert(completion.GetProviderName() is OverrideCompletionProvider or PartialMethodCompletionProvider or TypeImportCompletionProvider or ExtensionMethodImportCompletionProvider or AwaitCompletionProvider); diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/CompletionItemExtensions.cs b/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/CompletionItemExtensions.cs index ab8843423f..71aa0e1973 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/CompletionItemExtensions.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Intellisense/CompletionItemExtensions.cs @@ -84,7 +84,7 @@ public static AutoCompleteResponse ToAutoCompleteResponse(this CompletionItem it // if provider name is "Microsoft.CodeAnalysis.CSharp.Completion.Providers.EmbeddedLanguageCompletionProvider" // we have access to more elaborate description - if (item.GetProviderName() == CompletionListBuilder.AggregateEmeddedLanguageCompletionProvider) + if (item.GetProviderName() == CompletionListBuilder.AggregateEmbeddedLanguageCompletionProvider) { response.DisplayText = item.InlineDescription; if (item.Properties.TryGetValue("DescriptionKey", out var description)) diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Navigation/SourceGeneratedFileService.cs b/src/OmniSharp.Roslyn.CSharp/Services/Navigation/SourceGeneratedFileService.cs index 0bd49e91c9..e3bfb6b8b5 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Navigation/SourceGeneratedFileService.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Navigation/SourceGeneratedFileService.cs @@ -46,10 +46,10 @@ public async Task Handle(SourceGeneratedFileRequest var text = await document.GetTextAsync(); - var documentVerison = await document.GetTextVersionAsync(); + var documentVersion = await document.GetTextVersionAsync(); lock (_lock) { - _lastSentVerisons[documentId] = documentVerison; + _lastSentVerisons[documentId] = documentVersion; } return new SourceGeneratedFileResponse diff --git a/src/OmniSharp.Stdio.Driver/app.config b/src/OmniSharp.Stdio.Driver/app.config index 959bf24795..245d100fff 100644 --- a/src/OmniSharp.Stdio.Driver/app.config +++ b/src/OmniSharp.Stdio.Driver/app.config @@ -7,23 +7,23 @@ - + - + - + - + - + @@ -65,7 +65,7 @@ - diff --git a/tests/app.config b/tests/app.config index d2bbdeeef6..d07754e1d6 100644 --- a/tests/app.config +++ b/tests/app.config @@ -7,23 +7,23 @@ - + - + - + - + - + @@ -49,7 +49,7 @@ - diff --git a/tools/packages.config b/tools/packages.config index 6e01220c1c..07ba295eab 100644 --- a/tools/packages.config +++ b/tools/packages.config @@ -5,7 +5,7 @@ - - - + + + From 02ab44f04de445a7ae5685427fd2fce6d4b73095 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Tue, 20 Dec 2022 17:54:34 -0800 Subject: [PATCH 2/9] Fix source generator issue --- .../SourceGeneratorFacts.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs index e4cb5b1eef..93edcb9869 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs @@ -84,6 +84,12 @@ class GeneratedCode Buffer = Code.Replace("Hello world!", "Goodbye!") }); + updateRequest = new UpdateSourceGeneratedFileRequest + { + DocumentGuid = gotoDefResponse.SourceGeneratedFileInfo.DocumentGuid, + ProjectGuid = gotoDefResponse.SourceGeneratedFileInfo.ProjectGuid + }; + updatedResponse = await updateHandler.Handle(updateRequest); Assert.Equal(UpdateType.Modified, updatedResponse.UpdateType); Assert.Contains("Goodbye!", updatedResponse.Source); @@ -95,6 +101,12 @@ class GeneratedCode Buffer = @"_ = GeneratedCode.S;" }); + updateRequest = new UpdateSourceGeneratedFileRequest + { + DocumentGuid = gotoDefResponse.SourceGeneratedFileInfo.DocumentGuid, + ProjectGuid = gotoDefResponse.SourceGeneratedFileInfo.ProjectGuid + }; + updatedResponse = await updateHandler.Handle(updateRequest); Assert.Equal(UpdateType.Deleted, updatedResponse.UpdateType); Assert.Null(updatedResponse.Source); From dfb1d4f94105c2606aaf4c52d346adc0d3bcd7fe Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Tue, 20 Dec 2022 18:44:09 -0800 Subject: [PATCH 3/9] Actually fix source generator issue --- .../SourceGeneratorFacts.cs | 13 ------------- .../TestSourceGenerator.cs | 6 ++++-- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs index 93edcb9869..483a57d64e 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs @@ -84,12 +84,6 @@ class GeneratedCode Buffer = Code.Replace("Hello world!", "Goodbye!") }); - updateRequest = new UpdateSourceGeneratedFileRequest - { - DocumentGuid = gotoDefResponse.SourceGeneratedFileInfo.DocumentGuid, - ProjectGuid = gotoDefResponse.SourceGeneratedFileInfo.ProjectGuid - }; - updatedResponse = await updateHandler.Handle(updateRequest); Assert.Equal(UpdateType.Modified, updatedResponse.UpdateType); Assert.Contains("Goodbye!", updatedResponse.Source); @@ -100,13 +94,6 @@ class GeneratedCode FileName = Path, Buffer = @"_ = GeneratedCode.S;" }); - - updateRequest = new UpdateSourceGeneratedFileRequest - { - DocumentGuid = gotoDefResponse.SourceGeneratedFileInfo.DocumentGuid, - ProjectGuid = gotoDefResponse.SourceGeneratedFileInfo.ProjectGuid - }; - updatedResponse = await updateHandler.Handle(updateRequest); Assert.Equal(UpdateType.Deleted, updatedResponse.UpdateType); Assert.Null(updatedResponse.Source); diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/TestSourceGenerator.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/TestSourceGenerator.cs index 8ea881fff3..b4dd6a5a0f 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/TestSourceGenerator.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/TestSourceGenerator.cs @@ -30,19 +30,21 @@ public class TestGeneratorReference : AnalyzerReference { private readonly bool _isEnabledByDefault; private readonly Action _execute; + private readonly ImmutableArray _generators; public TestGeneratorReference(Action execute, [CallerMemberName] string testId = "", bool isEnabledByDefault = true) { Id = testId; _isEnabledByDefault = isEnabledByDefault; _execute = execute; + _generators = ImmutableArray.Create(new TestSourceGenerator(_execute)); } public override ImmutableArray GetGenerators(string language) - => ImmutableArray.Create(new TestSourceGenerator(_execute)); + => _generators; public override ImmutableArray GetGeneratorsForAllLanguages() - => ImmutableArray.Create(new TestSourceGenerator(_execute)); + => _generators; public override string FullPath => null; public override object Id { get; } From 4ab57e33b4c3d060b4fd1675aaf3dba30ea90b86 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Tue, 20 Dec 2022 21:10:40 -0800 Subject: [PATCH 4/9] Skip test --- .../OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs index 486b7bbbbc..8d40ebf20c 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs @@ -5,6 +5,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Diagnostics; using OmniSharp.Models.Diagnostics; using OmniSharp.MSBuild; @@ -211,7 +212,7 @@ public async Task When_custom_rule_is_set_to_none_dont_return_results_at_all() } } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/66085")] public async Task When_diagnostic_is_disabled_by_default_updating_rule_will_enable_it() { using (var host = GetHost()) From 60c2ffdc66765d6805c927a221301587115d71cd Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Tue, 20 Dec 2022 21:11:58 -0800 Subject: [PATCH 5/9] Cleanup --- .../OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs index 8d40ebf20c..922f993c53 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs @@ -5,11 +5,8 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Diagnostics; using OmniSharp.Models.Diagnostics; -using OmniSharp.MSBuild; -using OmniSharp.Roslyn.CSharp.Services.Diagnostics; using TestUtility; using Xunit; using Xunit.Abstractions; From dacd86b7ef3c2faf8961d798d12b0bef692cf0e1 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Tue, 20 Dec 2022 21:12:50 -0800 Subject: [PATCH 6/9] Cleanup --- .../Services/Completion/CompletionListBuilder_Async.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs b/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs index 6ab6ad6762..a66cf5d1db 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs @@ -52,7 +52,6 @@ internal static partial class CompletionListBuilder continue; } - // The completion is somehow expensive. Currently, this one of two categories: import completion or override/partial completion. Debug.Assert(completion.GetProviderName() is OverrideCompletionProvider or PartialMethodCompletionProvider or TypeImportCompletionProvider or ExtensionMethodImportCompletionProvider From 91af9c8e0775a1cc096010bd3c774d444adb4924 Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Tue, 20 Dec 2022 21:13:50 -0800 Subject: [PATCH 7/9] Cleanup --- tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs index 483a57d64e..e4cb5b1eef 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/SourceGeneratorFacts.cs @@ -94,6 +94,7 @@ class GeneratedCode FileName = Path, Buffer = @"_ = GeneratedCode.S;" }); + updatedResponse = await updateHandler.Handle(updateRequest); Assert.Equal(UpdateType.Deleted, updatedResponse.UpdateType); Assert.Null(updatedResponse.Source); From 9d798e83acaa4354d0381ba6c9bcd441ff58882b Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Wed, 21 Dec 2022 21:53:07 -0800 Subject: [PATCH 8/9] Update package versions --- build/Packages.props | 10 ++++++++-- .../OmniSharp.LanguageServerProtocol.csproj | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/build/Packages.props b/build/Packages.props index 80fbfece16..f01ec57eea 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -59,6 +59,12 @@ + + + + @@ -72,8 +78,8 @@ - - + + diff --git a/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj b/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj index 643b870a6a..d61752b376 100644 --- a/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj +++ b/src/OmniSharp.LanguageServerProtocol/OmniSharp.LanguageServerProtocol.csproj @@ -15,6 +15,12 @@ + + + + From 14fcf919534305f67f9ec2a4ffb12b72f7f7d50d Mon Sep 17 00:00:00 2001 From: Allison Chou Date: Wed, 21 Dec 2022 21:56:52 -0800 Subject: [PATCH 9/9] Update PR number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d115c0d4c..e02d7cb559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All changes to the project will be documented in this file. ## [1.39.3] -* Update Roslyn to 4.5.0-2.22527.10 +* Update Roslyn to 4.5.0-2.22527.10 (PR: [#2486](https://github.com/OmniSharp/omnisharp-roslyn/pull/2486)) ## [1.39.2] - 2022-10-26 * Add missing LSP Handlers (PR: [#2463](https://github.com/OmniSharp/omnisharp-roslyn/pull/2463))