From 4c23b49cfff482cf7ff55d1292c96382e2ba14be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Sun, 18 Feb 2024 23:00:54 +0100 Subject: [PATCH 01/11] package changes --- src/CFamily.UnitTests/packages.lock.json | 1 + src/CloudSecrets.UnitTests/packages.lock.json | 8 ++++++++ src/ConnectedMode.UnitTests/packages.lock.json | 8 ++++++++ src/ConnectedMode/ConnectedMode.csproj | 1 + src/ConnectedMode/packages.lock.json | 7 +++++++ src/Core.UnitTests/packages.lock.json | 8 ++++++++ src/Education.UnitTests/packages.lock.json | 1 + src/EmbeddedVsix.UnitTests/packages.lock.json | 8 ++++++++ src/Infrastructure.VS.UnitTests/packages.lock.json | 8 ++++++++ src/Integration.TeamExplorer.UnitTests/packages.lock.json | 8 ++++++++ src/Integration.TeamExplorer/packages.lock.json | 8 ++++++++ src/Integration.UnitTests/packages.lock.json | 8 ++++++++ src/Integration.Vsix.UnitTests/packages.lock.json | 1 + .../AsmRef_Integration.Vsix_Baseline_WithStrongNames.txt | 5 +++-- ...smRef_Integration.Vsix_Baseline_WithoutStrongNames.txt | 5 +++-- src/Integration.Vsix/packages.lock.json | 1 + src/Integration/packages.lock.json | 8 ++++++++ src/IssueViz.Security.UnitTests/packages.lock.json | 8 ++++++++ src/IssueViz.Security/packages.lock.json | 8 ++++++++ src/IssueViz.UnitTests/packages.lock.json | 8 ++++++++ src/Progress.UnitTests/packages.lock.json | 8 ++++++++ .../Roslyn.Suppressions.UnitTests/packages.lock.json | 8 ++++++++ .../Roslyn.Suppressions/packages.lock.json | 8 ++++++++ src/SLCore.Listeners.UnitTests/packages.lock.json | 1 + src/SLCore.Listeners/packages.lock.json | 1 + src/SLCore.UnitTests/packages.lock.json | 1 + src/TestInfrastructure/packages.lock.json | 8 ++++++++ src/TypeScript.UnitTests/packages.lock.json | 8 ++++++++ 28 files changed, 157 insertions(+), 4 deletions(-) diff --git a/src/CFamily.UnitTests/packages.lock.json b/src/CFamily.UnitTests/packages.lock.json index 040d7c822a..29e3a6f4de 100644 --- a/src/CFamily.UnitTests/packages.lock.json +++ b/src/CFamily.UnitTests/packages.lock.json @@ -1588,6 +1588,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, diff --git a/src/CloudSecrets.UnitTests/packages.lock.json b/src/CloudSecrets.UnitTests/packages.lock.json index 46610446a8..43275024f1 100644 --- a/src/CloudSecrets.UnitTests/packages.lock.json +++ b/src/CloudSecrets.UnitTests/packages.lock.json @@ -1525,6 +1525,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1603,6 +1604,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/ConnectedMode.UnitTests/packages.lock.json b/src/ConnectedMode.UnitTests/packages.lock.json index 313428855a..ea9a3b257b 100644 --- a/src/ConnectedMode.UnitTests/packages.lock.json +++ b/src/ConnectedMode.UnitTests/packages.lock.json @@ -1541,6 +1541,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1619,6 +1620,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/ConnectedMode/ConnectedMode.csproj b/src/ConnectedMode/ConnectedMode.csproj index 09c5923c2f..d0085597eb 100644 --- a/src/ConnectedMode/ConnectedMode.csproj +++ b/src/ConnectedMode/ConnectedMode.csproj @@ -47,6 +47,7 @@ + diff --git a/src/ConnectedMode/packages.lock.json b/src/ConnectedMode/packages.lock.json index 21766d9334..bf8b7b4660 100644 --- a/src/ConnectedMode/packages.lock.json +++ b/src/ConnectedMode/packages.lock.json @@ -1467,6 +1467,13 @@ "SonarQube.Client": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Core.UnitTests/packages.lock.json b/src/Core.UnitTests/packages.lock.json index 46610446a8..43275024f1 100644 --- a/src/Core.UnitTests/packages.lock.json +++ b/src/Core.UnitTests/packages.lock.json @@ -1525,6 +1525,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1603,6 +1604,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Education.UnitTests/packages.lock.json b/src/Education.UnitTests/packages.lock.json index 2af787fa59..04e002bd21 100644 --- a/src/Education.UnitTests/packages.lock.json +++ b/src/Education.UnitTests/packages.lock.json @@ -1536,6 +1536,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, diff --git a/src/EmbeddedVsix.UnitTests/packages.lock.json b/src/EmbeddedVsix.UnitTests/packages.lock.json index 371110d3ba..af5a68172b 100644 --- a/src/EmbeddedVsix.UnitTests/packages.lock.json +++ b/src/EmbeddedVsix.UnitTests/packages.lock.json @@ -1528,6 +1528,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1606,6 +1607,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "SonarLint.VisualStudio.TypeScript": { "type": "Project", "dependencies": { diff --git a/src/Infrastructure.VS.UnitTests/packages.lock.json b/src/Infrastructure.VS.UnitTests/packages.lock.json index 46610446a8..43275024f1 100644 --- a/src/Infrastructure.VS.UnitTests/packages.lock.json +++ b/src/Infrastructure.VS.UnitTests/packages.lock.json @@ -1525,6 +1525,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1603,6 +1604,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Integration.TeamExplorer.UnitTests/packages.lock.json b/src/Integration.TeamExplorer.UnitTests/packages.lock.json index 877a6c9f76..0fd5db688d 100644 --- a/src/Integration.TeamExplorer.UnitTests/packages.lock.json +++ b/src/Integration.TeamExplorer.UnitTests/packages.lock.json @@ -1531,6 +1531,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1618,6 +1619,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Integration.TeamExplorer/packages.lock.json b/src/Integration.TeamExplorer/packages.lock.json index e8790e248a..d2f21a80d5 100644 --- a/src/Integration.TeamExplorer/packages.lock.json +++ b/src/Integration.TeamExplorer/packages.lock.json @@ -1465,6 +1465,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1522,6 +1523,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Integration.UnitTests/packages.lock.json b/src/Integration.UnitTests/packages.lock.json index 34f5ffaa91..f760ca2c30 100644 --- a/src/Integration.UnitTests/packages.lock.json +++ b/src/Integration.UnitTests/packages.lock.json @@ -1532,6 +1532,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1610,6 +1611,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Integration.Vsix.UnitTests/packages.lock.json b/src/Integration.Vsix.UnitTests/packages.lock.json index a01086175d..350f7e3c21 100644 --- a/src/Integration.Vsix.UnitTests/packages.lock.json +++ b/src/Integration.Vsix.UnitTests/packages.lock.json @@ -1599,6 +1599,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, diff --git a/src/Integration.Vsix/AsmRef_Integration.Vsix_Baseline_WithStrongNames.txt b/src/Integration.Vsix/AsmRef_Integration.Vsix_Baseline_WithStrongNames.txt index f6016b008c..4ea0ce43d1 100644 --- a/src/Integration.Vsix/AsmRef_Integration.Vsix_Baseline_WithStrongNames.txt +++ b/src/Integration.Vsix/AsmRef_Integration.Vsix_Baseline_WithStrongNames.txt @@ -1,7 +1,7 @@ --- ################################ # Assembly references report -# Report date/time: 2024-02-14T10:22:34.7734356Z +# Report date/time: 2024-02-18T22:00:18.5152223Z ################################ # # Generated by Devtility CheckAsmRefs v0.11.0.223 @@ -172,6 +172,7 @@ Referenced assemblies: - 'SonarLint.VisualStudio.Core, Version=7.7.0.0, Culture=neutral, PublicKeyToken=c5b62af9de6d7244' - 'SonarLint.VisualStudio.Infrastructure.VS, Version=7.7.0.0, Culture=neutral, PublicKeyToken=c5b62af9de6d7244' - 'SonarLint.VisualStudio.IssueVisualization, Version=7.7.0.0, Culture=neutral, PublicKeyToken=c5b62af9de6d7244' +- 'SonarLint.VisualStudio.SLCore, Version=7.7.0.0, Culture=neutral, PublicKeyToken=c5b62af9de6d7244' - 'SonarQube.Client, Version=7.7.0.0, Culture=neutral, PublicKeyToken=c5b62af9de6d7244' - 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' - 'System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' @@ -180,7 +181,7 @@ Referenced assemblies: - 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' - 'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' - 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' -# Number of references: 24 +# Number of references: 25 --- Assembly: 'SonarLint.VisualStudio.Core, Version=7.7.0.0, Culture=neutral, PublicKeyToken=c5b62af9de6d7244' diff --git a/src/Integration.Vsix/AsmRef_Integration.Vsix_Baseline_WithoutStrongNames.txt b/src/Integration.Vsix/AsmRef_Integration.Vsix_Baseline_WithoutStrongNames.txt index bb02498999..c5546db766 100644 --- a/src/Integration.Vsix/AsmRef_Integration.Vsix_Baseline_WithoutStrongNames.txt +++ b/src/Integration.Vsix/AsmRef_Integration.Vsix_Baseline_WithoutStrongNames.txt @@ -1,7 +1,7 @@ --- ################################ # Assembly references report -# Report date/time: 2024-02-14T10:22:34.7734356Z +# Report date/time: 2024-02-18T22:00:18.5152223Z ################################ # # Generated by Devtility CheckAsmRefs v0.11.0.223 @@ -172,6 +172,7 @@ Referenced assemblies: - 'SonarLint.VisualStudio.Core, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null' - 'SonarLint.VisualStudio.Infrastructure.VS, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null' - 'SonarLint.VisualStudio.IssueVisualization, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null' +- 'SonarLint.VisualStudio.SLCore, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null' - 'SonarQube.Client, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null' - 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' - 'System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' @@ -180,7 +181,7 @@ Referenced assemblies: - 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' - 'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' - 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' -# Number of references: 24 +# Number of references: 25 --- Assembly: 'SonarLint.VisualStudio.Core, Version=7.7.0.0, Culture=neutral, PublicKeyToken=null' diff --git a/src/Integration.Vsix/packages.lock.json b/src/Integration.Vsix/packages.lock.json index d4def040a0..474d7c7590 100644 --- a/src/Integration.Vsix/packages.lock.json +++ b/src/Integration.Vsix/packages.lock.json @@ -1560,6 +1560,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, diff --git a/src/Integration/packages.lock.json b/src/Integration/packages.lock.json index ecac407d54..fbe551f97b 100644 --- a/src/Integration/packages.lock.json +++ b/src/Integration/packages.lock.json @@ -1471,6 +1471,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1509,6 +1510,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/IssueViz.Security.UnitTests/packages.lock.json b/src/IssueViz.Security.UnitTests/packages.lock.json index c86630f000..91fdfa4d02 100644 --- a/src/IssueViz.Security.UnitTests/packages.lock.json +++ b/src/IssueViz.Security.UnitTests/packages.lock.json @@ -1547,6 +1547,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1636,6 +1637,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/IssueViz.Security/packages.lock.json b/src/IssueViz.Security/packages.lock.json index 040c3aa1f8..a5f89e16b4 100644 --- a/src/IssueViz.Security/packages.lock.json +++ b/src/IssueViz.Security/packages.lock.json @@ -1457,6 +1457,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1485,6 +1486,13 @@ "SonarQube.Client": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/IssueViz.UnitTests/packages.lock.json b/src/IssueViz.UnitTests/packages.lock.json index 46610446a8..43275024f1 100644 --- a/src/IssueViz.UnitTests/packages.lock.json +++ b/src/IssueViz.UnitTests/packages.lock.json @@ -1525,6 +1525,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1603,6 +1604,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Progress.UnitTests/packages.lock.json b/src/Progress.UnitTests/packages.lock.json index 7de6b61506..5ff045cc31 100644 --- a/src/Progress.UnitTests/packages.lock.json +++ b/src/Progress.UnitTests/packages.lock.json @@ -1525,6 +1525,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1616,6 +1617,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Roslyn.Suppressions/Roslyn.Suppressions.UnitTests/packages.lock.json b/src/Roslyn.Suppressions/Roslyn.Suppressions.UnitTests/packages.lock.json index 839c2e1cd1..c07f8fc041 100644 --- a/src/Roslyn.Suppressions/Roslyn.Suppressions.UnitTests/packages.lock.json +++ b/src/Roslyn.Suppressions/Roslyn.Suppressions.UnitTests/packages.lock.json @@ -1329,6 +1329,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1419,6 +1420,13 @@ "System.IO.Abstractions": "[9.0.4, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/Roslyn.Suppressions/Roslyn.Suppressions/packages.lock.json b/src/Roslyn.Suppressions/Roslyn.Suppressions/packages.lock.json index de265b5e3e..49d2d75bbc 100644 --- a/src/Roslyn.Suppressions/Roslyn.Suppressions/packages.lock.json +++ b/src/Roslyn.Suppressions/Roslyn.Suppressions/packages.lock.json @@ -1295,6 +1295,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1323,6 +1324,13 @@ "SonarQube.Client": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/SLCore.Listeners.UnitTests/packages.lock.json b/src/SLCore.Listeners.UnitTests/packages.lock.json index 273169b5d9..b63114f417 100644 --- a/src/SLCore.Listeners.UnitTests/packages.lock.json +++ b/src/SLCore.Listeners.UnitTests/packages.lock.json @@ -1525,6 +1525,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, diff --git a/src/SLCore.Listeners/packages.lock.json b/src/SLCore.Listeners/packages.lock.json index b7df42d50d..a69c34d0a1 100644 --- a/src/SLCore.Listeners/packages.lock.json +++ b/src/SLCore.Listeners/packages.lock.json @@ -1432,6 +1432,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, diff --git a/src/SLCore.UnitTests/packages.lock.json b/src/SLCore.UnitTests/packages.lock.json index 332e9a395f..43275024f1 100644 --- a/src/SLCore.UnitTests/packages.lock.json +++ b/src/SLCore.UnitTests/packages.lock.json @@ -1525,6 +1525,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, diff --git a/src/TestInfrastructure/packages.lock.json b/src/TestInfrastructure/packages.lock.json index 49ae53d039..9778675527 100644 --- a/src/TestInfrastructure/packages.lock.json +++ b/src/TestInfrastructure/packages.lock.json @@ -1531,6 +1531,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1588,6 +1589,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "sonarqube.client": { "type": "Project", "dependencies": { diff --git a/src/TypeScript.UnitTests/packages.lock.json b/src/TypeScript.UnitTests/packages.lock.json index 4b701682ed..5f0955d49c 100644 --- a/src/TypeScript.UnitTests/packages.lock.json +++ b/src/TypeScript.UnitTests/packages.lock.json @@ -1525,6 +1525,7 @@ "Newtonsoft.Json": "[13.0.3, )", "SonarLint.VisualStudio.Core": "[1.0.0, )", "SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )", + "SonarLint.VisualStudio.SLCore": "[1.0.0, )", "StrongNamer": "[0.0.8, )" } }, @@ -1603,6 +1604,13 @@ "SonarLint.VisualStudio.Progress": "[1.0.0, )" } }, + "SonarLint.VisualStudio.SLCore": { + "type": "Project", + "dependencies": { + "SonarLint.VisualStudio.Core": "[1.0.0, )", + "StreamJsonRpc": "[2.5.46, )" + } + }, "SonarLint.VisualStudio.TypeScript": { "type": "Project", "dependencies": { From d6e66d89e7ff5b5244dd9c41e993f4016c7c9d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Tue, 20 Feb 2024 11:43:24 +0100 Subject: [PATCH 02/11] implemented --- ...verConnectionConfigurationProviderTests.cs | 168 ++++++++++++++++++ .../IServerConnectionConfigurationProvider.cs | 30 ++++ .../ServerConnectionConfigurationProvider.cs | 111 ++++++++++++ .../Common/Helpers/ConnectionIdHelper.cs | 6 +- 4 files changed, 312 insertions(+), 3 deletions(-) create mode 100644 src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs create mode 100644 src/ConnectedMode/Binding/IServerConnectionConfigurationProvider.cs create mode 100644 src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs diff --git a/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs b/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs new file mode 100644 index 0000000000..58e73badde --- /dev/null +++ b/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs @@ -0,0 +1,168 @@ +/* + * SonarLint for Visual Studio + * Copyright (C) 2016-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +using System; +using System.Linq; +using SonarLint.VisualStudio.ConnectedMode.Binding; +using SonarLint.VisualStudio.ConnectedMode.Persistence; +using SonarLint.VisualStudio.Core; +using SonarLint.VisualStudio.Core.Binding; +using SonarLint.VisualStudio.SLCore.Common.Helpers; +using SonarLint.VisualStudio.SLCore.Service.Connection.Models; +using SonarQube.Client.Models; + +namespace SonarLint.VisualStudio.ConnectedMode.UnitTests.Binding +{ + [TestClass] + public class ServerConnectionConfigurationProviderTests + { + [TestMethod] + public void GetServerConnectionConfiguration_ConvertsSQBindindCorrectly() + { + var project = CreateBoundSonarQubeProject("http://someuri.com"); + + var solutionBindingRepository = CreateRepository(project); + + var testSubject = CreateTestSubject(solutionBindingRepository.Object); + + var bindings = testSubject.GetServerConnectionConfiguration().ToList(); + + bindings.Should().HaveCount(1); + bindings[0].connectionId.Should().Be("sq|http://someuri.com/"); + bindings[0].serverUrl.Should().Be("http://someuri.com/"); + bindings[0].disableNotification.Should().BeTrue(); + } + + [TestMethod] + public void GetServerConnectionConfiguration_ConvertsSCBindindCorrectly() + { + var project = CreateBoundSonarQubeProject("https://sonarcloud.io", "org"); + + var solutionBindingRepository = CreateRepository(project); + + var testSubject = CreateTestSubject(solutionBindingRepository.Object); + + var bindings = testSubject.GetServerConnectionConfiguration().ToList(); + + bindings.Should().HaveCount(1); + bindings[0].connectionId.Should().Be("sc|org"); + bindings[0].organization.Should().Be("org"); + bindings[0].disableNotification.Should().BeTrue(); + } + + [TestMethod] + public void GetServerConnectionConfiguration_HaveBothSQAndSC_ReturnsCorrectly() + { + var project1 = CreateBoundSonarQubeProject("http://someuri.com"); + var project2 = CreateBoundSonarQubeProject("http://someuri2.com"); + var project3 = CreateBoundSonarQubeProject("http://145.68.22.15:8964"); + var project4 = CreateBoundSonarQubeProject("https://sonarcloud.io", "org1"); + + var solutionBindingRepository = CreateRepository(project1, project2, project3, project4); + + var testSubject = CreateTestSubject(solutionBindingRepository.Object); + + var sqBindings = testSubject.GetServerConnectionConfiguration(); + var scBindings = testSubject.GetServerConnectionConfiguration(); + + sqBindings.Should().HaveCount(3); + scBindings.Should().HaveCount(1); + } + + [TestMethod] + public void GetServerConnectionConfiguration_HaveMultipleBindingWithSameUri_Aggregates() + { + var project1 = CreateBoundSonarQubeProject("http://someuri.com"); + var project2 = CreateBoundSonarQubeProject("http://someuri.com"); + var project3 = CreateBoundSonarQubeProject("http://145.68.22.15:8964"); + var project4 = CreateBoundSonarQubeProject("https://sonarcloud.io", "org1"); + var project5 = CreateBoundSonarQubeProject("https://sonarcloud.io", "org2"); + + var solutionBindingRepository = CreateRepository(project1, project2, project3, project4, project5); + + var testSubject = CreateTestSubject(solutionBindingRepository.Object); + + var sqBindings = testSubject.GetServerConnectionConfiguration(); + var scBindings = testSubject.GetServerConnectionConfiguration(); + + sqBindings.Should().HaveCount(2); + scBindings.Should().HaveCount(1); + } + + [TestMethod] + public void GetServerConnectionConfiguration_CallsRepoOnce() + { + var solutionBindingRepository = CreateRepository(); + + var testSubject = CreateTestSubject(solutionBindingRepository.Object); + + _ = testSubject.GetServerConnectionConfiguration(); + _ = testSubject.GetServerConnectionConfiguration(); + + solutionBindingRepository.Verify(sbr => sbr.List(), Times.Once()); + solutionBindingRepository.VerifyNoOtherCalls(); + } + + [TestMethod] + public void GetServerConnectionConfiguration_ThrowsOnUIThread() + { + var threadHandling = new Mock(); + + var testSubject = CreateTestSubject(threadHandling: threadHandling.Object); + + _ = testSubject.GetServerConnectionConfiguration(); + + threadHandling.Verify(th => th.ThrowIfOnUIThread(), Times.Once); + threadHandling.VerifyNoOtherCalls(); + } + + private static ServerConnectionConfigurationProvider CreateTestSubject(ISolutionBindingRepository solutionBindingRepository = null, IThreadHandling threadHandling = null) + { + solutionBindingRepository ??= CreateRepository().Object; + threadHandling ??= Mock.Of(); + var connectionIdHelper = CreateConnectionIdHelper().Object; + + return new ServerConnectionConfigurationProvider(solutionBindingRepository, threadHandling, connectionIdHelper); + } + + private static Mock CreateRepository(params BoundSonarQubeProject[] projects) + { + var solutionBindingRepository = new Mock(); + solutionBindingRepository.Setup(sbr => sbr.List()).Returns(projects); + return solutionBindingRepository; + } + + private static Mock CreateConnectionIdHelper() + { + var connectionIdHelper = new Mock(); + connectionIdHelper.Setup(c => c.GetConnectionIdFromUri(It.IsAny(), It.IsAny())).Returns((Uri uri, string organization) => new ConnectionIdHelper().GetConnectionIdFromUri(uri, organization)); + return connectionIdHelper; + } + + private BoundSonarQubeProject CreateBoundSonarQubeProject(string serverUriString, string organisationKey = null) + { + var serverUri = new Uri(serverUriString); + //To make sure if the organisation is null program do not break + var organization = organisationKey is not null ? new SonarQubeOrganization(organisationKey, null) : null; + + return new BoundSonarQubeProject { ServerUri = serverUri, Organization = organization }; + } + } +} diff --git a/src/ConnectedMode/Binding/IServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/IServerConnectionConfigurationProvider.cs new file mode 100644 index 0000000000..b68b6a92dc --- /dev/null +++ b/src/ConnectedMode/Binding/IServerConnectionConfigurationProvider.cs @@ -0,0 +1,30 @@ +/* + * SonarLint for Visual Studio + * Copyright (C) 2016-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +using System.Collections.Generic; +using SonarLint.VisualStudio.SLCore.Service.Connection.Models; + +namespace SonarLint.VisualStudio.ConnectedMode.Binding +{ + public interface IServerConnectionConfigurationProvider + { + IEnumerable GetServerConnectionConfiguration() where T : ServerConnectionConfiguration; + } +} diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs new file mode 100644 index 0000000000..5ed05bd188 --- /dev/null +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -0,0 +1,111 @@ +/* + * SonarLint for Visual Studio + * Copyright (C) 2016-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Linq; +using SonarLint.VisualStudio.ConnectedMode.Persistence; +using SonarLint.VisualStudio.Core; +using SonarLint.VisualStudio.Core.Binding; +using SonarLint.VisualStudio.Infrastructure.VS; +using SonarLint.VisualStudio.SLCore.Common.Helpers; +using SonarLint.VisualStudio.SLCore.Service.Connection.Models; + +namespace SonarLint.VisualStudio.ConnectedMode.Binding +{ + [Export(typeof(IBoundConnectionInfoProvider))] + [PartCreationPolicy(CreationPolicy.Shared)] + internal class ServerConnectionConfigurationProvider : IServerConnectionConfigurationProvider + { + private readonly ISolutionBindingRepository solutionBindingRepository; + private readonly IThreadHandling threadHandling; + private readonly IConnectionIdHelper connectionIdHelper; + + private List bindingList = null; + + [ImportingConstructor] + public ServerConnectionConfigurationProvider(ISolutionBindingRepository solutionBindingRepository) + : this(solutionBindingRepository, ThreadHandling.Instance, new ConnectionIdHelper()) + { + } + + internal ServerConnectionConfigurationProvider(ISolutionBindingRepository solutionBindingRepository, IThreadHandling threadHandling, IConnectionIdHelper connectionIdHelper) + { + this.solutionBindingRepository = solutionBindingRepository; + this.threadHandling = threadHandling; + this.connectionIdHelper = connectionIdHelper; + } + + public IEnumerable GetServerConnectionConfiguration() where T : ServerConnectionConfiguration + { + if (bindingList == null) { InitBindingList(); } + + return bindingList.Where(bl => bl is T).Select(bl => (T)bl); + } + + private void InitBindingList() + { + threadHandling.ThrowIfOnUIThread(); + + bindingList = new List(); + + var bindings = solutionBindingRepository.List().Distinct(new BoundSonarQubeProjectUriComparer()); + + foreach (var binding in bindings) + { + var connectionID = connectionIdHelper.GetConnectionIdFromUri(binding.ServerUri, binding.Organization?.Key); + + if (binding.ServerUri == ConnectionIdHelper.SonarCloudUri) + { + bindingList.Add(new SonarCloudConnectionConfigurationDto(connectionID, true, binding.Organization?.Key)); + } + else + { + bindingList.Add(new SonarQubeConnectionConfigurationDto(connectionID, true, binding.ServerUri.ToString())); + } + } + } + + private class BoundSonarQubeProjectUriComparer : IEqualityComparer + { + public bool Equals(BoundSonarQubeProject x, BoundSonarQubeProject y) + { + if (ReferenceEquals(x, y)) + { + return true; + } + + if (x == null && y == null) { return true; } + + if (x == null ^ y == null) + { + return false; + } + + return x.ServerUri == y.ServerUri; + } + + public int GetHashCode(BoundSonarQubeProject obj) + { + return obj.ServerUri.GetHashCode(); + } + } + } +} diff --git a/src/SLCore/Common/Helpers/ConnectionIdHelper.cs b/src/SLCore/Common/Helpers/ConnectionIdHelper.cs index 3168acaa68..f27f5bf0e7 100644 --- a/src/SLCore/Common/Helpers/ConnectionIdHelper.cs +++ b/src/SLCore/Common/Helpers/ConnectionIdHelper.cs @@ -22,18 +22,18 @@ namespace SonarLint.VisualStudio.SLCore.Common.Helpers { - internal interface IConnectionIdHelper + public interface IConnectionIdHelper { Uri GetUriFromConnectionId(string connectionId); string GetConnectionIdFromUri(Uri uri, string organisation); } - internal class ConnectionIdHelper : IConnectionIdHelper + public class ConnectionIdHelper : IConnectionIdHelper { private const string SonarCloudPrefix = "sc|"; private const string SonarQubePrefix = "sq|"; - private static readonly Uri SonarCloudUri = new Uri("https://sonarcloud.io"); + public static readonly Uri SonarCloudUri = new Uri("https://sonarcloud.io"); public string GetConnectionIdFromUri(Uri uri, string organisation) { From 87605498eccbad9b091133725a4bb05a3957e2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Tue, 20 Feb 2024 13:39:30 +0100 Subject: [PATCH 03/11] fixed issues --- .../Binding/BindingInfoProviderTests.cs | 133 ------------------ .../Binding/BoundConnectionInfoProvider.cs | 73 ---------- .../Binding/IBoundConnectionInfoProvider.cs | 32 ----- .../ServerConnectionConfigurationProvider.cs | 8 +- 4 files changed, 5 insertions(+), 241 deletions(-) delete mode 100644 src/ConnectedMode.UnitTests/Binding/BindingInfoProviderTests.cs delete mode 100644 src/ConnectedMode/Binding/BoundConnectionInfoProvider.cs delete mode 100644 src/ConnectedMode/Binding/IBoundConnectionInfoProvider.cs diff --git a/src/ConnectedMode.UnitTests/Binding/BindingInfoProviderTests.cs b/src/ConnectedMode.UnitTests/Binding/BindingInfoProviderTests.cs deleted file mode 100644 index 32cea840fd..0000000000 --- a/src/ConnectedMode.UnitTests/Binding/BindingInfoProviderTests.cs +++ /dev/null @@ -1,133 +0,0 @@ -/* - * SonarLint for Visual Studio - * Copyright (C) 2016-2024 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -using System; -using System.Linq; -using SonarLint.VisualStudio.ConnectedMode.Binding; -using SonarLint.VisualStudio.ConnectedMode.Persistence; -using SonarLint.VisualStudio.Core; -using SonarLint.VisualStudio.Core.Binding; -using SonarLint.VisualStudio.TestInfrastructure; -using SonarQube.Client.Models; - -namespace SonarLint.VisualStudio.ConnectedMode.UnitTests.Binding -{ - [TestClass] - public class BindingInfoProviderTests - { - [TestMethod] - public void MefCtor_CheckIsExported() - { - MefTestHelpers.CheckTypeCanBeImported( - MefTestHelpers.CreateExport()); - } - - [TestMethod] - public void MefCtor_CheckIsSingleton() - { - MefTestHelpers.CheckIsSingletonMefComponent(); - } - - [TestMethod] - public void GetExistingBindings_NoBindings_ReturnsEmpty() - { - var testSubject = CreateTestSubject(); - - var result = testSubject.GetExistingBindings(); - - result.Should().BeEmpty(); - } - - [TestMethod] - public void GetExistingBindings_MakeSureCallInBackground() - { - var threadHandling = new Mock(); - - var testSubject = CreateTestSubject(threadHandling: threadHandling.Object); - - _ = testSubject.GetExistingBindings(); - - threadHandling.Verify(t => t.ThrowIfOnUIThread(), Times.Once()); - threadHandling.VerifyNoOtherCalls(); - } - - [TestMethod] - public void GetExistingBindings_HaveBindings_ReturnsBinding() - { - var solutionBindingRepository = new Mock(); - - var binding1 = CreateBoundSonarQubeProject("https://sonarqube.somedomain.com", null, "projectKey1"); - var binding2 = CreateBoundSonarQubeProject("https://sonarcloud.io", "organisation", "projectKey2"); - - var bindings = new[] { binding1, binding2 }; - - solutionBindingRepository.Setup(sbr => sbr.List()).Returns(bindings); - - var testSubject = CreateTestSubject(solutionBindingRepository: solutionBindingRepository.Object); - - var result = testSubject.GetExistingBindings().ToList(); - - result.Should().HaveCount(2); - result[0].ServerUri.ToString().Should().Be("https://sonarqube.somedomain.com/"); - result[0].Organization.Should().BeNull(); - result[1].ServerUri.ToString().Should().Be("https://sonarcloud.io/"); - result[1].Organization.Should().Be("organisation"); - } - - [TestMethod] - public void GetExistingBindings_SameBindingMultipleTime_ReturnsDistinct() - { - var solutionBindingRepository = new Mock(); - - var binding1 = CreateBoundSonarQubeProject("https://sonarqube.somedomain.com", null, "projectKey1"); - var binding2 = CreateBoundSonarQubeProject("https://sonarqube.somedomain.com", null, "projectKey2"); - - var bindings = new[] { binding1, binding2 }; - - solutionBindingRepository.Setup(sbr => sbr.List()).Returns(bindings); - - var testSubject = CreateTestSubject(solutionBindingRepository: solutionBindingRepository.Object); - - var result = testSubject.GetExistingBindings(); - - result.Should().HaveCount(1); - } - - private static BoundConnectionInfoProvider CreateTestSubject(ISolutionBindingRepository solutionBindingRepository = null, IThreadHandling threadHandling = null) - { - solutionBindingRepository ??= Mock.Of(); - threadHandling ??= new NoOpThreadHandler(); - - var testSubject = new BoundConnectionInfoProvider(solutionBindingRepository, threadHandling); - return testSubject; - } - - private static BoundSonarQubeProject CreateBoundSonarQubeProject(string uri, string organizationKey, string projectKey) - { - var organization = CreateOrganization(organizationKey); - - var serverUri = new Uri(uri); - - return new BoundSonarQubeProject(serverUri, projectKey, null, organization: organization); - } - - private static SonarQubeOrganization CreateOrganization(string organizationKey) => organizationKey == null ? null : new SonarQubeOrganization(organizationKey, null); - } -} diff --git a/src/ConnectedMode/Binding/BoundConnectionInfoProvider.cs b/src/ConnectedMode/Binding/BoundConnectionInfoProvider.cs deleted file mode 100644 index 487513e415..0000000000 --- a/src/ConnectedMode/Binding/BoundConnectionInfoProvider.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * SonarLint for Visual Studio - * Copyright (C) 2016-2024 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -using System.Collections.Generic; -using System.ComponentModel.Composition; -using System.Linq; -using SonarLint.VisualStudio.ConnectedMode.Persistence; -using SonarLint.VisualStudio.Core; -using SonarLint.VisualStudio.Core.Binding; -using SonarLint.VisualStudio.Infrastructure.VS; - -namespace SonarLint.VisualStudio.ConnectedMode.Binding -{ - [Export(typeof(IBoundConnectionInfoProvider))] - [PartCreationPolicy(CreationPolicy.Shared)] - internal class BoundConnectionInfoProvider : IBoundConnectionInfoProvider - { - private readonly ISolutionBindingRepository solutionBindingRepository; - private readonly IThreadHandling threadHandling; - - [ImportingConstructor] - public BoundConnectionInfoProvider(ISolutionBindingRepository solutionBindingRepository) - : this(solutionBindingRepository, ThreadHandling.Instance) - { - } - - internal BoundConnectionInfoProvider(ISolutionBindingRepository solutionBindingRepository, IThreadHandling threadHandling) - { - this.solutionBindingRepository = solutionBindingRepository; - this.threadHandling = threadHandling; - } - - public IEnumerable GetExistingBindings() - { - threadHandling.ThrowIfOnUIThread(); - - var result = new List(); - - var bindings = solutionBindingRepository.List(); - - foreach (var binding in bindings) - { - result.Add(ConvertToBindingInfo(binding)); - } - - return result.Distinct(new BoundConnectionInfoUriComparer()); - } - - private BoundConnectionInfo ConvertToBindingInfo(BoundSonarQubeProject boundSonarQubeProject) - => new BoundConnectionInfo - { - Organization = boundSonarQubeProject.Organization?.Key, - ServerUri = boundSonarQubeProject.ServerUri - }; - } -} diff --git a/src/ConnectedMode/Binding/IBoundConnectionInfoProvider.cs b/src/ConnectedMode/Binding/IBoundConnectionInfoProvider.cs deleted file mode 100644 index 2cddf7a4eb..0000000000 --- a/src/ConnectedMode/Binding/IBoundConnectionInfoProvider.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarLint for Visual Studio - * Copyright (C) 2016-2024 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -using System.Collections.Generic; - -namespace SonarLint.VisualStudio.ConnectedMode.Binding -{ - public interface IBoundConnectionInfoProvider - { - /// - /// Lists all bindings that have been saved locally - /// - IEnumerable GetExistingBindings(); - } -} diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs index 5ed05bd188..bcd92cd6aa 100644 --- a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -20,6 +20,7 @@ using System.Collections.Generic; using System.ComponentModel.Composition; +using System.Diagnostics.CodeAnalysis; using System.Linq; using SonarLint.VisualStudio.ConnectedMode.Persistence; using SonarLint.VisualStudio.Core; @@ -30,7 +31,7 @@ namespace SonarLint.VisualStudio.ConnectedMode.Binding { - [Export(typeof(IBoundConnectionInfoProvider))] + [Export(typeof(IServerConnectionConfigurationProvider))] [PartCreationPolicy(CreationPolicy.Shared)] internal class ServerConnectionConfigurationProvider : IServerConnectionConfigurationProvider { @@ -41,6 +42,7 @@ internal class ServerConnectionConfigurationProvider : IServerConnectionConfigur private List bindingList = null; [ImportingConstructor] + [ExcludeFromCodeCoverage] public ServerConnectionConfigurationProvider(ISolutionBindingRepository solutionBindingRepository) : this(solutionBindingRepository, ThreadHandling.Instance, new ConnectionIdHelper()) { @@ -57,7 +59,7 @@ public IEnumerable GetServerConnectionConfiguration() where T : ServerConn { if (bindingList == null) { InitBindingList(); } - return bindingList.Where(bl => bl is T).Select(bl => (T)bl); + return bindingList.OfType().Select(bl => (T)bl); } private void InitBindingList() @@ -83,7 +85,7 @@ private void InitBindingList() } } - private class BoundSonarQubeProjectUriComparer : IEqualityComparer + private sealed class BoundSonarQubeProjectUriComparer : IEqualityComparer { public bool Equals(BoundSonarQubeProject x, BoundSonarQubeProject y) { From ce6fc3567ef12e850dd6b0db95f65477eca69645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Tue, 20 Feb 2024 13:53:37 +0100 Subject: [PATCH 04/11] remove redundant cast --- .../Binding/ServerConnectionConfigurationProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs index bcd92cd6aa..dceea9af79 100644 --- a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -59,7 +59,7 @@ public IEnumerable GetServerConnectionConfiguration() where T : ServerConn { if (bindingList == null) { InitBindingList(); } - return bindingList.OfType().Select(bl => (T)bl); + return bindingList.OfType(); } private void InitBindingList() From 27606437c74c97158b10cd3595eafc4da04fdca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Tue, 20 Feb 2024 15:12:49 +0100 Subject: [PATCH 05/11] removed caching --- .../ServerConnectionConfigurationProviderTests.cs | 14 -------------- .../ServerConnectionConfigurationProvider.cs | 13 +++---------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs b/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs index 58e73badde..8558bdd5fb 100644 --- a/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs +++ b/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs @@ -106,20 +106,6 @@ public void GetServerConnectionConfiguration_HaveMultipleBindingWithSameUri_Aggr scBindings.Should().HaveCount(1); } - [TestMethod] - public void GetServerConnectionConfiguration_CallsRepoOnce() - { - var solutionBindingRepository = CreateRepository(); - - var testSubject = CreateTestSubject(solutionBindingRepository.Object); - - _ = testSubject.GetServerConnectionConfiguration(); - _ = testSubject.GetServerConnectionConfiguration(); - - solutionBindingRepository.Verify(sbr => sbr.List(), Times.Once()); - solutionBindingRepository.VerifyNoOtherCalls(); - } - [TestMethod] public void GetServerConnectionConfiguration_ThrowsOnUIThread() { diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs index dceea9af79..c67263e42a 100644 --- a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -39,8 +39,6 @@ internal class ServerConnectionConfigurationProvider : IServerConnectionConfigur private readonly IThreadHandling threadHandling; private readonly IConnectionIdHelper connectionIdHelper; - private List bindingList = null; - [ImportingConstructor] [ExcludeFromCodeCoverage] public ServerConnectionConfigurationProvider(ISolutionBindingRepository solutionBindingRepository) @@ -56,17 +54,10 @@ internal ServerConnectionConfigurationProvider(ISolutionBindingRepository soluti } public IEnumerable GetServerConnectionConfiguration() where T : ServerConnectionConfiguration - { - if (bindingList == null) { InitBindingList(); } - - return bindingList.OfType(); - } - - private void InitBindingList() { threadHandling.ThrowIfOnUIThread(); - bindingList = new List(); + var bindingList = new List(); var bindings = solutionBindingRepository.List().Distinct(new BoundSonarQubeProjectUriComparer()); @@ -83,6 +74,8 @@ private void InitBindingList() bindingList.Add(new SonarQubeConnectionConfigurationDto(connectionID, true, binding.ServerUri.ToString())); } } + + return bindingList.OfType(); } private sealed class BoundSonarQubeProjectUriComparer : IEqualityComparer From 2b817f915312977454ce3ba3592c0c8cc3f7f91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Tue, 20 Feb 2024 15:53:38 +0100 Subject: [PATCH 06/11] cosmetic changes also realised no need to check null == null --- .../Binding/ServerConnectionConfigurationProvider.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs index c67263e42a..b2ea30d593 100644 --- a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -87,9 +87,8 @@ public bool Equals(BoundSonarQubeProject x, BoundSonarQubeProject y) return true; } - if (x == null && y == null) { return true; } - - if (x == null ^ y == null) + //XOR: it's true only when one of them is true + if (x is null ^ y is null) { return false; } From ba91423b47ffab4d5e1020434e811a2ed3f3105f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:05:58 +0100 Subject: [PATCH 07/11] added null check --- .../Binding/ServerConnectionConfigurationProvider.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs index b2ea30d593..c7aad319f7 100644 --- a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -87,7 +87,11 @@ public bool Equals(BoundSonarQubeProject x, BoundSonarQubeProject y) return true; } - //XOR: it's true only when one of them is true + if (x is null && y is null) + { + return true; + } + //XOR it's true only when one of them is true if (x is null ^ y is null) { return false; From 562d55a8dc5d23b6f5a149adbdcb6a6565853fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:33:49 +0100 Subject: [PATCH 08/11] changed to OR --- .../Binding/ServerConnectionConfigurationProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs index c7aad319f7..2cab6a3e39 100644 --- a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -91,8 +91,8 @@ public bool Equals(BoundSonarQubeProject x, BoundSonarQubeProject y) { return true; } - //XOR it's true only when one of them is true - if (x is null ^ y is null) + + if (x is null || y is null) { return false; } From 9c80ba1b2806a9e684a4d8205c7116ec6ce6ec55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:38:13 +0100 Subject: [PATCH 09/11] equals --- .../Binding/ServerConnectionConfigurationProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs index 2cab6a3e39..a8750219f1 100644 --- a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -97,7 +97,7 @@ public bool Equals(BoundSonarQubeProject x, BoundSonarQubeProject y) return false; } - return x.ServerUri == y.ServerUri; + return x.ServerUri.Equals(y.ServerUri); } public int GetHashCode(BoundSonarQubeProject obj) From 8229d0aa456d4747c0a9c5b183218bbdbf812365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:08:18 +0100 Subject: [PATCH 10/11] Added MEF tests --- .../ServerConnectionConfigurationProviderTests.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs b/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs index 8558bdd5fb..56dffd5700 100644 --- a/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs +++ b/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs @@ -26,6 +26,7 @@ using SonarLint.VisualStudio.Core.Binding; using SonarLint.VisualStudio.SLCore.Common.Helpers; using SonarLint.VisualStudio.SLCore.Service.Connection.Models; +using SonarLint.VisualStudio.TestInfrastructure; using SonarQube.Client.Models; namespace SonarLint.VisualStudio.ConnectedMode.UnitTests.Binding @@ -33,6 +34,19 @@ namespace SonarLint.VisualStudio.ConnectedMode.UnitTests.Binding [TestClass] public class ServerConnectionConfigurationProviderTests { + [TestMethod] + public void MefCtor_CheckIsExported() + { + MefTestHelpers.CheckTypeCanBeImported( + MefTestHelpers.CreateExport()); + } + + [TestMethod] + public void MefCtor_CheckIsSingleton() + { + MefTestHelpers.CheckIsSingletonMefComponent(); + } + [TestMethod] public void GetServerConnectionConfiguration_ConvertsSQBindindCorrectly() { From 3e2947f9df67b6e010cdd53f8c9049122c518ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fra=C5=9F=20Erg=C3=BCn?= <96827714+ugras-ergun-sonarsource@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:17:42 +0100 Subject: [PATCH 11/11] removed generics --- .../ServerConnectionConfigurationProviderTests.cs | 14 +++++++------- .../IServerConnectionConfigurationProvider.cs | 2 +- .../ServerConnectionConfigurationProvider.cs | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs b/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs index 56dffd5700..a62d4168c8 100644 --- a/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs +++ b/src/ConnectedMode.UnitTests/Binding/ServerConnectionConfigurationProviderTests.cs @@ -56,7 +56,7 @@ public void GetServerConnectionConfiguration_ConvertsSQBindindCorrectly() var testSubject = CreateTestSubject(solutionBindingRepository.Object); - var bindings = testSubject.GetServerConnectionConfiguration().ToList(); + var bindings = testSubject.GetServerConnectionConfiguration().OfType().ToList(); bindings.Should().HaveCount(1); bindings[0].connectionId.Should().Be("sq|http://someuri.com/"); @@ -73,7 +73,7 @@ public void GetServerConnectionConfiguration_ConvertsSCBindindCorrectly() var testSubject = CreateTestSubject(solutionBindingRepository.Object); - var bindings = testSubject.GetServerConnectionConfiguration().ToList(); + var bindings = testSubject.GetServerConnectionConfiguration().OfType().ToList(); bindings.Should().HaveCount(1); bindings[0].connectionId.Should().Be("sc|org"); @@ -93,8 +93,8 @@ public void GetServerConnectionConfiguration_HaveBothSQAndSC_ReturnsCorrectly() var testSubject = CreateTestSubject(solutionBindingRepository.Object); - var sqBindings = testSubject.GetServerConnectionConfiguration(); - var scBindings = testSubject.GetServerConnectionConfiguration(); + var sqBindings = testSubject.GetServerConnectionConfiguration().OfType(); + var scBindings = testSubject.GetServerConnectionConfiguration().OfType(); sqBindings.Should().HaveCount(3); scBindings.Should().HaveCount(1); @@ -113,8 +113,8 @@ public void GetServerConnectionConfiguration_HaveMultipleBindingWithSameUri_Aggr var testSubject = CreateTestSubject(solutionBindingRepository.Object); - var sqBindings = testSubject.GetServerConnectionConfiguration(); - var scBindings = testSubject.GetServerConnectionConfiguration(); + var sqBindings = testSubject.GetServerConnectionConfiguration().OfType(); + var scBindings = testSubject.GetServerConnectionConfiguration().OfType(); sqBindings.Should().HaveCount(2); scBindings.Should().HaveCount(1); @@ -127,7 +127,7 @@ public void GetServerConnectionConfiguration_ThrowsOnUIThread() var testSubject = CreateTestSubject(threadHandling: threadHandling.Object); - _ = testSubject.GetServerConnectionConfiguration(); + _ = testSubject.GetServerConnectionConfiguration(); threadHandling.Verify(th => th.ThrowIfOnUIThread(), Times.Once); threadHandling.VerifyNoOtherCalls(); diff --git a/src/ConnectedMode/Binding/IServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/IServerConnectionConfigurationProvider.cs index b68b6a92dc..1e021681dd 100644 --- a/src/ConnectedMode/Binding/IServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/IServerConnectionConfigurationProvider.cs @@ -25,6 +25,6 @@ namespace SonarLint.VisualStudio.ConnectedMode.Binding { public interface IServerConnectionConfigurationProvider { - IEnumerable GetServerConnectionConfiguration() where T : ServerConnectionConfiguration; + IEnumerable GetServerConnectionConfiguration(); } } diff --git a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs index a8750219f1..3b9d62c830 100644 --- a/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs +++ b/src/ConnectedMode/Binding/ServerConnectionConfigurationProvider.cs @@ -53,7 +53,7 @@ internal ServerConnectionConfigurationProvider(ISolutionBindingRepository soluti this.connectionIdHelper = connectionIdHelper; } - public IEnumerable GetServerConnectionConfiguration() where T : ServerConnectionConfiguration + public IEnumerable GetServerConnectionConfiguration() { threadHandling.ThrowIfOnUIThread(); @@ -75,7 +75,7 @@ public IEnumerable GetServerConnectionConfiguration() where T : ServerConn } } - return bindingList.OfType(); + return bindingList; } private sealed class BoundSonarQubeProjectUriComparer : IEqualityComparer