Skip to content

Commit

Permalink
Make analyzers happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Ratzman committed Mar 25, 2024
1 parent a6ddf4b commit b3b7091
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
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 @@ -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

0 comments on commit b3b7091

Please sign in to comment.