Skip to content

Commit b3b7091

Browse files
author
Adam Ratzman
committed
Make analyzers happy
1 parent a6ddf4b commit b3b7091

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/GlobalSuppressions.cs

+8
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,11 @@
8080

8181
[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")]
8282
[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")]
83+
[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")]
84+
[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")]
85+
[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}")]
86+
[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")]
87+
[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}")]
88+
[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")]
89+
[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")]
90+
[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}")]

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/LanguageServices/LanguageServiceHost.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation
137137

138138
ITargetBlock<IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)>> actionBlock
139139
= DataflowBlockFactory.CreateActionBlock<IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)>>(
140-
update => OnSlicesChanged(update, cancellationToken),
140+
update => OnSlicesChangedAsync(update, cancellationToken),
141141
_unconfiguredProject,
142142
ProjectFaultSeverity.LimitedFunctionality,
143143
nameFormat: "LanguageServiceHostSlices {1}");
@@ -190,7 +190,7 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation
190190

191191
return;
192192

193-
async Task OnSlicesChanged(IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)> update, CancellationToken cancellationToken)
193+
async Task OnSlicesChangedAsync(IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)> update, CancellationToken cancellationToken)
194194
{
195195
ProjectConfiguration activeProjectConfiguration = update.Value.ActiveConfiguredProject.ProjectConfiguration;
196196
ConfigurationSubscriptionSources sources = update.Value.Sources;

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/LaunchProfiles/LaunchProfileActionBase.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public async Task OnRequestProcessFinishedAsync(IQueryProcessRequest request)
130130
UIPropertyDataProducer.CreateUIPropertyValues(request.QueryExecutionContext, launchProfileEntity, state.ProjectState, state.PropertiesContext, state.Rule, s_requestedPropertyProperties));
131131
launchProfileEntity.SetRelatedEntities(LaunchProfileType.PropertiesPropertyName, properties);
132132

133-
await PopulateEditorsAndValues(properties);
133+
await PopulateEditorsAndValuesAsync(properties);
134134
}
135135

136136
returnedLaunchProfiles.Add(launchProfileEntity);
@@ -165,7 +165,7 @@ public async Task OnRequestProcessFinishedAsync(IQueryProcessRequest request)
165165

166166
await ResultReceiver.OnRequestProcessFinishedAsync(request);
167167

168-
static async Task PopulateSupportedValuesAndConfigurations(ImmutableArray<IEntityValue> valueEntities)
168+
static async Task PopulateSupportedValuesAndConfigurationsAsync(ImmutableArray<IEntityValue> valueEntities)
169169
{
170170
foreach (IEntityValue valueEntity in valueEntities)
171171
{
@@ -197,7 +197,7 @@ static void PopulateEditorMetadata(ImmutableArray<IEntityValue> editors)
197197
}
198198
}
199199

200-
async Task PopulateEditorsAndValues(ImmutableArray<IEntityValue> properties)
200+
async Task PopulateEditorsAndValuesAsync(ImmutableArray<IEntityValue> properties)
201201
{
202202
foreach (IEntityValue propertyEntity in properties)
203203
{
@@ -215,7 +215,7 @@ async Task PopulateEditorsAndValues(ImmutableArray<IEntityValue> properties)
215215
await UIPropertyValueDataProducer.CreateUIPropertyValueValuesAsync(request.QueryExecutionContext, propertyEntity, propertyProviderState.ProjectState, propertyProviderState.ContainingRule, propertyProviderState.PropertiesContext, propertyProviderState.PropertyName, s_requestedValueProperties));
216216
propertyEntity.SetRelatedEntities(UIPropertyType.ValuesPropertyName, values);
217217

218-
await PopulateSupportedValuesAndConfigurations(values);
218+
await PopulateSupportedValuesAndConfigurationsAsync(values);
219219
}
220220
}
221221
}

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Query/PropertyPages/PropertyPageDataProducer.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ public static async Task<IEnumerable<IEntityValue>> CreatePropertyPageValuesAsyn
104104
{
105105
if (await project.GetProjectLevelPropertyPagesCatalogAsync() is IPropertyPagesCatalog projectCatalog)
106106
{
107-
return createPropertyPageValuesAsync();
107+
return CreatePropertyPageValues();
108108
}
109109

110110
return Enumerable.Empty<IEntityValue>();
111111

112-
IEnumerable<IEntityValue> createPropertyPageValuesAsync()
112+
IEnumerable<IEntityValue> CreatePropertyPageValues()
113113
{
114114
IProjectState projectState = new PropertyPageProjectState(project);
115115
QueryProjectPropertiesContext propertiesContext = new QueryProjectPropertiesContext(isProjectFile: true, project.FullPath, itemType: null, itemName: null);

src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchProfile.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ internal static async Task<LaunchProfile> ReplaceTokensAsync(ILaunchProfile prof
7777
{
7878
return profile switch
7979
{
80-
ILaunchProfile2 profile2 => ReplaceValuesAsync(profile2.OtherSettings, ReplaceIfString),
81-
_ => ReplaceValuesAsync(profile.FlattenOtherSettings(), ReplaceIfString)
80+
ILaunchProfile2 profile2 => ReplaceValuesAsync(profile2.OtherSettings, ReplaceIfStringAsync),
81+
_ => ReplaceValuesAsync(profile.FlattenOtherSettings(), ReplaceIfStringAsync)
8282
};
8383

84-
async Task<object> ReplaceIfString(object o)
84+
async Task<object> ReplaceIfStringAsync(object o)
8585
{
8686
return o switch
8787
{

tests/Microsoft.VisualStudio.ProjectSystem.Managed.VS.UnitTests/ProjectSystem/VS/UpToDate/BuildUpToDateCheckTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ public sealed class BuildUpToDateCheckTests : BuildUpToDateCheckTestBase, IDispo
3838
// Values returned by mocks that may be modified in test cases as needed
3939
private bool _isTaskQueueEmpty = true;
4040
private bool _isFastUpToDateCheckEnabledInSettings = true;
41-
private bool _isBuildAccelerationEnabledInSettings;
41+
private readonly bool _isBuildAccelerationEnabledInSettings;
4242
private bool? _isBuildAccelerationEnabledInProject;
4343
private bool? _expectedIsBuildAccelerationEnabled;
4444
private IEnumerable<(string Path, ImmutableArray<CopyItem> CopyItems)> _copyItems = Enumerable.Empty<(string Path, ImmutableArray<CopyItem> CopyItems)>();
45-
private bool _isCopyItemsComplete = true;
45+
private readonly bool _isCopyItemsComplete = true;
4646
private IReadOnlyList<string>? _targetsWithoutReferenceAssemblies;
4747

4848
private UpToDateCheckConfiguredInput? _state;
49-
private SolutionBuildContext? _currentSolutionBuildContext;
49+
private readonly SolutionBuildContext? _currentSolutionBuildContext;
5050
private bool _expectedUpToDate;
5151

5252
public BuildUpToDateCheckTests(ITestOutputHelper output)

0 commit comments

Comments
 (0)