diff --git a/CHANGELOG.md b/CHANGELOG.md index 624f7c9ae3..e02d7cb559 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 (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)) * 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..f01ec57eea 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 @@ -59,6 +59,12 @@ + + + + @@ -72,10 +78,10 @@ - - + + - + 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/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 @@ + + + + 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..a66cf5d1db 100644 --- a/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs +++ b/src/OmniSharp.Roslyn.CSharp/Services/Completion/CompletionListBuilder_Async.cs @@ -46,8 +46,13 @@ 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/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs index 486b7bbbbc..922f993c53 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs @@ -7,8 +7,6 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; using OmniSharp.Models.Diagnostics; -using OmniSharp.MSBuild; -using OmniSharp.Roslyn.CSharp.Services.Diagnostics; using TestUtility; using Xunit; using Xunit.Abstractions; @@ -211,7 +209,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()) 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; } 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 @@ - - - + + +