Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use modern unified settings format, upgrade packages & fix analyzer issues #9422

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,40 @@
<PackageVersion Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.79-alpha" />
<PackageVersion Include="Nerdbank.Streams" Version="2.10.69" />
<PackageVersion Include="System.IO.Pipelines" Version="7.0.0" />
<PackageVersion Include="System.IO.Pipelines" Version="8.0.0" />

<!-- VS SDK -->
<!-- https://dev.azure.com/azure-public/vside/_artifacts/feed/vssdk -->
<PackageVersion Include="EnvDTE" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.Internal.VisualStudio.Interop" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.ServiceHub.Framework" Version="4.3.57" />
<PackageVersion Include="Microsoft.VisualStudio.ComponentModelHost" Version="17.3.198" />
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.7.18" />
<PackageVersion Include="Microsoft.ServiceHub.Framework" Version="4.5.26-alpha" />
<PackageVersion Include="Microsoft.VisualStudio.ComponentModelHost" Version="17.10.126-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Composition" Version="17.10.29-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Data.Core" Version="17.0.0-preview-2-31223-026" />
<PackageVersion Include="Microsoft.VisualStudio.Data.Services" Version="17.0.0-preview-2-31223-026" />
<PackageVersion Include="Microsoft.VisualStudio.DataDesign.Common" Version="17.0.0-preview-2-31223-026" />
<PackageVersion Include="Microsoft.VisualStudio.DataTools.Interop" Version="17.0.0-preview-2-31223-026" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.Contracts" Version="17.4.0-beta.22470.1" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.UI.Interfaces" Version="17.4.0-beta.22470.1" />
<PackageVersion Include="Microsoft.VisualStudio.Designer.Interfaces" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VisualStudio.ImageCatalog" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VisualStudio.Interop" Version="17.4.0-preview-2-32826-307" />
<PackageVersion Include="Microsoft.VisualStudio.ImageCatalog" Version="17.10.39524" />
<PackageVersion Include="Microsoft.VisualStudio.Interop" Version="17.10.39524" />
<PackageVersion Include="Microsoft.VisualStudio.ManagedInterfaces" Version="8.0.50728" />
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.7.9" />
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.10.19-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Settings.15.0" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.2.2146" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.Design" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.Framework" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.8.9" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="17.10.39524" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.Design" Version="17.10.39524" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.Framework" Version="17.10.39524" />
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.10.18" />
<PackageVersion Include="Microsoft.VisualStudio.TemplateWizardInterface" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.7.30" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.7.30" />
<PackageVersion Include="Microsoft.VisualStudio.Utilities" Version="17.7.36307-preview.2" />
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.6.11" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.10.39-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.39-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Utilities" Version="17.10.39524" />
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.8.8" />
<PackageVersion Include="Microsoft.VisualStudio.XmlEditor" Version="17.3.32804.24" />
<PackageVersion Include="Microsoft.VSSDK.BuildTools" Version="17.5.18-preview1" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="8.0.0" />
<PackageVersion Include="Microsoft.VSDesigner" Version="17.0.0-preview-2-31223-026" />
<PackageVersion Include="VsWebSite.Interop" Version="16.8.30523.219" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion setup/ProjectSystemSetup/ProjectSystemSetup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</PropertyGroup>

<ItemGroup>
<Content Include="UnifiedSettings\ManagedProjectSystem.registration.json">
<Content Include="UnifiedSettings\registration.json">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}")]
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation

ITargetBlock<IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)>> actionBlock
= DataflowBlockFactory.CreateActionBlock<IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)>>(
update => OnSlicesChanged(update, cancellationToken),
update => OnSlicesChangedAsync(update, cancellationToken),
_unconfiguredProject,
ProjectFaultSeverity.LimitedFunctionality,
nameFormat: "LanguageServiceHostSlices {1}");
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -165,7 +165,7 @@ public async Task OnRequestProcessFinishedAsync(IQueryProcessRequest request)

await ResultReceiver.OnRequestProcessFinishedAsync(request);

static async Task PopulateSupportedValuesAndConfigurations(ImmutableArray<IEntityValue> valueEntities)
static async Task PopulateSupportedValuesAndConfigurationsAsync(ImmutableArray<IEntityValue> valueEntities)
{
foreach (IEntityValue valueEntity in valueEntities)
{
Expand Down Expand Up @@ -197,7 +197,7 @@ static void PopulateEditorMetadata(ImmutableArray<IEntityValue> editors)
}
}

async Task PopulateEditorsAndValues(ImmutableArray<IEntityValue> properties)
async Task PopulateEditorsAndValuesAsync(ImmutableArray<IEntityValue> properties)
{
foreach (IEntityValue propertyEntity in properties)
{
Expand All @@ -215,7 +215,7 @@ async Task PopulateEditorsAndValues(ImmutableArray<IEntityValue> 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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ public static async Task<IEnumerable<IEntityValue>> CreatePropertyPageValuesAsyn
{
if (await project.GetProjectLevelPropertyPagesCatalogAsync() is IPropertyPagesCatalog projectCatalog)
{
return createPropertyPageValuesAsync();
return CreatePropertyPageValues();
}

return Enumerable.Empty<IEntityValue>();

IEnumerable<IEntityValue> createPropertyPageValuesAsync()
IEnumerable<IEntityValue> CreatePropertyPageValues()
{
IProjectState projectState = new PropertyPageProjectState(project);
QueryProjectPropertiesContext propertiesContext = new QueryProjectPropertiesContext(isProjectFile: true, project.FullPath, itemType: null, itemName: null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ internal static async Task<LaunchProfile> 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<object> ReplaceIfString(object o)
async Task<object> ReplaceIfStringAsync(object o)
{
return o switch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CopyItem> CopyItems)> _copyItems = Enumerable.Empty<(string Path, ImmutableArray<CopyItem> CopyItems)>();
private bool _isCopyItemsComplete = true;
private readonly bool _isCopyItemsComplete = true;
private IReadOnlyList<string>? _targetsWithoutReferenceAssemblies;

private UpToDateCheckConfiguredInput? _state;
private SolutionBuildContext? _currentSolutionBuildContext;
private readonly SolutionBuildContext? _currentSolutionBuildContext;
private bool _expectedUpToDate;

public BuildUpToDateCheckTests(ITestOutputHelper output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading