From ed6da0e15d9de2411e786e8feabf1d4f17f9fd5a Mon Sep 17 00:00:00 2001 From: Abdelrahman Shawki Hassan Date: Tue, 26 Nov 2024 20:05:14 +0100 Subject: [PATCH] refactor: delete common project --- Snyk.Common/FileUtil.cs | 40 ------ Snyk.Common/Properties/AssemblyInfo.cs | 36 ----- Snyk.Common/Service/SnykUser.cs | 27 ---- Snyk.Common/Snyk.Common.csproj | 124 ------------------ Snyk.Common/SnykAppSettings.cs | 23 ---- Snyk.Common/appsettings.development.json | 6 - Snyk.Common/appsettings.json | 6 - .../Analytics/AnalyticsSender.cs | 1 + .../Authentication/AuthenticationToken.cs | 2 +- .../Authentication/AuthenticationType.cs | 2 +- .../Authentication/OAuthToken.cs | 7 +- .../CLI/SnykCli.cs | 2 + .../Commands/SnykScanCommand.cs | 2 +- .../Download}/Sha256.cs | 12 +- .../Download/SnykCliDownloader.cs | 1 + .../Extension}/CollectionExtensions.cs | 8 +- .../Extension}/StringExtensions.cs | 8 +- .../Language/CustomInitializationOptions.cs | 4 +- .../Language/SnykLanguageClient.cs | 8 +- .../SnykLanguageClientCustomTarget.cs | 3 +- .../LocalCodeEngine.cs | 2 +- .../LogManager.cs | 2 +- .../ManualAssemblyResolver.cs | 14 +- .../SastSettings.cs | 3 +- .../Service/ApiEndpointResolver.cs | 7 +- .../Service/FeatureFlagService.cs | 2 + .../Service}/ISolutionService.cs | 8 +- .../Service/SnykSolutionService.cs | 1 + .../Settings/ISnykOptions.cs | 10 +- .../Settings/SnykGeneralOptionsDialogPage.cs | 7 +- .../SnykGeneralSettingsUserControl.cs | 7 +- .../Settings/SnykSettings.cs | 2 +- .../Settings/SnykSettingsChangedEventArgs.cs | 0 .../Settings/SnykSettingsLoader.cs | 1 + .../SnykUserStorageSettingsService.cs | 6 +- .../Snyk.VisualStudio.Extension.2022.csproj | 47 +++++-- .../SnykWebClient.cs | 6 +- .../UI/Notifications/NotificationService.cs | 1 + .../VsStatusBarNotificationService.cs | 1 + .../Toolwindow/SnykToolWindowControl.xaml.cs | 4 + .../UI/Tree/SnykFilterableTree.xaml.cs | 1 + .../Utils}/Json.cs | 8 +- .../Utils}/SnykDirectory.cs | 8 +- .../Utils}/SnykExtension.cs | 44 +------ .../SnykCliDownloaderTest.cs | 1 + snyk-visual-studio-plugin.sln | 6 - 46 files changed, 137 insertions(+), 384 deletions(-) delete mode 100644 Snyk.Common/FileUtil.cs delete mode 100644 Snyk.Common/Properties/AssemblyInfo.cs delete mode 100644 Snyk.Common/Service/SnykUser.cs delete mode 100644 Snyk.Common/Snyk.Common.csproj delete mode 100644 Snyk.Common/SnykAppSettings.cs delete mode 100644 Snyk.Common/appsettings.development.json delete mode 100644 Snyk.Common/appsettings.json rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/Authentication/AuthenticationToken.cs (97%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/Authentication/AuthenticationType.cs (79%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/Authentication/OAuthToken.cs (90%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022/Download}/Sha256.cs (91%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022/Extension}/CollectionExtensions.cs (83%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022/Extension}/StringExtensions.cs (95%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/LocalCodeEngine.cs (93%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/LogManager.cs (98%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/SastSettings.cs (95%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/Service/ApiEndpointResolver.cs (94%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022/Service}/ISolutionService.cs (93%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/Settings/ISnykOptions.cs (93%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/Settings/SnykSettingsChangedEventArgs.cs (100%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022}/SnykWebClient.cs (91%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022/Utils}/Json.cs (92%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022/Utils}/SnykDirectory.cs (90%) rename {Snyk.Common => Snyk.VisualStudio.Extension.2022/Utils}/SnykExtension.cs (63%) diff --git a/Snyk.Common/FileUtil.cs b/Snyk.Common/FileUtil.cs deleted file mode 100644 index 0dc716431..000000000 --- a/Snyk.Common/FileUtil.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace Snyk.Common -{ - using System.Collections.Generic; - using System.IO; - - /// - /// Common util methods for files. - /// - public class FileUtil - { - /// - /// Convert absolute file path list to list with relative file paths. - /// - /// Root directory path. - /// List with absolute file paths. - /// Result list with relative file paths. - public static IEnumerable GetRelativeFilePaths(string rootPath, IEnumerable files) - { - IList relateFilePaths = new List(); - - foreach (string fileFullPath in files) - { - relateFilePaths.Add(GetRelativeFilePath(rootPath, fileFullPath)); - } - - return relateFilePaths; - } - - /// - /// Convert absolute file path to relative file path. - /// - /// Root directory path. - /// Source absolute file path string. - /// Result string relative path. - public static string GetRelativeFilePath(string rootPath, string filePath) => - filePath - .Replace(rootPath, string.Empty) - .Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - } -} diff --git a/Snyk.Common/Properties/AssemblyInfo.cs b/Snyk.Common/Properties/AssemblyInfo.cs deleted file mode 100644 index ebdf12811..000000000 --- a/Snyk.Common/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Snyk.Common")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Snyk.Common")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7912ad6d-c154-4504-9ab3-8767d3c46e89")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Snyk.Common/Service/SnykUser.cs b/Snyk.Common/Service/SnykUser.cs deleted file mode 100644 index 71cac2524..000000000 --- a/Snyk.Common/Service/SnykUser.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Snyk.Common.Service -{ - /// - /// User for Snyk Analytics. - /// - public class SnykUser - { - /// - /// Gets or sets the user ID. - /// - public string Id { get; set; } - - private string idHash = string.Empty; - public string IdHash - { - get - { - if (string.IsNullOrEmpty(idHash) && !string.IsNullOrEmpty(Id)) - { - idHash = Sha256.ComputeHash(Id); - } - - return idHash; - } - } - } -} diff --git a/Snyk.Common/Snyk.Common.csproj b/Snyk.Common/Snyk.Common.csproj deleted file mode 100644 index e9e4c407c..000000000 --- a/Snyk.Common/Snyk.Common.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Debug - AnyCPU - {7912AD6D-C154-4504-9AB3-8767D3C46E89} - Library - Properties - Snyk.Common - Snyk.Common - v4.7.2 - 512 - true - - - - - appsettings.json - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - latest - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - latest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - - - PreserveNewest - - - - - 5.0.3 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 16.10.10 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 16.10.56 - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - 13.0.1 - - - 2.0.2 - - - 3.1.0 - - - 8.4.0 - - - 7.0.0 - - - 5.0.0 - - - 0.15.0 - - - - - \ No newline at end of file diff --git a/Snyk.Common/SnykAppSettings.cs b/Snyk.Common/SnykAppSettings.cs deleted file mode 100644 index 8125a5060..000000000 --- a/Snyk.Common/SnykAppSettings.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Snyk.Common -{ - /// - /// Snyk application settings. - /// - public class SnykAppSettings - { - /// - /// Gets or sets a value indicating whether Analytics write key. - /// - public string SegmentAnalyticsWriteKey { get; set; } - - /// - /// Gets or sets a value indicating Snyk Sentry DSN. - /// - public string SentryDsn { get; set; } - - /// - /// Gets or sets a value indicating Snyk Sentry Environment. - /// - public string Environment { get; set; } - } -} \ No newline at end of file diff --git a/Snyk.Common/appsettings.development.json b/Snyk.Common/appsettings.development.json deleted file mode 100644 index 241a87017..000000000 --- a/Snyk.Common/appsettings.development.json +++ /dev/null @@ -1,6 +0,0 @@ -{ -"SegmentAnalyticsWriteKey": "", -"SnykCodeApiEndpointUrl": "", -"SentryDsn": "", -"Environment": "" -} diff --git a/Snyk.Common/appsettings.json b/Snyk.Common/appsettings.json deleted file mode 100644 index 241a87017..000000000 --- a/Snyk.Common/appsettings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ -"SegmentAnalyticsWriteKey": "", -"SnykCodeApiEndpointUrl": "", -"SentryDsn": "", -"Environment": "" -} diff --git a/Snyk.VisualStudio.Extension.2022/Analytics/AnalyticsSender.cs b/Snyk.VisualStudio.Extension.2022/Analytics/AnalyticsSender.cs index 966a3a631..4d90f9a6f 100644 --- a/Snyk.VisualStudio.Extension.2022/Analytics/AnalyticsSender.cs +++ b/Snyk.VisualStudio.Extension.2022/Analytics/AnalyticsSender.cs @@ -8,6 +8,7 @@ using Snyk.Common; using Snyk.Common.Settings; using Snyk.VisualStudio.Extension.Language; +using Snyk.VisualStudio.Extension.Settings; namespace Snyk.VisualStudio.Extension.Analytics { diff --git a/Snyk.Common/Authentication/AuthenticationToken.cs b/Snyk.VisualStudio.Extension.2022/Authentication/AuthenticationToken.cs similarity index 97% rename from Snyk.Common/Authentication/AuthenticationToken.cs rename to Snyk.VisualStudio.Extension.2022/Authentication/AuthenticationToken.cs index b5571dacf..bd5f5703e 100644 --- a/Snyk.Common/Authentication/AuthenticationToken.cs +++ b/Snyk.VisualStudio.Extension.2022/Authentication/AuthenticationToken.cs @@ -1,6 +1,6 @@ using System; -namespace Snyk.Common.Authentication +namespace Snyk.VisualStudio.Extension.Authentication { /// /// Util for AuthenticationToken strings. diff --git a/Snyk.Common/Authentication/AuthenticationType.cs b/Snyk.VisualStudio.Extension.2022/Authentication/AuthenticationType.cs similarity index 79% rename from Snyk.Common/Authentication/AuthenticationType.cs rename to Snyk.VisualStudio.Extension.2022/Authentication/AuthenticationType.cs index 3e7ad2ea5..992c90cb7 100644 --- a/Snyk.Common/Authentication/AuthenticationType.cs +++ b/Snyk.VisualStudio.Extension.2022/Authentication/AuthenticationType.cs @@ -1,6 +1,6 @@ using System.ComponentModel; -namespace Snyk.Common.Authentication +namespace Snyk.VisualStudio.Extension.Authentication { public enum AuthenticationType { diff --git a/Snyk.Common/Authentication/OAuthToken.cs b/Snyk.VisualStudio.Extension.2022/Authentication/OAuthToken.cs similarity index 90% rename from Snyk.Common/Authentication/OAuthToken.cs rename to Snyk.VisualStudio.Extension.2022/Authentication/OAuthToken.cs index 1778fc2a0..b29f75e61 100644 --- a/Snyk.Common/Authentication/OAuthToken.cs +++ b/Snyk.VisualStudio.Extension.2022/Authentication/OAuthToken.cs @@ -1,7 +1,8 @@ -using Newtonsoft.Json; +using System; +using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using System; -namespace Snyk.Common.Authentication + +namespace Snyk.VisualStudio.Extension.Authentication { [JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))] public class OAuthToken diff --git a/Snyk.VisualStudio.Extension.2022/CLI/SnykCli.cs b/Snyk.VisualStudio.Extension.2022/CLI/SnykCli.cs index 1ed681431..a539ca28f 100644 --- a/Snyk.VisualStudio.Extension.2022/CLI/SnykCli.cs +++ b/Snyk.VisualStudio.Extension.2022/CLI/SnykCli.cs @@ -2,6 +2,8 @@ using Serilog; using Snyk.Common; using Snyk.Common.Settings; +using Snyk.VisualStudio.Extension.Settings; + namespace Snyk.VisualStudio.Extension.CLI { /// diff --git a/Snyk.VisualStudio.Extension.2022/Commands/SnykScanCommand.cs b/Snyk.VisualStudio.Extension.2022/Commands/SnykScanCommand.cs index d6c6ccdb7..65dfd17c8 100644 --- a/Snyk.VisualStudio.Extension.2022/Commands/SnykScanCommand.cs +++ b/Snyk.VisualStudio.Extension.2022/Commands/SnykScanCommand.cs @@ -78,7 +78,7 @@ public override async Task UpdateStateAsync() protected override void Execute(object sender, EventArgs eventArgs) { base.Execute(sender, eventArgs); - ThreadHelper.JoinableTaskFactory.RunAsync(SnykTasksService.Instance.ScanAsync); + ThreadHelper.JoinableTaskFactory.RunAsync(SnykTasksService.Instance.ScanAsync).FireAndForget(); } /// diff --git a/Snyk.Common/Sha256.cs b/Snyk.VisualStudio.Extension.2022/Download/Sha256.cs similarity index 91% rename from Snyk.Common/Sha256.cs rename to Snyk.VisualStudio.Extension.2022/Download/Sha256.cs index 345257b09..f8f7f3c56 100644 --- a/Snyk.Common/Sha256.cs +++ b/Snyk.VisualStudio.Extension.2022/Download/Sha256.cs @@ -1,10 +1,10 @@ -namespace Snyk.Common -{ - using System; - using System.IO; - using System.Security.Cryptography; - using System.Text; +using System; +using System.IO; +using System.Security.Cryptography; +using System.Text; +namespace Snyk.VisualStudio.Extension.Download +{ /// /// Methods related to Sha256 encoding. /// diff --git a/Snyk.VisualStudio.Extension.2022/Download/SnykCliDownloader.cs b/Snyk.VisualStudio.Extension.2022/Download/SnykCliDownloader.cs index 5fb5eb30a..eecd34019 100644 --- a/Snyk.VisualStudio.Extension.2022/Download/SnykCliDownloader.cs +++ b/Snyk.VisualStudio.Extension.2022/Download/SnykCliDownloader.cs @@ -9,6 +9,7 @@ using Snyk.VisualStudio.Extension.CLI; using Snyk.VisualStudio.Extension.Language; using Snyk.VisualStudio.Extension.Service; +using Snyk.VisualStudio.Extension.Settings; using Snyk.VisualStudio.Extension.UI.Notifications; namespace Snyk.VisualStudio.Extension.Download diff --git a/Snyk.Common/CollectionExtensions.cs b/Snyk.VisualStudio.Extension.2022/Extension/CollectionExtensions.cs similarity index 83% rename from Snyk.Common/CollectionExtensions.cs rename to Snyk.VisualStudio.Extension.2022/Extension/CollectionExtensions.cs index 1e6c6749c..eb107ea43 100644 --- a/Snyk.Common/CollectionExtensions.cs +++ b/Snyk.VisualStudio.Extension.2022/Extension/CollectionExtensions.cs @@ -1,8 +1,8 @@ -namespace Snyk.Common -{ - using System.Collections.Generic; - using System.Linq; +using System.Collections.Generic; +using System.Linq; +namespace Snyk.VisualStudio.Extension.Extension +{ /// /// Common extension methods implementations. /// diff --git a/Snyk.Common/StringExtensions.cs b/Snyk.VisualStudio.Extension.2022/Extension/StringExtensions.cs similarity index 95% rename from Snyk.Common/StringExtensions.cs rename to Snyk.VisualStudio.Extension.2022/Extension/StringExtensions.cs index f2824f16a..65d6eb56c 100644 --- a/Snyk.Common/StringExtensions.cs +++ b/Snyk.VisualStudio.Extension.2022/Extension/StringExtensions.cs @@ -1,8 +1,8 @@ -namespace Snyk.Common -{ - using System; - using System.Text.RegularExpressions; +using System; +using System.Text.RegularExpressions; +namespace Snyk.VisualStudio.Extension.Extension +{ /// /// Extension methods for string class. /// diff --git a/Snyk.VisualStudio.Extension.2022/Language/CustomInitializationOptions.cs b/Snyk.VisualStudio.Extension.2022/Language/CustomInitializationOptions.cs index be34c8220..74f8136bd 100644 --- a/Snyk.VisualStudio.Extension.2022/Language/CustomInitializationOptions.cs +++ b/Snyk.VisualStudio.Extension.2022/Language/CustomInitializationOptions.cs @@ -36,8 +36,8 @@ public class SnykLsInitializationOptions public string SnykCodeApi { get; set; } public int HoverVerbosity { get; set; } public string OutputFormat { get; set; } - - public FolderConfig FolderConfigs { get; set; } + public bool EnableDeltaFindings { get; set; } + public List FolderConfigs { get; set; } } public class FolderConfig diff --git a/Snyk.VisualStudio.Extension.2022/Language/SnykLanguageClient.cs b/Snyk.VisualStudio.Extension.2022/Language/SnykLanguageClient.cs index d93e01160..473663e56 100644 --- a/Snyk.VisualStudio.Extension.2022/Language/SnykLanguageClient.cs +++ b/Snyk.VisualStudio.Extension.2022/Language/SnykLanguageClient.cs @@ -5,16 +5,16 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using System.Windows.Controls.Primitives; using Microsoft.VisualStudio.LanguageServer.Client; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Threading; using Serilog; -using Snyk.Common; -using Snyk.Common.Authentication; using Snyk.Common.Settings; using Snyk.VisualStudio.Extension.Analytics; +using Snyk.VisualStudio.Extension.Authentication; using Snyk.VisualStudio.Extension.CLI; +using Snyk.VisualStudio.Extension.Settings; +using Snyk.VisualStudio.Extension.Utils; using StreamJsonRpc; using Task = System.Threading.Tasks.Task; using LSP = Microsoft.VisualStudio.LanguageServer.Protocol; @@ -310,7 +310,7 @@ public async Task AttachForCustomMessageAsync(JsonRpc rpc) Rpc.AllowModificationWhileListening = false; IsReady = true; FireOnLanguageServerReadyAsyncEvent(); - SendPluginInstalledEvent(); + //SendPluginInstalledEvent(); } protected void OnStopping() { } diff --git a/Snyk.VisualStudio.Extension.2022/Language/SnykLanguageClientCustomTarget.cs b/Snyk.VisualStudio.Extension.2022/Language/SnykLanguageClientCustomTarget.cs index 1ac25f7c6..1211e8d6f 100644 --- a/Snyk.VisualStudio.Extension.2022/Language/SnykLanguageClientCustomTarget.cs +++ b/Snyk.VisualStudio.Extension.2022/Language/SnykLanguageClientCustomTarget.cs @@ -5,10 +5,9 @@ using System.Threading.Tasks; using Microsoft.VisualStudio.Shell; using Newtonsoft.Json.Linq; -using Snyk.Common.Authentication; +using Snyk.VisualStudio.Extension.Authentication; using Snyk.VisualStudio.Extension.Extension; using Snyk.VisualStudio.Extension.Service; -using Snyk.VisualStudio.Extension.UI.Notifications; using StreamJsonRpc; namespace Snyk.VisualStudio.Extension.Language diff --git a/Snyk.Common/LocalCodeEngine.cs b/Snyk.VisualStudio.Extension.2022/LocalCodeEngine.cs similarity index 93% rename from Snyk.Common/LocalCodeEngine.cs rename to Snyk.VisualStudio.Extension.2022/LocalCodeEngine.cs index 02448215f..b69b70133 100644 --- a/Snyk.Common/LocalCodeEngine.cs +++ b/Snyk.VisualStudio.Extension.2022/LocalCodeEngine.cs @@ -1,4 +1,4 @@ -namespace Snyk.Common +namespace Snyk.VisualStudio.Extension { /// /// Sast local code engine settings. diff --git a/Snyk.Common/LogManager.cs b/Snyk.VisualStudio.Extension.2022/LogManager.cs similarity index 98% rename from Snyk.Common/LogManager.cs rename to Snyk.VisualStudio.Extension.2022/LogManager.cs index cd32049b7..c90109c44 100644 --- a/Snyk.Common/LogManager.cs +++ b/Snyk.VisualStudio.Extension.2022/LogManager.cs @@ -5,7 +5,7 @@ using Serilog.Events; using Serilog.Exceptions; -namespace Snyk.Common +namespace Snyk.VisualStudio.Extension { /// /// Logger manager for create logger per class. diff --git a/Snyk.VisualStudio.Extension.2022/ManualAssemblyResolver.cs b/Snyk.VisualStudio.Extension.2022/ManualAssemblyResolver.cs index f78bdea07..5d00be916 100644 --- a/Snyk.VisualStudio.Extension.2022/ManualAssemblyResolver.cs +++ b/Snyk.VisualStudio.Extension.2022/ManualAssemblyResolver.cs @@ -1,11 +1,11 @@ -namespace Snyk.VisualStudio.Extension -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Reflection; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +namespace Snyk.VisualStudio.Extension +{ /// /// AssemblyResolver or Assembly loader for load dll's on VS2015 and VS2022. /// diff --git a/Snyk.Common/SastSettings.cs b/Snyk.VisualStudio.Extension.2022/SastSettings.cs similarity index 95% rename from Snyk.Common/SastSettings.cs rename to Snyk.VisualStudio.Extension.2022/SastSettings.cs index 3c9863de9..abbe69875 100644 --- a/Snyk.Common/SastSettings.cs +++ b/Snyk.VisualStudio.Extension.2022/SastSettings.cs @@ -1,8 +1,9 @@ using System.Collections.Generic; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using Snyk.Common; -namespace Snyk.Common +namespace Snyk.VisualStudio.Extension { /// /// Sast settings. diff --git a/Snyk.Common/Service/ApiEndpointResolver.cs b/Snyk.VisualStudio.Extension.2022/Service/ApiEndpointResolver.cs similarity index 94% rename from Snyk.Common/Service/ApiEndpointResolver.cs rename to Snyk.VisualStudio.Extension.2022/Service/ApiEndpointResolver.cs index 3bd61b4ba..70f77e674 100644 --- a/Snyk.Common/Service/ApiEndpointResolver.cs +++ b/Snyk.VisualStudio.Extension.2022/Service/ApiEndpointResolver.cs @@ -1,9 +1,12 @@ using System; using System.Text.RegularExpressions; -using Snyk.Common.Authentication; using Snyk.Common.Settings; +using Snyk.VisualStudio.Extension.Authentication; +using Snyk.VisualStudio.Extension.Extension; +using Snyk.VisualStudio.Extension.Settings; -namespace Snyk.Common.Service + +namespace Snyk.VisualStudio.Extension.Service { /// /// Helper class for resolve API endpoints. It's one place for all endpoint calculations. diff --git a/Snyk.VisualStudio.Extension.2022/Service/FeatureFlagService.cs b/Snyk.VisualStudio.Extension.2022/Service/FeatureFlagService.cs index 93e794ffc..797d1cf7f 100644 --- a/Snyk.VisualStudio.Extension.2022/Service/FeatureFlagService.cs +++ b/Snyk.VisualStudio.Extension.2022/Service/FeatureFlagService.cs @@ -2,7 +2,9 @@ using Serilog; using Snyk.Common; using Snyk.Common.Settings; +using Snyk.VisualStudio.Extension.Extension; using Snyk.VisualStudio.Extension.Language; +using Snyk.VisualStudio.Extension.Settings; namespace Snyk.VisualStudio.Extension.Service; diff --git a/Snyk.Common/ISolutionService.cs b/Snyk.VisualStudio.Extension.2022/Service/ISolutionService.cs similarity index 93% rename from Snyk.Common/ISolutionService.cs rename to Snyk.VisualStudio.Extension.2022/Service/ISolutionService.cs index d58658a98..5e4f0f167 100644 --- a/Snyk.Common/ISolutionService.cs +++ b/Snyk.VisualStudio.Extension.2022/Service/ISolutionService.cs @@ -1,8 +1,8 @@ -namespace Snyk.Common -{ - using System.Collections.Generic; - using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading.Tasks; +namespace Snyk.VisualStudio.Extension.Service +{ /// /// Service for solution related functionality. /// diff --git a/Snyk.VisualStudio.Extension.2022/Service/SnykSolutionService.cs b/Snyk.VisualStudio.Extension.2022/Service/SnykSolutionService.cs index a87294f0d..010c1f215 100644 --- a/Snyk.VisualStudio.Extension.2022/Service/SnykSolutionService.cs +++ b/Snyk.VisualStudio.Extension.2022/Service/SnykSolutionService.cs @@ -9,6 +9,7 @@ using Microsoft.VisualStudio.Shell.Interop; using Serilog; using Snyk.Common; +using Snyk.VisualStudio.Extension.Extension; using Task = System.Threading.Tasks.Task; using Toolkit = Community.VisualStudio.Toolkit; diff --git a/Snyk.Common/Settings/ISnykOptions.cs b/Snyk.VisualStudio.Extension.2022/Settings/ISnykOptions.cs similarity index 93% rename from Snyk.Common/Settings/ISnykOptions.cs rename to Snyk.VisualStudio.Extension.2022/Settings/ISnykOptions.cs index f650af8eb..af9e8cc1e 100644 --- a/Snyk.Common/Settings/ISnykOptions.cs +++ b/Snyk.VisualStudio.Extension.2022/Settings/ISnykOptions.cs @@ -1,9 +1,11 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Snyk.Common.Authentication; +using Snyk.Common.Settings; +using Snyk.VisualStudio.Extension.Authentication; +using Snyk.VisualStudio.Extension.Language; -namespace Snyk.Common.Settings +namespace Snyk.VisualStudio.Extension.Settings { /// /// Interface for Snyk Options/Settings in Visual Studio. @@ -82,6 +84,10 @@ public interface ISnykOptions string CliReleaseChannel { get; set; } string CliDownloadUrl { get; set; } ISet TrustedFolders { get; set; } + + public bool EnableDeltaFindings { get; set; } + public List FolderConfigs { get; set; } + /// /// Settings changed event. /// diff --git a/Snyk.VisualStudio.Extension.2022/Settings/SnykGeneralOptionsDialogPage.cs b/Snyk.VisualStudio.Extension.2022/Settings/SnykGeneralOptionsDialogPage.cs index cb4b521cb..7cfa32fc9 100644 --- a/Snyk.VisualStudio.Extension.2022/Settings/SnykGeneralOptionsDialogPage.cs +++ b/Snyk.VisualStudio.Extension.2022/Settings/SnykGeneralOptionsDialogPage.cs @@ -6,10 +6,8 @@ using System.Windows.Forms; using Microsoft.VisualStudio.Shell; using Serilog; -using Snyk.Common; -using Snyk.Common.Authentication; -using Snyk.Common.Service; using Snyk.Common.Settings; +using Snyk.VisualStudio.Extension.Authentication; using Snyk.VisualStudio.Extension.CLI; using Snyk.VisualStudio.Extension.Language; using Snyk.VisualStudio.Extension.Service; @@ -55,6 +53,9 @@ public ISet TrustedFolders } } + public bool EnableDeltaFindings { get; set; } + public List FolderConfigs { get; set; } + /// public event EventHandler SettingsChanged; diff --git a/Snyk.VisualStudio.Extension.2022/Settings/SnykGeneralSettingsUserControl.cs b/Snyk.VisualStudio.Extension.2022/Settings/SnykGeneralSettingsUserControl.cs index 3bb64c739..1cfb8c34c 100644 --- a/Snyk.VisualStudio.Extension.2022/Settings/SnykGeneralSettingsUserControl.cs +++ b/Snyk.VisualStudio.Extension.2022/Settings/SnykGeneralSettingsUserControl.cs @@ -3,19 +3,16 @@ using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.IO; using System.Linq; -using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Threading; using Serilog; -using Snyk.Common; -using Snyk.Common.Authentication; using Snyk.Common.Settings; +using Snyk.VisualStudio.Extension.Authentication; using Snyk.VisualStudio.Extension.CLI; -using Snyk.VisualStudio.Extension.Download; +using Snyk.VisualStudio.Extension.Extension; using Snyk.VisualStudio.Extension.Language; using Snyk.VisualStudio.Extension.Service; using Snyk.VisualStudio.Extension.UI.Notifications; diff --git a/Snyk.VisualStudio.Extension.2022/Settings/SnykSettings.cs b/Snyk.VisualStudio.Extension.2022/Settings/SnykSettings.cs index f7c74f255..01ae3df76 100644 --- a/Snyk.VisualStudio.Extension.2022/Settings/SnykSettings.cs +++ b/Snyk.VisualStudio.Extension.2022/Settings/SnykSettings.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Snyk.Common.Authentication; +using Snyk.VisualStudio.Extension.Authentication; using Snyk.VisualStudio.Extension.Download; namespace Snyk.VisualStudio.Extension.Settings diff --git a/Snyk.Common/Settings/SnykSettingsChangedEventArgs.cs b/Snyk.VisualStudio.Extension.2022/Settings/SnykSettingsChangedEventArgs.cs similarity index 100% rename from Snyk.Common/Settings/SnykSettingsChangedEventArgs.cs rename to Snyk.VisualStudio.Extension.2022/Settings/SnykSettingsChangedEventArgs.cs diff --git a/Snyk.VisualStudio.Extension.2022/Settings/SnykSettingsLoader.cs b/Snyk.VisualStudio.Extension.2022/Settings/SnykSettingsLoader.cs index 44c0024a1..c563b71e0 100644 --- a/Snyk.VisualStudio.Extension.2022/Settings/SnykSettingsLoader.cs +++ b/Snyk.VisualStudio.Extension.2022/Settings/SnykSettingsLoader.cs @@ -3,6 +3,7 @@ using System.Text; using Serilog; using Snyk.Common; +using Snyk.VisualStudio.Extension.Utils; namespace Snyk.VisualStudio.Extension.Settings { diff --git a/Snyk.VisualStudio.Extension.2022/Settings/SnykUserStorageSettingsService.cs b/Snyk.VisualStudio.Extension.2022/Settings/SnykUserStorageSettingsService.cs index 3a3732dfb..adb5ab4c1 100644 --- a/Snyk.VisualStudio.Extension.2022/Settings/SnykUserStorageSettingsService.cs +++ b/Snyk.VisualStudio.Extension.2022/Settings/SnykUserStorageSettingsService.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Serilog; -using Snyk.Common; -using Snyk.Common.Authentication; +using Snyk.VisualStudio.Extension.Authentication; using Snyk.VisualStudio.Extension.Service; namespace Snyk.VisualStudio.Extension.Settings diff --git a/Snyk.VisualStudio.Extension.2022/Snyk.VisualStudio.Extension.2022.csproj b/Snyk.VisualStudio.Extension.2022/Snyk.VisualStudio.Extension.2022.csproj index c1a6a5f9c..337e7dfcb 100644 --- a/Snyk.VisualStudio.Extension.2022/Snyk.VisualStudio.Extension.2022.csproj +++ b/Snyk.VisualStudio.Extension.2022/Snyk.VisualStudio.Extension.2022.csproj @@ -65,7 +65,13 @@ + + + + + + @@ -93,6 +99,8 @@ + + @@ -100,15 +108,19 @@ Always + PreserveNewest true + + + @@ -123,6 +135,7 @@ + Component @@ -134,6 +147,7 @@ SnykGeneralSettingsUserControl.cs + Component @@ -153,6 +167,7 @@ True + @@ -223,6 +238,9 @@ + + + VSPackage.resx True @@ -230,6 +248,9 @@ + + true + Designer @@ -273,8 +294,23 @@ 3.8.1 - - 3.0.1 + + 13.0.1 + + + 2.0.2 + + + 3.1.0 + + + 8.4.0 + + + 7.0.0 + + + 5.0.0 0.15.0 @@ -283,12 +319,6 @@ 4.3.0 - - - {7912ad6d-c154-4504-9ab3-8767d3c46e89} - Snyk.Common - - MSBuild:Compile @@ -550,6 +580,7 @@ true +