add csharpier

This commit is contained in:
Adam Hathcock
2024-05-21 16:34:46 +01:00
parent 1734d5162a
commit e341772cbc
110 changed files with 1096 additions and 656 deletions
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source.AkkaActor
{
public partial interface ILocalActorRefProvider
{
}
}
public partial interface ILocalActorRefProvider { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source.AkkaActor
{
public partial interface ILocalActorRefProvider
{
}
}
public partial interface ILocalActorRefProvider { }
}
@@ -1,5 +1,3 @@
namespace ProxyInterfaceSourceGeneratorTests.Source;
public class Bar
{
}
public class Bar { }
@@ -1,7 +1,5 @@
// ReSharper disable once CheckNamespace
namespace ProxyInterfaceSourceGeneratorTests.Namespace1
{
public class ClassInNamespace
{
}
}
public class ClassInNamespace { }
}
@@ -1,7 +1,5 @@
// ReSharper disable once CheckNamespace
namespace ProxyInterfaceSourceGeneratorTests.Namespace2
{
public class ClassInNamespace
{
}
}
public class ClassInNamespace { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
{
public class Child : Parent
{
}
}
public class Child : Parent { }
}
@@ -6,15 +6,8 @@ namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
event EventHandler<string>? IUpdate<string>.Update
{
add
{
throw new NotSupportedException();
}
remove
{
throw new NotSupportedException();
}
add { throw new NotSupportedException(); }
remove { throw new NotSupportedException(); }
}
void IDisposable.Dispose()
@@ -22,4 +15,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
throw new NotSupportedException();
}
}
}
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
{
public partial interface IChild
{
}
}
public partial interface IChild { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
{
public partial interface IExplicit
{
}
}
public partial interface IExplicit { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
{
public partial interface IParent
{
}
}
public partial interface IParent { }
}
@@ -6,4 +6,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
string Name { get; }
}
}
}
@@ -42,4 +42,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source.Disposable
// Dispose(disposing: false);
// }
}
}
}
@@ -20,13 +20,15 @@ public class Foo2
//}
[SuppressMessage("ReSharper", "NullableWarningSuppressionIsUsed")]
public Foo2[] Foos { get; set; }= null!;
public Foo2[] Foos { get; set; } = null!;
public Foo2[] DoSomethingAndGetAnArrayOfFoos()
{
return new[] { new Foo2() };
}
public int Weird { get; set; }
public int Weird2()
{
return 0;
@@ -7,4 +7,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return value;
}
}
}
}
@@ -6,9 +6,6 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
public string GetterOnly => "x";
public void Dispose()
{
}
public void Dispose() { }
}
}
}
@@ -1,7 +1,5 @@
// ReSharper disable once CheckNamespace
namespace ProxyInterfaceSourceGeneratorTests.Namespace1
{
public partial interface IClassInNamespace
{
}
}
public partial interface IClassInNamespace { }
}
@@ -1,7 +1,5 @@
// ReSharper disable once CheckNamespace
namespace ProxyInterfaceSourceGeneratorTests.Namespace2
{
public partial interface IClassInNamespace
{
}
}
public partial interface IClassInNamespace { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface IFoo
{
}
}
public partial interface IFoo { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface IFoo2
{
}
}
public partial interface IFoo2 { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface IGeneric
{
}
}
public partial interface IGeneric { }
}
@@ -1,5 +1,3 @@
namespace ProxyInterfaceSourceGeneratorTests.Source;
public partial interface IHttpClient : IHttpMessageInvoker
{
}
public partial interface IHttpClient : IHttpMessageInvoker { }
@@ -1,5 +1,3 @@
namespace ProxyInterfaceSourceGeneratorTests.Source;
public partial interface IHttpMessageInvoker
{
}
public partial interface IHttpMessageInvoker { }
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface IHuman
{
}
}
public partial interface IHuman { }
}
@@ -1,5 +1,3 @@
namespace ProxyInterfaceSourceGeneratorTests.Source;
public partial interface IMixedVisibility
{
}
public partial interface IMixedVisibility { }
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface IMyStruct
{
}
}
public partial interface IMyStruct { }
}
@@ -1,4 +1,2 @@
// ReSharper disable once CheckNamespace
public partial interface INoNamespace
{
}
public partial interface INoNamespace { }
@@ -1,6 +1,4 @@
// file-scoped namespace !
namespace ProxyInterfaceSourceGeneratorTests.Source;
public partial interface IOperatorTest
{
}
public partial interface IOperatorTest { }
@@ -1,6 +1,4 @@
// file-scoped namespace !
namespace ProxyInterfaceSourceGeneratorTests.Source;
public partial interface IPerson : IHuman
{
}
public partial interface IPerson : IHuman { }
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface IPersonExtends
{
}
}
public partial interface IPersonExtends { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public partial interface ITestClassInternal
{
}
}
public partial interface ITestClassInternal { }
}
@@ -6,7 +6,5 @@ using System.Threading.Tasks;
namespace ProxyInterfaceSourceGeneratorTests.Source
{
public interface IÜberGeneric
{
}
public interface IÜberGeneric { }
}
@@ -5,5 +5,5 @@ namespace ProxyInterfaceSourceGeneratorTests.Source;
public class MixedVisibility
{
[SuppressMessage("ReSharper", "NullableWarningSuppressionIsUsed")]
public string Foo { get; protected set; } = null!;//<- this will generate bad code
public string Foo { get; protected set; } = null!; //<- this will generate bad code
}
@@ -3,4 +3,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source;
public struct MyStruct
{
public int Id { get; set; }
}
}
@@ -3,4 +3,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source;
public class NoNamespace
{
public bool Test { get; set; }
}
}
@@ -9,18 +9,12 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
// Operator : implicit
public static implicit operator OperatorTest(string name)
{
return new()
{
Name = name
};
return new() { Name = name };
}
public static implicit operator OperatorTest(int? id)
{
return new()
{
Id = id
};
return new() { Id = id };
}
// Operator : explicit
@@ -43,4 +37,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
var s = (string)operatorTest;
}
}
}
}
@@ -25,23 +25,25 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
public IList<Human> AddHuman(Human h)
{
return new List<Human> { h, new Human { IsAlive = true } };
return new List<Human>
{
h,
new Human { IsAlive = true }
};
}
[Display(ResourceType = typeof(PeriodicTimer))]
[SuppressMessage("ReSharper", "NullableWarningSuppressionIsUsed")]
public string Name { get; set; }= null!;
public string Name { get; set; } = null!;
public string? StringNullable { get; set; }
public long? NullableLong { get; }
[SuppressMessage("ReSharper", "NullableWarningSuppressionIsUsed")]
public object @object { get; set; }= null!;
public object @object { get; set; } = null!;
public void Void()
{
}
public void Void() { }
public string HelloWorld(string name)
{
@@ -68,9 +70,7 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return $"Hello {ch} !";
}
public void WithParams(params string[] values)
{
}
public void WithParams(params string[] values) { }
public string Add(string s, string @string)
{
@@ -117,11 +117,14 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return Task.FromResult((string?)"");
}
public void CreateInvokeHttpClient(int i = 5, string? appId = null, IReadOnlyDictionary<string, string>? metadata = null, CancellationToken token = default)
{
}
public void CreateInvokeHttpClient(
int i = 5,
string? appId = null,
IReadOnlyDictionary<string, string>? metadata = null,
CancellationToken token = default
) { }
public bool TryParse(string s1, [NotNullWhen(true)]params int[]? ii)
public bool TryParse(string s1, [NotNullWhen(true)] params int[]? ii)
{
ii = null;
return false;
@@ -17,18 +17,14 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
public object @object { get; set; } = null!;
public void Void()
{
}
public void Void() { }
public string HelloWorld(string name)
{
return $"Hello {name} !";
}
public void WithParams(params string[] values)
{
}
public void WithParams(params string[] values) { }
public string Add(string s, string @string)
{
@@ -67,4 +63,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
return Task.FromResult((string?)"");
}
}
}
}
@@ -2,8 +2,5 @@ using Microsoft.SharePoint.Client;
namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
{
public partial interface IClientContext
{
}
}
public partial interface IClientContext { }
}
@@ -1,6 +1,4 @@
namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
{
public partial interface IClientObject
{
}
public partial interface IClientObject { }
}
@@ -1,8 +1,6 @@
namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
{
public partial interface IClientRuntimeContext
{
}
public partial interface IClientRuntimeContext { }
}
namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
@@ -22,6 +20,5 @@ namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
//{
// var x = CastTo2<ClientObjectProxy>(new ClientObjectProxy(default));
//}
}
}
}
@@ -3,7 +3,5 @@ using Microsoft.SharePoint.Client;
namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
{
// [ProxyInterfaceGenerator.Proxy(typeof(SecurableObject))]
public partial interface ISecurableObject : IClientObject
{
}
}
public partial interface ISecurableObject : IClientObject { }
}
@@ -2,7 +2,5 @@ using Microsoft.SharePoint.Client;
namespace ProxyInterfaceSourceGeneratorTests.Source.PnP
{
public partial interface IWeb : ISecurableObject
{
}
}
public partial interface IWeb : ISecurableObject { }
}
@@ -4,4 +4,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
{
public bool Test { get; set; }
}
}
}
@@ -14,4 +14,4 @@ namespace ProxyInterfaceSourceGeneratorTests.Source
public TKey Test(TKey value) => value;
}
}
}