提交 e44145c7 编写于 作者: M Manish Vasani

Add missing xml documentation comments for few public IOperation APIs

Fixes #22692
上级 a821d651
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.Semantics
{
/// <summary>
/// Represents an initializer for a field, property, or parameter.
/// Represents an initializer for a field, property, parameter or a local variable declaration.
/// </summary>
/// <remarks>
/// This interface is reserved for implementation by its associated APIs. We reserve the right to
......@@ -13,6 +11,9 @@ namespace Microsoft.CodeAnalysis.Semantics
/// </remarks>
public interface ISymbolInitializer : IOperation
{
/// <summary>
/// Underlying initializer value.
/// </summary>
IOperation Value { get; }
}
}
......
......@@ -6,7 +6,6 @@
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.PooledObjects;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.Semantics
{
......@@ -38,11 +37,19 @@ internal static bool HasErrors(this IOperation operation, Compilation compilatio
return model.GetDiagnostics(operation.Syntax.Span, cancellationToken).Any(d => d.DefaultSeverity == DiagnosticSeverity.Error);
}
/// <summary>
/// Returns all the descendant operations of the given <paramref name="operation"/> in evaluation order.
/// </summary>
/// <param name="operation">Operation whose descendants are to be fetched.</param>
public static IEnumerable<IOperation> Descendants(this IOperation operation)
{
return Descendants(operation, includeSelf: false);
}
/// <summary>
/// Returns all the descendant operations of the given <paramref name="operation"/> including the given <paramref name="operation"/> in evaluation order.
/// </summary>
/// <param name="operation">Operation whose descendants are to be fetched.</param>
public static IEnumerable<IOperation> DescendantsAndSelf(this IOperation operation)
{
return Descendants(operation, includeSelf: true);
......@@ -88,6 +95,10 @@ private static IEnumerable<IOperation> Descendants(IOperation operation, bool in
stack.Free();
}
/// <summary>
/// Gets all the declared local variables in the given <paramref name="declarationStatement"/>.
/// </summary>
/// <param name="declarationStatement">Variable declaration statement</param>
public static ImmutableArray<ILocalSymbol> GetDeclaredVariables(this IVariableDeclarationStatement declarationStatement)
{
if (declarationStatement == null)
......
......@@ -9,6 +9,9 @@ namespace Microsoft.CodeAnalysis
/// </summary>
public enum OperationKind
{
/// <summary>
/// Indicates an <see cref="IOperation"/> for an not yet implemented semantic construct.
/// </summary>
None = 0x0,
// Statements
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册