From e44145c7141f792d65e283b7d1c9e896dcbc4003 Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Fri, 13 Oct 2017 16:18:10 -0700 Subject: [PATCH] Add missing xml documentation comments for few public IOperation APIs Fixes #22692 --- .../Core/Portable/Operations/ISymbolInitializer.cs | 7 ++++--- .../Core/Portable/Operations/OperationExtensions.cs | 13 ++++++++++++- .../Core/Portable/Operations/OperationKind.cs | 3 +++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Compilers/Core/Portable/Operations/ISymbolInitializer.cs b/src/Compilers/Core/Portable/Operations/ISymbolInitializer.cs index aa0b7333f34..5dd8fe8cdd5 100644 --- a/src/Compilers/Core/Portable/Operations/ISymbolInitializer.cs +++ b/src/Compilers/Core/Portable/Operations/ISymbolInitializer.cs @@ -1,11 +1,9 @@ // 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 { /// - /// Represents an initializer for a field, property, or parameter. + /// Represents an initializer for a field, property, parameter or a local variable declaration. /// /// /// This interface is reserved for implementation by its associated APIs. We reserve the right to @@ -13,6 +11,9 @@ namespace Microsoft.CodeAnalysis.Semantics /// public interface ISymbolInitializer : IOperation { + /// + /// Underlying initializer value. + /// IOperation Value { get; } } } diff --git a/src/Compilers/Core/Portable/Operations/OperationExtensions.cs b/src/Compilers/Core/Portable/Operations/OperationExtensions.cs index 124f04a9a71..144840d95c4 100644 --- a/src/Compilers/Core/Portable/Operations/OperationExtensions.cs +++ b/src/Compilers/Core/Portable/Operations/OperationExtensions.cs @@ -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); } + /// + /// Returns all the descendant operations of the given in evaluation order. + /// + /// Operation whose descendants are to be fetched. public static IEnumerable Descendants(this IOperation operation) { return Descendants(operation, includeSelf: false); } + /// + /// Returns all the descendant operations of the given including the given in evaluation order. + /// + /// Operation whose descendants are to be fetched. public static IEnumerable DescendantsAndSelf(this IOperation operation) { return Descendants(operation, includeSelf: true); @@ -88,6 +95,10 @@ private static IEnumerable Descendants(IOperation operation, bool in stack.Free(); } + /// + /// Gets all the declared local variables in the given . + /// + /// Variable declaration statement public static ImmutableArray GetDeclaredVariables(this IVariableDeclarationStatement declarationStatement) { if (declarationStatement == null) diff --git a/src/Compilers/Core/Portable/Operations/OperationKind.cs b/src/Compilers/Core/Portable/Operations/OperationKind.cs index 54e3971b361..79b78acf51d 100644 --- a/src/Compilers/Core/Portable/Operations/OperationKind.cs +++ b/src/Compilers/Core/Portable/Operations/OperationKind.cs @@ -9,6 +9,9 @@ namespace Microsoft.CodeAnalysis /// public enum OperationKind { + /// + /// Indicates an for an not yet implemented semantic construct. + /// None = 0x0, // Statements -- GitLab