当前位置: 首页>>代码示例>>C#>>正文


C# CSharpSyntaxNode.GetLocation方法代码示例

本文整理汇总了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));
 }
开发者ID:ElemarJR,项目名称:raven.codeanalysis,代码行数:7,代码来源:GetConfigurationEntryKeyAnalyzer.cs

示例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);
            }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:24,代码来源:MethodToClassRewriter.cs

示例3: AddAnalysisPoint

 private BoundStatement AddAnalysisPoint(CSharpSyntaxNode syntaxForSpan, SyntheticBoundNodeFactory statementFactory)
 {
     return AddAnalysisPoint(syntaxForSpan, syntaxForSpan.GetLocation().GetMappedLineSpan(), statementFactory);
 }
开发者ID:xeronith,项目名称:roslyn,代码行数:4,代码来源:DynamicAnalysisInjector.cs

示例4: GetSourceDocument

 private Cci.DebugSourceDocument GetSourceDocument(CSharpSyntaxNode syntax)
 {
     return GetSourceDocument(syntax, syntax.GetLocation().GetMappedLineSpan());
 }
开发者ID:xeronith,项目名称:roslyn,代码行数:4,代码来源:DynamicAnalysisInjector.cs

示例5: ReportDiagnostic

		private static void ReportDiagnostic(
			SyntaxNodeAnalysisContext context,
			CSharpSyntaxNode syntaxNode)
		{
			context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.ConfigureAwait, syntaxNode.GetLocation()));
		}
开发者ID:ElemarJR,项目名称:raven.codeanalysis,代码行数:6,代码来源:ConfigureAwaitAnalyzer.cs

示例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));
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:13,代码来源:DynamicAnalysisInjector.cs


注:本文中的CSharpSyntaxNode.GetLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。