Skip to content

Commit

Permalink
Fix nullable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
davkean committed Aug 7, 2020
1 parent 01ca687 commit 484014c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Microsoft.VisualStudio.Editors/GlobalSuppressions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,8 @@ Imports System.Diagnostics.CodeAnalysis
<Assembly: SuppressMessage("Naming", "CA1713:Events should not have 'Before' or 'After' prefix", Justification:="<Pending>", Scope:="member", Target:="~E:Microsoft.VisualStudio.Editors.MyExtensibility.TrackProjectDocumentsEventsHelper.AfterRemoveFiles")>
<Assembly: SuppressMessage("Naming", "CA1713:Events should not have 'Before' or 'After' prefix", Justification:="<Pending>", Scope:="member", Target:="~E:Microsoft.VisualStudio.Editors.MyExtensibility.TrackProjectDocumentsEventsHelper.AfterRenameDirectories")>
<Assembly: SuppressMessage("Naming", "CA1713:Events should not have 'Before' or 'After' prefix", Justification:="<Pending>", Scope:="member", Target:="~E:Microsoft.VisualStudio.Editors.MyExtensibility.TrackProjectDocumentsEventsHelper.AfterRenameFiles")>
<Assembly: SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Scope:="member", Target:="~M:Microsoft.VisualStudio.Editors.XmlIntellisense.XmlIntellisenseSchemas.CompileCallBack(Microsoft.VisualStudio.Editors.XmlIntellisense.XmlIntellisenseSchemasData)")>

' Bugs
<Assembly: SuppressMessage("Style", "IDE0070:Use 'System.HashCode'", Justification:="https://github.com/dotnet/roslyn/issues/45995", Scope:="member", Target:="~M:Microsoft.VisualStudio.Editors.PropertyPages.WPF.ApplicationPropPageVBWPF.StartupObject.GetHashCode~System.Int32")>

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public StartupObjectsEnumGenerator(Workspace workspace, UnconfiguredProject proj

public async Task<ICollection<IEnumValue>> 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<IEntryPointFinderService>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public override async Task<string> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public AssemblyOriginatorKeyFileValueProvider(UnconfiguredProject project)
IReadOnlyDictionary<string, string>? dimensionalConditions = null)
{
if (Path.IsPathRooted(unevaluatedPropertyValue) &&
_unconfiguredProject.TryMakeRelativeToProjectDirectory(unevaluatedPropertyValue, out string relativePath))
_unconfiguredProject.TryMakeRelativeToProjectDirectory(unevaluatedPropertyValue, out string? relativePath))
{
unevaluatedPropertyValue = relativePath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 484014c

Please sign in to comment.