diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 66db398..075cd59 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -5,8 +5,10 @@ $(MSBuildProjectName.Contains('Tests')) portable Glenn Watson - Copyright (c) 2021 ReactiveUI Association Incorporated + ReactiveUI Association Inc + Copyright © 2020 - $([System.DateTime]::Now.ToString(yyyy)) $(Company) MIT + docs\README.md https://github.com/reactivemarbles/RoslynHelpers Helpers with the Roslyn system, useful for unit tests. glennawatson @@ -34,6 +36,7 @@ + diff --git a/src/ReactiveMarbles.RoslynHelpers/ReactiveMarbles.RoslynHelpers.csproj b/src/ReactiveMarbles.RoslynHelpers/ReactiveMarbles.RoslynHelpers.csproj index 0e60d01..cb56670 100644 --- a/src/ReactiveMarbles.RoslynHelpers/ReactiveMarbles.RoslynHelpers.csproj +++ b/src/ReactiveMarbles.RoslynHelpers/ReactiveMarbles.RoslynHelpers.csproj @@ -2,15 +2,20 @@ netstandard2.0;net6.0 - latest + 9 enable ReactiveUI Association Inc A library to make roslyn operations easier. - full + true + false + true - + + + + diff --git a/src/ReactiveMarbles.RoslynHelpers/RoslynCommonHelpers.cs b/src/ReactiveMarbles.RoslynHelpers/RoslynCommonHelpers.cs index b3fe8de..352fd16 100644 --- a/src/ReactiveMarbles.RoslynHelpers/RoslynCommonHelpers.cs +++ b/src/ReactiveMarbles.RoslynHelpers/RoslynCommonHelpers.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#pragma warning disable + using System; using System.Linq; @@ -64,7 +66,7 @@ public static AttributeListSyntax[] GenerateObsoleteAttributeList(ISymbol eventD var message = obsoleteAttribute.ConstructorArguments.FirstOrDefault().Value?.ToString(); var isError = bool.Parse(obsoleteAttribute.ConstructorArguments.ElementAtOrDefault(1).Value?.ToString() ?? bool.FalseString) ? SyntaxKind.TrueLiteralExpression : SyntaxKind.FalseLiteralExpression; - if (message is not null && !string.IsNullOrWhiteSpace(message)) + if (message != null && !string.IsNullOrWhiteSpace(message)) { var attribute = Attribute( "global::System.ObsoleteAttribute", diff --git a/src/ReactiveMarbles.RoslynHelpers/RoslynGeneratorExtensions.cs b/src/ReactiveMarbles.RoslynHelpers/RoslynGeneratorExtensions.cs index e344b16..457dfdf 100644 --- a/src/ReactiveMarbles.RoslynHelpers/RoslynGeneratorExtensions.cs +++ b/src/ReactiveMarbles.RoslynHelpers/RoslynGeneratorExtensions.cs @@ -2,6 +2,8 @@ // ReactiveUI Association Incorporated licenses this file to you under the MIT license. // See the LICENSE file in the project root for full license information. +#pragma warning disable + using System; using System.Collections.Generic; using System.Collections.Immutable; @@ -115,12 +117,10 @@ public static IEnumerable GetMembers(this INamedTypeSymbol symbol) { var member = members[i]; - if (member is not T targetSymbol) + if (member is T targetSymbol) { - continue; + yield return targetSymbol; } - - yield return targetSymbol; } } @@ -148,7 +148,7 @@ public static IEnumerable GetEvents(this INamedTypeSymbol item, bo { var member = members[memberIndex]; - if (member is not IEventSymbol eventSymbol) + if (!(member is IEventSymbol eventSymbol)) { continue; } @@ -238,7 +238,7 @@ public static IEnumerable GetBaseTypesAndThis(this T type) where T : ITypeSymbol { var current = type; - while (current is not null) + while (current != null) { yield return current; current = (T?)current.BaseType; @@ -261,7 +261,7 @@ public static IEnumerable GetBaseTypesAndThis(this T type, Func } var current = type; - while (current is not null) + while (current != null) { if (condition.Invoke(current)) { @@ -311,7 +311,7 @@ public static IEnumerable GetBasesWithCondition(this T symbol, Func