68 references to CSharpExtensions
Microsoft.CodeAnalysis.CSharp (2)
Syntax\SyntaxTokenParser.cs (2)
61
/// token parser to the end of the leading trivia of the next token. The returned result will have a token with <see cref="
CSharpExtensions
.Kind(SyntaxToken)"/>
76
/// token parser to the end of the trailing trivia from the current location. The returned result will have a token with <see cref="
CSharpExtensions
.Kind(SyntaxToken)"/>
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (49)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
808
switch (
CSharpExtensions
.Kind(context.Node.Parent))
FlowAnalysis\RegionAnalysisTests.cs (2)
2674
(model, constructorInitializer) =>
CSharpExtensions
.AnalyzeDataFlow(model, constructorInitializer)
2809
(model, primaryConstructorInitializer) =>
CSharpExtensions
.AnalyzeDataFlow(model, primaryConstructorInitializer)
Semantics\PrimaryConstructorTests.cs (23)
1091
Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)",
CSharpExtensions
.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString());
1101
Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)",
CSharpExtensions
.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString());
1198
Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])",
CSharpExtensions
.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString());
1202
Assert.Empty(
CSharpExtensions
.GetMemberGroup(model, baseWithargs).Select(m => m.ToTestDisplayString()));
2131
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
2150
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
2170
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer);
2182
Assert.Equal("Base..ctor(System.Int32 X)",
CSharpExtensions
.GetSymbolInfo(speculativeModel, speculativePrimaryInitializer).Symbol.ToTestDisplayString());
2193
Assert.Equal("Base..ctor(System.Int32 X)",
CSharpExtensions
.GetSymbolInfo(speculativeModel, speculativePrimaryInitializer).Symbol.ToTestDisplayString());
2201
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, otherBasePosition, speculativePrimaryInitializer);
2207
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.SpanStart, speculativePrimaryInitializer);
2213
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer);
2232
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
2239
Assert.Empty(
CSharpExtensions
.GetMemberGroup(model, baseWithargs).Select(m => m.ToTestDisplayString()));
2249
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer);
2308
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
2322
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer);
2340
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, otherBasePosition, speculativePrimaryInitializer);
2346
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.SpanStart, speculativePrimaryInitializer);
2352
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer);
2371
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
2378
Assert.Empty(
CSharpExtensions
.GetMemberGroup(model, baseWithargs).Select(m => m.ToTestDisplayString()));
2388
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer);
Semantics\RecordTests.cs (23)
21163
Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)",
CSharpExtensions
.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString());
21173
Assert.Equal("Base..ctor(System.Int32 X, System.Int32 Y)",
CSharpExtensions
.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString());
21272
Assert.Equal("C..ctor(System.Int32 X, [System.Int32 Y = 123])",
CSharpExtensions
.GetSymbolInfo(model, baseWithargs).Symbol.ToTestDisplayString());
21276
Assert.Empty(
CSharpExtensions
.GetMemberGroup(model, baseWithargs).Select(m => m.ToTestDisplayString()));
22243
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
22262
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
22282
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer);
22294
Assert.Equal("Base..ctor(System.Int32 X)",
CSharpExtensions
.GetSymbolInfo(speculativeModel, speculativePrimaryInitializer).Symbol.ToTestDisplayString());
22305
Assert.Equal("Base..ctor(System.Int32 X)",
CSharpExtensions
.GetSymbolInfo(speculativeModel, speculativePrimaryInitializer).Symbol.ToTestDisplayString());
22313
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, otherBasePosition, speculativePrimaryInitializer);
22319
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.SpanStart, speculativePrimaryInitializer);
22325
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer);
22344
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
22351
Assert.Empty(
CSharpExtensions
.GetMemberGroup(model, baseWithargs).Select(m => m.ToTestDisplayString()));
22361
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer);
22420
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
22434
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer);
22452
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, otherBasePosition, speculativePrimaryInitializer);
22458
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.SpanStart, speculativePrimaryInitializer);
22464
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativePrimaryInitializer);
22483
symbolInfo =
CSharpExtensions
.GetSymbolInfo(model, baseWithargs);
22490
Assert.Empty(
CSharpExtensions
.GetMemberGroup(model, baseWithargs).Select(m => m.ToTestDisplayString()));
22500
symbolInfo =
CSharpExtensions
.GetSpeculativeSymbolInfo(model, baseWithargs.ArgumentList.OpenParenToken.SpanStart, speculativeBaseInitializer);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\LambdaTests.cs (1)
1130
CSharpExtensions
.GetSymbolInfo(model, name);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (1)
75
Constraint = "Most trees do not have using alias directives, so avoid the expensive " + nameof(
CSharpExtensions
.GetSymbolInfo) + " call for this case.")]
Microsoft.CodeAnalysis.Test.Utilities (6)
Compilation\TestOperationVisitor.cs (6)
851
CSharp.Conversion csharpConversion = CSharp.
CSharpExtensions
.GetConversion(operation);
856
Assert.Throws<ArgumentException>(() => CSharp.
CSharpExtensions
.GetConversion(operation));
1180
var inConversionInternal = CSharp.
CSharpExtensions
.GetInConversion(operation);
1181
var outConversionInternal = CSharp.
CSharpExtensions
.GetOutConversion(operation);
1185
Assert.Throws<ArgumentException>("compoundAssignment", () => CSharp.
CSharpExtensions
.GetInConversion(operation));
1186
Assert.Throws<ArgumentException>("compoundAssignment", () => CSharp.
CSharpExtensions
.GetOutConversion(operation));
Microsoft.CodeAnalysis.UnitTests (8)
CommonSyntaxTests.cs (8)
24
Assert.True(CS.
CSharpExtensions
.IsCSharpKind((int)kind), kind + " should be C# kind");
38
Assert.False(CS.
CSharpExtensions
.IsCSharpKind((int)kind), kind + " should not be C# kind");
117
Assert.Equal(CSharp.SyntaxKind.MultiLineCommentTrivia, CSharp.
CSharpExtensions
.Kind(csharpTrivia));
198
Assert.Equal(CSharp.SyntaxKind.None, CSharp.
CSharpExtensions
.Kind(node));
200
Assert.Equal(CSharp.SyntaxKind.None, CSharp.
CSharpExtensions
.Kind(token));
202
Assert.Equal(CSharp.SyntaxKind.None, CSharp.
CSharpExtensions
.Kind(trivia));
223
Assert.Equal(CSharp.SyntaxKind.ParenthesizedExpression, CSharp.
CSharpExtensions
.Kind(trackedB.Parent));
246
Assert.Equal(CSharp.SyntaxKind.ParenthesizedExpression, CSharp.
CSharpExtensions
.Kind(trackedB.Parent));
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
CodeCleanup\CodeCleanupTests.cs (1)
354
root = root.ReplaceToken(nextToken, CSharp.SyntaxFactory.Token(nextToken.LeadingTrivia, CSharp.
CSharpExtensions
.Kind(nextToken), nextToken.TrailingTrivia));