From 3df23187f5443d9b33a4342592320e5d755d12ea Mon Sep 17 00:00:00 2001 From: Adam Ratzman Date: Tue, 19 Mar 2024 14:34:25 -0400 Subject: [PATCH 1/3] rename unified settings file, add attribute --- .../CommonFiles.swr | 4 ++-- setup/ProjectSystemSetup/ProjectSystemSetup.csproj | 2 +- ...nagedProjectSystem.registration.json => registration.json} | 0 .../Packaging/ManagedProjectSystemPackage.cs | 1 + .../Setup/PackageContentTests.cs | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) rename setup/ProjectSystemSetup/UnifiedSettings/{ManagedProjectSystem.registration.json => registration.json} (100%) diff --git a/setup/Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles/CommonFiles.swr b/setup/Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles/CommonFiles.swr index 96bb86c9c1d..062d6a4a796 100644 --- a/setup/Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles/CommonFiles.swr +++ b/setup/Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles/CommonFiles.swr @@ -659,5 +659,5 @@ folder "InstallDir:MSBuild\Microsoft\VisualStudio\Managed\zh-Hant" file source="$(VisualStudioXamlRulesDir)zh-Hant\ResolvedSdkReference.xaml" file source="$(VisualStudioXamlRulesDir)zh-Hant\SdkReference.xaml" - folder "Extensions\Microsoft\ManagedProjectSystem\UnifiedSettings" - file source="$(VisualStudioExtensionSetupDir)\ProjectSystemSetup\UnifiedSettings\ManagedProjectSystem.registration.json" + folder "Extensions\Microsoft\ManagedProjectSystem" + file source="$(VisualStudioExtensionSetupDir)\ProjectSystemSetup\UnifiedSettings\registration.json" diff --git a/setup/ProjectSystemSetup/ProjectSystemSetup.csproj b/setup/ProjectSystemSetup/ProjectSystemSetup.csproj index 8bfc0729ffd..05b29e8e5fe 100644 --- a/setup/ProjectSystemSetup/ProjectSystemSetup.csproj +++ b/setup/ProjectSystemSetup/ProjectSystemSetup.csproj @@ -27,7 +27,7 @@ - + true diff --git a/setup/ProjectSystemSetup/UnifiedSettings/ManagedProjectSystem.registration.json b/setup/ProjectSystemSetup/UnifiedSettings/registration.json similarity index 100% rename from setup/ProjectSystemSetup/UnifiedSettings/ManagedProjectSystem.registration.json rename to setup/ProjectSystemSetup/UnifiedSettings/registration.json diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/Packaging/ManagedProjectSystemPackage.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/Packaging/ManagedProjectSystemPackage.cs index a7ba82a6564..bc6ed8eaf1e 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/Packaging/ManagedProjectSystemPackage.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/Packaging/ManagedProjectSystemPackage.cs @@ -20,6 +20,7 @@ namespace Microsoft.VisualStudio.Packaging termValues: new[] { "SolutionHasProjectCapability:.NET & CPS" } )] [ProvideMenuResource("Menus.ctmenu", 5)] + [ProvideSettingsManifest] internal sealed class ManagedProjectSystemPackage : AsyncPackage { public const string ActivationContextGuid = "E7DF1626-44DD-4E8C-A8A0-92EAB6DDC16E"; diff --git a/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/Setup/PackageContentTests.cs b/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/Setup/PackageContentTests.cs index 9b9c83018bf..60a98a75345 100644 --- a/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/Setup/PackageContentTests.cs +++ b/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/Setup/PackageContentTests.cs @@ -12,7 +12,7 @@ public sealed class PackageContentTests { // These files are only added as part of signing. private const string DigitalSignature = "package/services/digital-signature"; - private const string SettingsRegistrationFileSuffix = "ManagedProjectSystem.registration.json"; + private const string SettingsRegistrationFileSuffix = "registration.json"; private const string Rels = "_rels/.rels"; [Fact] From a6ddf4b5a9e745d5201af71adbd2005a58b968d2 Mon Sep 17 00:00:00 2001 From: Adam Ratzman Date: Fri, 22 Mar 2024 13:01:27 -0400 Subject: [PATCH 2/3] update VS packages --- Directory.Packages.props | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7fba711663b..26bbed6526a 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -29,15 +29,15 @@ - + - - - + + + @@ -45,24 +45,24 @@ - - + + - + - - - - + + + + - - - - + + + + - + From b3b70915f56e99f381dc39e8e1df2f9698f9ef13 Mon Sep 17 00:00:00 2001 From: Adam Ratzman Date: Mon, 25 Mar 2024 12:02:32 -0400 Subject: [PATCH 3/3] Make analyzers happy --- .../GlobalSuppressions.cs | 8 ++++++++ .../VS/LanguageServices/LanguageServiceHost.cs | 4 ++-- .../VS/Query/LaunchProfiles/LaunchProfileActionBase.cs | 8 ++++---- .../VS/Query/PropertyPages/PropertyPageDataProducer.cs | 4 ++-- .../ProjectSystem/Debug/LaunchProfile.cs | 6 +++--- .../ProjectSystem/VS/UpToDate/BuildUpToDateCheckTests.cs | 6 +++--- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/GlobalSuppressions.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/GlobalSuppressions.cs index e60b2ee4a38..5ca850a91bc 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/GlobalSuppressions.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/GlobalSuppressions.cs @@ -80,3 +80,11 @@ [assembly: SuppressMessage("Reliability", "ISB001:Dispose of proxies", Justification = "Lifecycle is handled correctly, but analyzer cannot tell that", Scope = "member", Target = "~M:Microsoft.VisualStudio.ProjectSystem.VS.Setup.SetupComponentRegistrationService.InitializeCoreAsync(System.Threading.CancellationToken)~System.Threading.Tasks.Task")] [assembly: SuppressMessage("Reliability", "ISB001:Dispose of proxies", Justification = "Lifecycle is handled correctly, but analyzer cannot tell that", Scope = "member", Target = "~F:Microsoft.VisualStudio.ProjectSystem.VS.Setup.SetupComponentRegistrationService._missingComponentRegistrationService")] +[assembly: SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "Existing code, issue filed to replace type @ https://github.com/dotnet/project-system/issues/9424", Scope = "member", Target = "~M:Microsoft.VisualStudio.ProjectSystem.VS.HotReload.ProjectHotReloadSessionManager.ActivateSessionAsync(System.Int32,System.Boolean,System.String)~System.Threading.Tasks.Task")] +[assembly: SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "Existing code, issue filed to replace type @ https://github.com/dotnet/project-system/issues/9424", Scope = "member", Target = "~F:Microsoft.VisualStudio.ProjectSystem.VS.HotReload.ProjectHotReloadSessionManager._semaphore")] +[assembly: SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "Existing code, issue filed to replace type @ https://github.com/dotnet/project-system/issues/9424", Scope = "member", Target = "~M:Microsoft.VisualStudio.ProjectSystem.VS.HotReload.ProjectHotReloadSessionManager.TryCreatePendingSessionAsync(System.Collections.Generic.IDictionary{System.String,System.String})~System.Threading.Tasks.Task{System.Boolean}")] +[assembly: SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "Existing code, issue filed to replace type @ https://github.com/dotnet/project-system/issues/9424", Scope = "member", Target = "~M:Microsoft.VisualStudio.ProjectSystem.VS.HotReload.ProjectHotReloadSessionManager.ApplyHotReloadUpdateAsync(System.Func{Microsoft.VisualStudio.HotReload.Components.DeltaApplier.IDeltaApplier,System.Threading.CancellationToken,System.Threading.Tasks.Task},System.Threading.CancellationToken)~System.Threading.Tasks.Task")] +[assembly: SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "Existing code, issue filed to replace type @ https://github.com/dotnet/project-system/issues/9424", Scope = "member", Target = "~M:Microsoft.VisualStudio.ProjectSystem.VS.HotReload.ProjectHotReloadSessionManager.StopProjectAsync(Microsoft.VisualStudio.ProjectSystem.VS.HotReload.ProjectHotReloadSessionManager.HotReloadState,System.Threading.CancellationToken)~System.Threading.Tasks.Task{System.Boolean}")] +[assembly: SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "Existing code, issue filed to replace type @ https://github.com/dotnet/project-system/issues/9424", Scope = "member", Target = "~M:Microsoft.VisualStudio.ProjectSystem.VS.HotReload.ProjectHotReloadSessionManager.DisposeCoreAsync(System.Boolean)~System.Threading.Tasks.Task")] +[assembly: SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "Existing code, issue filed to replace type @ https://github.com/dotnet/project-system/issues/9424", Scope = "member", Target = "~F:Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.BuildUpToDateCheck.Subscription._semaphore")] +[assembly: SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "Existing code, issue filed to replace type @ https://github.com/dotnet/project-system/issues/9424", Scope = "member", Target = "~M:Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.BuildUpToDateCheck.Subscription.RunAsync(System.Func{Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.UpToDateCheckConfiguredInput,Microsoft.VisualStudio.ProjectSystem.VS.UpToDate.IUpToDateCheckStatePersistence,System.Threading.CancellationToken,System.Threading.Tasks.Task{System.ValueTuple{System.Boolean,System.Collections.Immutable.ImmutableArray{Microsoft.VisualStudio.ProjectSystem.ProjectConfiguration}}}},System.Threading.CancellationToken)~System.Threading.Tasks.Task{System.Boolean}")] diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/LanguageServices/LanguageServiceHost.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/LanguageServices/LanguageServiceHost.cs index df956fc8a8e..a1529143bae 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/LanguageServices/LanguageServiceHost.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/LanguageServices/LanguageServiceHost.cs @@ -137,7 +137,7 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation ITargetBlock> actionBlock = DataflowBlockFactory.CreateActionBlock>( - update => OnSlicesChanged(update, cancellationToken), + update => OnSlicesChangedAsync(update, cancellationToken), _unconfiguredProject, ProjectFaultSeverity.LimitedFunctionality, nameFormat: "LanguageServiceHostSlices {1}"); @@ -190,7 +190,7 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation return; - async Task OnSlicesChanged(IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)> update, CancellationToken cancellationToken) + async Task OnSlicesChangedAsync(IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)> update, CancellationToken cancellationToken) { ProjectConfiguration activeProjectConfiguration = update.Value.ActiveConfiguredProject.ProjectConfiguration; ConfigurationSubscriptionSources sources = update.Value.Sources; diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/LaunchProfiles/LaunchProfileActionBase.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/LaunchProfiles/LaunchProfileActionBase.cs index 62749aae942..e0f74b1d48d 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/LaunchProfiles/LaunchProfileActionBase.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/LaunchProfiles/LaunchProfileActionBase.cs @@ -130,7 +130,7 @@ public async Task OnRequestProcessFinishedAsync(IQueryProcessRequest request) UIPropertyDataProducer.CreateUIPropertyValues(request.QueryExecutionContext, launchProfileEntity, state.ProjectState, state.PropertiesContext, state.Rule, s_requestedPropertyProperties)); launchProfileEntity.SetRelatedEntities(LaunchProfileType.PropertiesPropertyName, properties); - await PopulateEditorsAndValues(properties); + await PopulateEditorsAndValuesAsync(properties); } returnedLaunchProfiles.Add(launchProfileEntity); @@ -165,7 +165,7 @@ public async Task OnRequestProcessFinishedAsync(IQueryProcessRequest request) await ResultReceiver.OnRequestProcessFinishedAsync(request); - static async Task PopulateSupportedValuesAndConfigurations(ImmutableArray valueEntities) + static async Task PopulateSupportedValuesAndConfigurationsAsync(ImmutableArray valueEntities) { foreach (IEntityValue valueEntity in valueEntities) { @@ -197,7 +197,7 @@ static void PopulateEditorMetadata(ImmutableArray editors) } } - async Task PopulateEditorsAndValues(ImmutableArray properties) + async Task PopulateEditorsAndValuesAsync(ImmutableArray properties) { foreach (IEntityValue propertyEntity in properties) { @@ -215,7 +215,7 @@ async Task PopulateEditorsAndValues(ImmutableArray properties) await UIPropertyValueDataProducer.CreateUIPropertyValueValuesAsync(request.QueryExecutionContext, propertyEntity, propertyProviderState.ProjectState, propertyProviderState.ContainingRule, propertyProviderState.PropertiesContext, propertyProviderState.PropertyName, s_requestedValueProperties)); propertyEntity.SetRelatedEntities(UIPropertyType.ValuesPropertyName, values); - await PopulateSupportedValuesAndConfigurations(values); + await PopulateSupportedValuesAndConfigurationsAsync(values); } } } diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/PropertyPages/PropertyPageDataProducer.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/PropertyPages/PropertyPageDataProducer.cs index 1187b929084..40d3ae4756c 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/PropertyPages/PropertyPageDataProducer.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/PropertyPages/PropertyPageDataProducer.cs @@ -104,12 +104,12 @@ public static async Task> CreatePropertyPageValuesAsyn { if (await project.GetProjectLevelPropertyPagesCatalogAsync() is IPropertyPagesCatalog projectCatalog) { - return createPropertyPageValuesAsync(); + return CreatePropertyPageValues(); } return Enumerable.Empty(); - IEnumerable createPropertyPageValuesAsync() + IEnumerable CreatePropertyPageValues() { IProjectState projectState = new PropertyPageProjectState(project); QueryProjectPropertiesContext propertiesContext = new QueryProjectPropertiesContext(isProjectFile: true, project.FullPath, itemType: null, itemName: null); diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchProfile.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchProfile.cs index b7b57a15cec..174c059fdb3 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchProfile.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchProfile.cs @@ -77,11 +77,11 @@ internal static async Task ReplaceTokensAsync(ILaunchProfile prof { return profile switch { - ILaunchProfile2 profile2 => ReplaceValuesAsync(profile2.OtherSettings, ReplaceIfString), - _ => ReplaceValuesAsync(profile.FlattenOtherSettings(), ReplaceIfString) + ILaunchProfile2 profile2 => ReplaceValuesAsync(profile2.OtherSettings, ReplaceIfStringAsync), + _ => ReplaceValuesAsync(profile.FlattenOtherSettings(), ReplaceIfStringAsync) }; - async Task ReplaceIfString(object o) + async Task ReplaceIfStringAsync(object o) { return o switch { diff --git a/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/ProjectSystem/VS/UpToDate/BuildUpToDateCheckTests.cs b/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/ProjectSystem/VS/UpToDate/BuildUpToDateCheckTests.cs index c6f941c7f7e..06b01c105c0 100644 --- a/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/ProjectSystem/VS/UpToDate/BuildUpToDateCheckTests.cs +++ b/tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/ProjectSystem/VS/UpToDate/BuildUpToDateCheckTests.cs @@ -38,15 +38,15 @@ public sealed class BuildUpToDateCheckTests : BuildUpToDateCheckTestBase, IDispo // Values returned by mocks that may be modified in test cases as needed private bool _isTaskQueueEmpty = true; private bool _isFastUpToDateCheckEnabledInSettings = true; - private bool _isBuildAccelerationEnabledInSettings; + private readonly bool _isBuildAccelerationEnabledInSettings; private bool? _isBuildAccelerationEnabledInProject; private bool? _expectedIsBuildAccelerationEnabled; private IEnumerable<(string Path, ImmutableArray CopyItems)> _copyItems = Enumerable.Empty<(string Path, ImmutableArray CopyItems)>(); - private bool _isCopyItemsComplete = true; + private readonly bool _isCopyItemsComplete = true; private IReadOnlyList? _targetsWithoutReferenceAssemblies; private UpToDateCheckConfiguredInput? _state; - private SolutionBuildContext? _currentSolutionBuildContext; + private readonly SolutionBuildContext? _currentSolutionBuildContext; private bool _expectedUpToDate; public BuildUpToDateCheckTests(ITestOutputHelper output)