From 8fb0e3e9bfa315317c7bc19c54c65c361ea5f76f Mon Sep 17 00:00:00 2001 From: Akshita Date: Thu, 27 Jun 2019 17:35:46 -0700 Subject: [PATCH 1/4] update rolsyn for preview 7 --- CHANGELOG.md | 2 +- build/Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c019ef943..3674279927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ All changes to the project will be documented in this file. } ``` * Fixed a regression on declaration name completion (PR: [#1520](https://github.com/OmniSharp/omnisharp-roslyn/pull/1520)) -* Update to Roslyn `3.2.0-beta4-19319-04` (PR: [#1527](https://github.com/OmniSharp/omnisharp-roslyn/pull/1527)) +* Update to Roslyn `3.2.0-beta4-19326-12` (PR: [#1527](https://github.com/OmniSharp/omnisharp-roslyn/pull/1527)) * Added snippets support in LSP mode (PR: [#1422](https://github.com/OmniSharp/omnisharp-roslyn/pull/1422)) * Fixed renaming in LSP mode (PR: [#1423](https://github.com/OmniSharp/omnisharp-roslyn/pull/1423)) diff --git a/build/Packages.props b/build/Packages.props index 6b0ff47c42..3d0cd11973 100644 --- a/build/Packages.props +++ b/build/Packages.props @@ -4,7 +4,7 @@ 16.0.461 5.0.0 - 3.2.0-beta4-19319-04 + 3.2.0-beta4-19326-12 2.4.0 From b7dce4ffe0e154c003e06b5bb228314bcb9443ec Mon Sep 17 00:00:00 2001 From: Akshita Date: Thu, 27 Jun 2019 17:37:04 -0700 Subject: [PATCH 2/4] update PR version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3674279927..e3ab96dadf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ All changes to the project will be documented in this file. } ``` * Fixed a regression on declaration name completion (PR: [#1520](https://github.com/OmniSharp/omnisharp-roslyn/pull/1520)) -* Update to Roslyn `3.2.0-beta4-19326-12` (PR: [#1527](https://github.com/OmniSharp/omnisharp-roslyn/pull/1527)) +* Update to Roslyn `3.2.0-beta4-19326-12` (PR: [#1527](https://github.com/OmniSharp/omnisharp-roslyn/pull/1533)) * Added snippets support in LSP mode (PR: [#1422](https://github.com/OmniSharp/omnisharp-roslyn/pull/1422)) * Fixed renaming in LSP mode (PR: [#1423](https://github.com/OmniSharp/omnisharp-roslyn/pull/1423)) From 99b2493ce82cc714dd21e8f7341133a25fa2f09d Mon Sep 17 00:00:00 2001 From: Akshita Date: Thu, 27 Jun 2019 17:49:02 -0700 Subject: [PATCH 3/4] resolve errors --- src/OmniSharp.Roslyn/Extensions/SymbolExtensions.cs | 2 +- .../OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OmniSharp.Roslyn/Extensions/SymbolExtensions.cs b/src/OmniSharp.Roslyn/Extensions/SymbolExtensions.cs index 5afa063bcb..4808188744 100644 --- a/src/OmniSharp.Roslyn/Extensions/SymbolExtensions.cs +++ b/src/OmniSharp.Roslyn/Extensions/SymbolExtensions.cs @@ -207,7 +207,7 @@ internal static INamedTypeSymbol GetTopLevelContainingNamedType(this ISymbol sym { // Traverse up until we find a named type that is parented by the namespace var topLevelNamedType = symbol; - while (topLevelNamedType.ContainingSymbol != symbol.ContainingNamespace || + while (!Equals(topLevelNamedType.ContainingSymbol, symbol.ContainingNamespace) || topLevelNamedType.Kind != SymbolKind.NamedType) { topLevelNamedType = topLevelNamedType.ContainingSymbol; diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs index a27b7b4e3c..532c179dc0 100644 --- a/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs +++ b/tests/OmniSharp.Roslyn.CSharp.Tests/CustomRoslynAnalyzerFacts.cs @@ -71,6 +71,8 @@ public override ImmutableArray SupportedDiagnostics public override void Initialize(AnalysisContext context) { + context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); + context.EnableConcurrentExecution(); context.RegisterSymbolAction(AnalyzeSymbol, SymbolKind.NamedType); } From acc5a471c877c33b80faae50a52e9075f17efb59 Mon Sep 17 00:00:00 2001 From: Akshita Date: Thu, 27 Jun 2019 17:54:43 -0700 Subject: [PATCH 4/4] some more errors from analyzers --- .../Workers/Intellisense/SnippetGenerator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OmniSharp.Roslyn.CSharp/Workers/Intellisense/SnippetGenerator.cs b/src/OmniSharp.Roslyn.CSharp/Workers/Intellisense/SnippetGenerator.cs index 2a3a61d88f..db24917b45 100644 --- a/src/OmniSharp.Roslyn.CSharp/Workers/Intellisense/SnippetGenerator.cs +++ b/src/OmniSharp.Roslyn.CSharp/Workers/Intellisense/SnippetGenerator.cs @@ -73,7 +73,7 @@ private void RenderMethodSymbol(IMethodSymbol methodSymbol) _sb.Append(arg); RenderSnippetEndMarker(); - if (arg != last) + if (!Equals(arg, last)) { _sb.Append(", "); } @@ -107,7 +107,7 @@ private void RenderParameters(IMethodSymbol methodSymbol) _sb.Append(parameter.ToDisplayString(_format)); RenderSnippetEndMarker(); - if (parameter != last) + if (!Equals(parameter, last)) { _sb.Append(", "); } @@ -127,7 +127,7 @@ private IEnumerable NonInferredTypeArguments(IMethodSymbol methodSymbol { var arg = typeArguments[i]; var param = typeParameters[i]; - if (arg == param) + if (Equals(arg, param)) { // this type parameter has not been resolved nonInferredTypeArguments.Add(arg);