Skip to content

Commit

Permalink
changed ... == ... || ... == ... to ... is ... or ...
Browse files Browse the repository at this point in the history
  • Loading branch information
RudySchockaert-EngieIT committed Jan 9, 2024
1 parent 6ec6d5a commit 896bf7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ IEnumerable<CompletionItem> GetElementCompletions(XmlLocation location, ProjectD
HandleTriggerCharacters(triggerCharacters, projectDocument, ref targetRange);

// These items are handled by PackageReferenceCompletion.
if (itemType == "PackageReference" || itemType == "PackageVersion" || itemType == "DotNetCliToolReference")
if (itemType is "PackageReference" or "PackageVersion" or "DotNetCliToolReference")
{
Log.Verbose("Not offering any element completions for {XmlLocation:l} ({ItemType} items are handled by another provider).",
location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ public static MarkedStringContainer UnusedProperty(MSBuildUnusedProperty unusedP
public MarkedStringContainer ItemGroup(MSBuildItemGroup itemGroup)
{
if (itemGroup == null)
{
throw new ArgumentNullException(nameof(itemGroup));
}

if (itemGroup.Name == "PackageReference" || itemGroup.Name == "PackageVersion")
if (itemGroup.Name is "PackageReference" || itemGroup.Name is "PackageVersion")
{
string packageId = itemGroup.FirstInclude;
string packageRequestedVersion = itemGroup.GetFirstMetadataValue("Version");
Expand Down Expand Up @@ -363,7 +365,7 @@ public MarkedStringContainer ItemGroupMetadata(MSBuildItemGroup itemGroup, strin
if (string.IsNullOrWhiteSpace(metadataName))
throw new ArgumentException("Argument cannot be null, empty, or entirely composed of whitespace: 'metadataName'.", nameof(metadataName));

if (itemGroup.Name == "PackageReference" || itemGroup.Name == "PackageVersion")
if (itemGroup.Name is "PackageReference" or "PackageVersion")
return ItemGroup(itemGroup);

if (metadataName == "Condition")
Expand Down Expand Up @@ -437,7 +439,7 @@ public MarkedStringContainer UnusedItemGroupMetadata(MSBuildUnusedItemGroup item
if (string.IsNullOrWhiteSpace(metadataName))
throw new ArgumentException("Argument cannot be null, empty, or entirely composed of whitespace: 'metadataName'.", nameof(metadataName));

if (itemGroup.Name == "PackageReference" || itemGroup.Name == "PackageVersion")
if (itemGroup.Name is "PackageReference" or "PackageVersion")
return UnusedItemGroup(itemGroup);

if (metadataName == "Condition")
Expand Down

0 comments on commit 896bf7f

Please sign in to comment.