From 484014c5b319e52c15b75a983ab3bfe1db4053ba Mon Sep 17 00:00:00 2001 From: David Kean Date: Fri, 7 Aug 2020 16:40:27 +1000 Subject: [PATCH] Fix nullable warnings --- src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb | 2 ++ .../ProjectSystem/VS/Properties/StartupObjectsEnumProvider.cs | 2 +- .../ApplicationManifestValueProvider.cs | 2 +- .../AssemblyOriginatorKeyFileValueProvider.cs | 2 +- .../ProjectSystem/UpToDate/BuildUpToDateCheck.cs | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb b/src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb index ae06678b204..3e373b65f46 100644 --- a/src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb +++ b/src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb @@ -1333,6 +1333,8 @@ Imports System.Diagnostics.CodeAnalysis + ' Bugs + diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/StartupObjectsEnumProvider.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/StartupObjectsEnumProvider.cs index 499ed057f4a..98ac45cb5fd 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/StartupObjectsEnumProvider.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Properties/StartupObjectsEnumProvider.cs @@ -54,7 +54,7 @@ public StartupObjectsEnumGenerator(Workspace workspace, UnconfiguredProject proj public async Task> GetListedValuesAsync() { - Project project = _workspace.CurrentSolution.Projects.First(p => PathHelper.IsSamePath(p.FilePath, _unconfiguredProject.FullPath)); + Project project = _workspace.CurrentSolution.Projects.First(p => PathHelper.IsSamePath(p.FilePath!, _unconfiguredProject.FullPath)); Compilation? compilation = await project.GetCompilationAsync(); IEntryPointFinderService? entryPointFinderService = project.LanguageServices.GetService(); diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Properties/InterceptedProjectProperties/ApplicationManifestValueProvider.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Properties/InterceptedProjectProperties/ApplicationManifestValueProvider.cs index ae59b795954..34d476795a5 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Properties/InterceptedProjectProperties/ApplicationManifestValueProvider.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Properties/InterceptedProjectProperties/ApplicationManifestValueProvider.cs @@ -80,7 +80,7 @@ public override async Task OnGetEvaluatedPropertyValueAsync(string prope await defaultProperties.DeletePropertyAsync(NoManifestMSBuildProperty); // If we can make the path relative to the project folder do so. Otherwise just use the given path. if (Path.IsPathRooted(unevaluatedPropertyValue) && - PathHelper.TryMakeRelativeToProjectDirectory(_unconfiguredProject, unevaluatedPropertyValue, out string relativePath)) + PathHelper.TryMakeRelativeToProjectDirectory(_unconfiguredProject, unevaluatedPropertyValue, out string? relativePath)) { returnValue = relativePath; } diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Properties/InterceptedProjectProperties/SigningPropertyPage/AssemblyOriginatorKeyFileValueProvider.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Properties/InterceptedProjectProperties/SigningPropertyPage/AssemblyOriginatorKeyFileValueProvider.cs index 1a0f8b0f7fa..69d9cafc625 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Properties/InterceptedProjectProperties/SigningPropertyPage/AssemblyOriginatorKeyFileValueProvider.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Properties/InterceptedProjectProperties/SigningPropertyPage/AssemblyOriginatorKeyFileValueProvider.cs @@ -25,7 +25,7 @@ public AssemblyOriginatorKeyFileValueProvider(UnconfiguredProject project) IReadOnlyDictionary? dimensionalConditions = null) { if (Path.IsPathRooted(unevaluatedPropertyValue) && - _unconfiguredProject.TryMakeRelativeToProjectDirectory(unevaluatedPropertyValue, out string relativePath)) + _unconfiguredProject.TryMakeRelativeToProjectDirectory(unevaluatedPropertyValue, out string? relativePath)) { unevaluatedPropertyValue = relativePath; } diff --git a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/UpToDate/BuildUpToDateCheck.cs b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/UpToDate/BuildUpToDateCheck.cs index 3fba73953f3..147fd841c76 100644 --- a/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/UpToDate/BuildUpToDateCheck.cs +++ b/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/UpToDate/BuildUpToDateCheck.cs @@ -439,7 +439,7 @@ private bool CheckMarkers(Log log, in TimestampCache timestampCache, State state // here if the project actually produced a marker and we only check it against references that // actually produced a marker. - if (string.IsNullOrWhiteSpace(state.CopyUpToDateMarkerItem) || !state.CopyReferenceInputs.Any()) + if (Strings.IsNullOrWhiteSpace(state.CopyUpToDateMarkerItem) || !state.CopyReferenceInputs.Any()) { return true; }