Skip to content

Commit 3b8d3c7

Browse files
committed
Include locally-generated files in source control
1 parent d558558 commit 3b8d3c7

130 files changed

Lines changed: 6707 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
namespace StyleCop.Analyzers.Lightup
2+
{
3+
using System;
4+
using System.Collections.Immutable;
5+
using Microsoft.CodeAnalysis;
6+
7+
internal readonly struct IAddressOfOperationWrapper : IOperationWrapper
8+
{
9+
internal const string WrappedTypeName = "Microsoft.CodeAnalysis.Operations.IAddressOfOperation";
10+
private static readonly Type WrappedType;
11+
private static readonly Func<IOperation, IOperation> ReferenceAccessor;
12+
private readonly IOperation operation;
13+
static IAddressOfOperationWrapper()
14+
{
15+
WrappedType = OperationWrapperHelper.GetWrappedType(typeof(IAddressOfOperationWrapper));
16+
ReferenceAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Reference));
17+
}
18+
19+
private IAddressOfOperationWrapper(IOperation operation)
20+
{
21+
this.operation = operation;
22+
}
23+
24+
public IOperation WrappedOperation => this.operation;
25+
public ITypeSymbol Type => this.WrappedOperation.Type;
26+
public IOperation Reference => ReferenceAccessor(this.WrappedOperation);
27+
public static IAddressOfOperationWrapper FromOperation(IOperation operation)
28+
{
29+
if (operation == null)
30+
{
31+
return default;
32+
}
33+
34+
if (!IsInstance(operation))
35+
{
36+
throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
37+
}
38+
39+
return new IAddressOfOperationWrapper(operation);
40+
}
41+
42+
public static bool IsInstance(IOperation operation)
43+
{
44+
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
45+
}
46+
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace StyleCop.Analyzers.Lightup
2+
{
3+
using System;
4+
using System.Collections.Immutable;
5+
using Microsoft.CodeAnalysis;
6+
7+
internal readonly struct IAggregateQueryOperationWrapper : IOperationWrapper
8+
{
9+
internal const string WrappedTypeName = "Microsoft.CodeAnalysis.Operations.IAggregateQueryOperation";
10+
private static readonly Type WrappedType;
11+
private static readonly Func<IOperation, IOperation> GroupAccessor;
12+
private static readonly Func<IOperation, IOperation> AggregationAccessor;
13+
private readonly IOperation operation;
14+
static IAggregateQueryOperationWrapper()
15+
{
16+
WrappedType = OperationWrapperHelper.GetWrappedType(typeof(IAggregateQueryOperationWrapper));
17+
GroupAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Group));
18+
AggregationAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Aggregation));
19+
}
20+
21+
private IAggregateQueryOperationWrapper(IOperation operation)
22+
{
23+
this.operation = operation;
24+
}
25+
26+
public IOperation WrappedOperation => this.operation;
27+
public ITypeSymbol Type => this.WrappedOperation.Type;
28+
public IOperation Group => GroupAccessor(this.WrappedOperation);
29+
public IOperation Aggregation => AggregationAccessor(this.WrappedOperation);
30+
public static IAggregateQueryOperationWrapper FromOperation(IOperation operation)
31+
{
32+
if (operation == null)
33+
{
34+
return default;
35+
}
36+
37+
if (!IsInstance(operation))
38+
{
39+
throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
40+
}
41+
42+
return new IAggregateQueryOperationWrapper(operation);
43+
}
44+
45+
public static bool IsInstance(IOperation operation)
46+
{
47+
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace StyleCop.Analyzers.Lightup
2+
{
3+
using System;
4+
using System.Collections.Immutable;
5+
using Microsoft.CodeAnalysis;
6+
7+
internal readonly struct IAnonymousFunctionOperationWrapper : IOperationWrapper
8+
{
9+
internal const string WrappedTypeName = "Microsoft.CodeAnalysis.Operations.IAnonymousFunctionOperation";
10+
private static readonly Type WrappedType;
11+
private static readonly Func<IOperation, IMethodSymbol> SymbolAccessor;
12+
private static readonly Func<IOperation, IOperation> BodyAccessor;
13+
private readonly IOperation operation;
14+
static IAnonymousFunctionOperationWrapper()
15+
{
16+
WrappedType = OperationWrapperHelper.GetWrappedType(typeof(IAnonymousFunctionOperationWrapper));
17+
SymbolAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IMethodSymbol>(WrappedType, nameof(Symbol));
18+
BodyAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Body));
19+
}
20+
21+
private IAnonymousFunctionOperationWrapper(IOperation operation)
22+
{
23+
this.operation = operation;
24+
}
25+
26+
public IOperation WrappedOperation => this.operation;
27+
public ITypeSymbol Type => this.WrappedOperation.Type;
28+
public IMethodSymbol Symbol => SymbolAccessor(this.WrappedOperation);
29+
public IBlockOperationWrapper Body => IBlockOperationWrapper.FromOperation(BodyAccessor(this.WrappedOperation));
30+
public static IAnonymousFunctionOperationWrapper FromOperation(IOperation operation)
31+
{
32+
if (operation == null)
33+
{
34+
return default;
35+
}
36+
37+
if (!IsInstance(operation))
38+
{
39+
throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
40+
}
41+
42+
return new IAnonymousFunctionOperationWrapper(operation);
43+
}
44+
45+
public static bool IsInstance(IOperation operation)
46+
{
47+
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
namespace StyleCop.Analyzers.Lightup
2+
{
3+
using System;
4+
using System.Collections.Immutable;
5+
using Microsoft.CodeAnalysis;
6+
7+
internal readonly struct IAnonymousObjectCreationOperationWrapper : IOperationWrapper
8+
{
9+
internal const string WrappedTypeName = "Microsoft.CodeAnalysis.Operations.IAnonymousObjectCreationOperation";
10+
private static readonly Type WrappedType;
11+
private static readonly Func<IOperation, ImmutableArray<IOperation>> InitializersAccessor;
12+
private readonly IOperation operation;
13+
static IAnonymousObjectCreationOperationWrapper()
14+
{
15+
WrappedType = OperationWrapperHelper.GetWrappedType(typeof(IAnonymousObjectCreationOperationWrapper));
16+
InitializersAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Initializers));
17+
}
18+
19+
private IAnonymousObjectCreationOperationWrapper(IOperation operation)
20+
{
21+
this.operation = operation;
22+
}
23+
24+
public IOperation WrappedOperation => this.operation;
25+
public ITypeSymbol Type => this.WrappedOperation.Type;
26+
public ImmutableArray<IOperation> Initializers => InitializersAccessor(this.WrappedOperation);
27+
public static IAnonymousObjectCreationOperationWrapper FromOperation(IOperation operation)
28+
{
29+
if (operation == null)
30+
{
31+
return default;
32+
}
33+
34+
if (!IsInstance(operation))
35+
{
36+
throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
37+
}
38+
39+
return new IAnonymousObjectCreationOperationWrapper(operation);
40+
}
41+
42+
public static bool IsInstance(IOperation operation)
43+
{
44+
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
45+
}
46+
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
namespace StyleCop.Analyzers.Lightup
2+
{
3+
using System;
4+
using System.Collections.Immutable;
5+
using Microsoft.CodeAnalysis;
6+
7+
internal readonly struct IArgumentOperationWrapper : IOperationWrapper
8+
{
9+
internal const string WrappedTypeName = "Microsoft.CodeAnalysis.Operations.IArgumentOperation";
10+
private static readonly Type WrappedType;
11+
private static readonly Func<IOperation, IParameterSymbol> ParameterAccessor;
12+
private static readonly Func<IOperation, IOperation> ValueAccessor;
13+
private readonly IOperation operation;
14+
static IArgumentOperationWrapper()
15+
{
16+
WrappedType = OperationWrapperHelper.GetWrappedType(typeof(IArgumentOperationWrapper));
17+
ParameterAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IParameterSymbol>(WrappedType, nameof(Parameter));
18+
ValueAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Value));
19+
}
20+
21+
private IArgumentOperationWrapper(IOperation operation)
22+
{
23+
this.operation = operation;
24+
}
25+
26+
public IOperation WrappedOperation => this.operation;
27+
public ITypeSymbol Type => this.WrappedOperation.Type;
28+
public object ArgumentKind => throw new NotImplementedException("Property 'IArgumentOperation.ArgumentKind' has unsupported type 'ArgumentKind'");
29+
public IParameterSymbol Parameter => ParameterAccessor(this.WrappedOperation);
30+
public IOperation Value => ValueAccessor(this.WrappedOperation);
31+
public object InConversion => throw new NotImplementedException("Property 'IArgumentOperation.InConversion' has unsupported type 'CommonConversion'");
32+
public object OutConversion => throw new NotImplementedException("Property 'IArgumentOperation.OutConversion' has unsupported type 'CommonConversion'");
33+
public static IArgumentOperationWrapper FromOperation(IOperation operation)
34+
{
35+
if (operation == null)
36+
{
37+
return default;
38+
}
39+
40+
if (!IsInstance(operation))
41+
{
42+
throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
43+
}
44+
45+
return new IArgumentOperationWrapper(operation);
46+
}
47+
48+
public static bool IsInstance(IOperation operation)
49+
{
50+
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
51+
}
52+
}
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace StyleCop.Analyzers.Lightup
2+
{
3+
using System;
4+
using System.Collections.Immutable;
5+
using Microsoft.CodeAnalysis;
6+
7+
internal readonly struct IArrayCreationOperationWrapper : IOperationWrapper
8+
{
9+
internal const string WrappedTypeName = "Microsoft.CodeAnalysis.Operations.IArrayCreationOperation";
10+
private static readonly Type WrappedType;
11+
private static readonly Func<IOperation, ImmutableArray<IOperation>> DimensionSizesAccessor;
12+
private static readonly Func<IOperation, IOperation> InitializerAccessor;
13+
private readonly IOperation operation;
14+
static IArrayCreationOperationWrapper()
15+
{
16+
WrappedType = OperationWrapperHelper.GetWrappedType(typeof(IArrayCreationOperationWrapper));
17+
DimensionSizesAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(DimensionSizes));
18+
InitializerAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(Initializer));
19+
}
20+
21+
private IArrayCreationOperationWrapper(IOperation operation)
22+
{
23+
this.operation = operation;
24+
}
25+
26+
public IOperation WrappedOperation => this.operation;
27+
public ITypeSymbol Type => this.WrappedOperation.Type;
28+
public ImmutableArray<IOperation> DimensionSizes => DimensionSizesAccessor(this.WrappedOperation);
29+
public IArrayInitializerOperationWrapper Initializer => IArrayInitializerOperationWrapper.FromOperation(InitializerAccessor(this.WrappedOperation));
30+
public static IArrayCreationOperationWrapper FromOperation(IOperation operation)
31+
{
32+
if (operation == null)
33+
{
34+
return default;
35+
}
36+
37+
if (!IsInstance(operation))
38+
{
39+
throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
40+
}
41+
42+
return new IArrayCreationOperationWrapper(operation);
43+
}
44+
45+
public static bool IsInstance(IOperation operation)
46+
{
47+
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace StyleCop.Analyzers.Lightup
2+
{
3+
using System;
4+
using System.Collections.Immutable;
5+
using Microsoft.CodeAnalysis;
6+
7+
internal readonly struct IArrayElementReferenceOperationWrapper : IOperationWrapper
8+
{
9+
internal const string WrappedTypeName = "Microsoft.CodeAnalysis.Operations.IArrayElementReferenceOperation";
10+
private static readonly Type WrappedType;
11+
private static readonly Func<IOperation, IOperation> ArrayReferenceAccessor;
12+
private static readonly Func<IOperation, ImmutableArray<IOperation>> IndicesAccessor;
13+
private readonly IOperation operation;
14+
static IArrayElementReferenceOperationWrapper()
15+
{
16+
WrappedType = OperationWrapperHelper.GetWrappedType(typeof(IArrayElementReferenceOperationWrapper));
17+
ArrayReferenceAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, IOperation>(WrappedType, nameof(ArrayReference));
18+
IndicesAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IOperation>>(WrappedType, nameof(Indices));
19+
}
20+
21+
private IArrayElementReferenceOperationWrapper(IOperation operation)
22+
{
23+
this.operation = operation;
24+
}
25+
26+
public IOperation WrappedOperation => this.operation;
27+
public ITypeSymbol Type => this.WrappedOperation.Type;
28+
public IOperation ArrayReference => ArrayReferenceAccessor(this.WrappedOperation);
29+
public ImmutableArray<IOperation> Indices => IndicesAccessor(this.WrappedOperation);
30+
public static IArrayElementReferenceOperationWrapper FromOperation(IOperation operation)
31+
{
32+
if (operation == null)
33+
{
34+
return default;
35+
}
36+
37+
if (!IsInstance(operation))
38+
{
39+
throw new InvalidCastException($"Cannot cast '{operation.GetType().FullName}' to '{WrappedTypeName}'");
40+
}
41+
42+
return new IArrayElementReferenceOperationWrapper(operation);
43+
}
44+
45+
public static bool IsInstance(IOperation operation)
46+
{
47+
return operation != null && LightupHelpers.CanWrapOperation(operation, WrappedType);
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)