本文整理汇总了C#中CSharpSyntaxNode.GetLocation方法的典型用法代码示例。如果您正苦于以下问题:C# CSharpSyntaxNode.GetLocation方法的具体用法?C# CSharpSyntaxNode.GetLocation怎么用?C# CSharpSyntaxNode.GetLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSharpSyntaxNode
的用法示例。
在下文中一共展示了CSharpSyntaxNode.GetLocation方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReportDiagnostic
private static void ReportDiagnostic(
SyntaxNodeAnalysisContext context,
CSharpSyntaxNode syntaxNode,
string propertyName)
{
context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.GetConfigurationEntryKey, syntaxNode.GetLocation(), propertyName));
}
示例2: BaseMethodWrapperSymbol
internal BaseMethodWrapperSymbol(NamedTypeSymbol containingType, MethodSymbol methodBeingWrapped, CSharpSyntaxNode syntax, string name)
: base(containingType, methodBeingWrapped, syntax.SyntaxTree.GetReference(syntax), null, syntax.GetLocation(), name, DeclarationModifiers.Private)
{
Debug.Assert(containingType.ContainingModule is SourceModuleSymbol);
Debug.Assert(ReferenceEquals(methodBeingWrapped, methodBeingWrapped.ConstructedFrom));
Debug.Assert(!methodBeingWrapped.IsStatic);
TypeMap typeMap = null;
ImmutableArray<TypeParameterSymbol> typeParameters;
var substitutedType = methodBeingWrapped.ContainingType as SubstitutedNamedTypeSymbol;
typeMap = ((object)substitutedType == null ? TypeMap.Empty : substitutedType.TypeSubstitution);
if (!methodBeingWrapped.IsGenericMethod)
{
typeParameters = ImmutableArray<TypeParameterSymbol>.Empty;
}
else
{
typeMap = typeMap.WithAlphaRename(methodBeingWrapped, this, out typeParameters);
}
AssignTypeMapAndTypeParameters(typeMap, typeParameters);
}
示例3: AddAnalysisPoint
private BoundStatement AddAnalysisPoint(CSharpSyntaxNode syntaxForSpan, SyntheticBoundNodeFactory statementFactory)
{
return AddAnalysisPoint(syntaxForSpan, syntaxForSpan.GetLocation().GetMappedLineSpan(), statementFactory);
}
示例4: GetSourceDocument
private Cci.DebugSourceDocument GetSourceDocument(CSharpSyntaxNode syntax)
{
return GetSourceDocument(syntax, syntax.GetLocation().GetMappedLineSpan());
}
示例5: ReportDiagnostic
private static void ReportDiagnostic(
SyntaxNodeAnalysisContext context,
CSharpSyntaxNode syntaxNode)
{
context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.ConfigureAwait, syntaxNode.GetLocation()));
}
示例6: AddAnalysisPoint
private BoundStatement AddAnalysisPoint(CSharpSyntaxNode syntaxForSpan, SyntheticBoundNodeFactory statementFactory)
{
// Add an entry in the spans array.
FileLinePositionSpan spanPosition = syntaxForSpan.GetLocation().GetMappedLineSpan();
int spansIndex = _spansBuilder.Count;
_spansBuilder.Add(new SourceSpan(GetSourceDocument(syntaxForSpan, spanPosition), spanPosition.StartLinePosition.Line, spanPosition.StartLinePosition.Character, spanPosition.EndLinePosition.Line, spanPosition.EndLinePosition.Character));
// Generate "_payload[pointIndex] = true".
BoundArrayAccess payloadCell = statementFactory.ArrayAccess(statementFactory.Local(_methodPayload), statementFactory.Literal(spansIndex));
return statementFactory.Assignment(payloadCell, statementFactory.Literal(true));
}