Skip to content

Commit

Permalink
Fix some warnings in the IDE
Browse files Browse the repository at this point in the history
I turned on solution-wide analysis and these appeared in the error list.
  • Loading branch information
drewnoakes committed Mar 28, 2024
1 parent 6c46276 commit e459ba5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ dotnet_diagnostic.IDE0090.severity = warning # Use new(...)
dotnet_diagnostic.IDE0220.severity = warning # Add explicit cast
dotnet_diagnostic.IDE0250.severity = warning # Struct can be made 'readonly'
dotnet_diagnostic.IDE0251.severity = suggestion # Struct methods can be made 'readonly'
dotnet_diagnostic.IDE0270.severity = suggestion # Use coalesce expression
dotnet_diagnostic.IDE1006.severity = warning # Naming styles Task Open() Task OpenAsync()
dotnet_diagnostic.IDE1006WithoutSuggestion.severity = suggestion

Expand Down Expand Up @@ -442,4 +443,5 @@ dotnet_diagnostic.CA1307.severity = suggestion # Specify StringComparison
# Disabling warning for C# files generated from xaml rules
[artifacts/*/obj/Microsoft.VisualStudio.ProjectSystem.Managed/net8.0/*.cs]
# CS0618: Type or member is obsolete
dotnet_diagnostic.CS0618.severity = silent
dotnet_diagnostic.CS0618.severity = silent

2 changes: 2 additions & 0 deletions tests/Common/ThrowingTraceListener.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

using System.Diagnostics;
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace Microsoft.VisualStudio.Diagnostics
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public void ImportsMustFilterBasedOnCapabilities(Type type)

foreach ((ImportDefinitionBinding import, IReadOnlyList<ExportDefinitionBinding> exports) in part.SatisfyingExports)
{
var importingProperty = import.ImportingMember as PropertyInfo;
if (importingProperty is null) // We don't verify ImportingConstructor, only check properties.
// Only check properties. We don't verify ImportingConstructor.
if (import.ImportingMember is not PropertyInfo importingProperty)
return;

Type memberType = importingProperty.PropertyType;
Expand Down

0 comments on commit e459ba5

Please sign in to comment.