@@ -23,35 +23,11 @@ internal abstract class AbstractRefactoringHelpersService : IRefactoringHelpersS
cancellationToken).ConfigureAwait(false);
}
//TODO: Rework comment
/// <summary>
/// <para>
/// Returns a Node for refactoring given specified selection that passes <paramref name="predicate"/>
/// or null if no such instance exists.
/// </para>
/// <para>
/// A node instance is return if:
/// - Selection is zero-width and inside/touching a Token with direct parent passing <paramref name="predicate"/>.
/// - Selection is zero-width and touching a Token whose ancestor Node passing <paramref name="predicate"/> ends/starts precisely on current selection.
/// - Token whose direct parent passing <paramref name="predicate"/> is selected.
/// - Whole node passing <paramref name="predicate"/> is selected.
/// </para>
/// <para>
/// The <paramref name="extractNodes"/> enables testing with <paramref name="predicate"/> and potentially returning Nodes
/// that are under/above those that might be selected / considered (as described above). It should iterate over all candidate
/// nodes.
/// </para>
/// <para>
/// Note: this function trims all whitespace from both the beginning and the end of given <paramref name="selectionRaw"/>.
/// The trimmed version is then used to determine relevant <see cref="SyntaxNode"/>. It also handles incomplete selections
/// of tokens gracefully. Over-selection containing leading comments is also handled correctly.
/// with that and only that node. On the other hand placing cursor anywhere in header should still count as selecting the node it's header of.
/// </para>
/// </summary>
///
/// <summary>
/// Extractor function that retrieves all nodes that should be considered for <see cref="TryGetSelectedNodeAsync(Document, TextSpan, Func{SyntaxNode, bool}, Func{SyntaxNode, ISyntaxFactsService, IEnumerable{SyntaxNode}}, Func{SyntaxNode, int, ISyntaxFactsService, IEnumerable{SyntaxNode}}, CancellationToken)"/>
/// given current node.
/// <para>
/// The rationale is that when user selects e.g. entire local declaration statement [|var a = b;|] it is reasonable
/// to provide refactoring for `b` node. Similarly for other types of refactorings.
/// Extractor function that checks and retrieves all nodes current location is in a header of <see cref="TryGetSelectedNodeAsync(Document, TextSpan, Func{SyntaxNode, bool}, Func{SyntaxNode, ISyntaxFactsService, IEnumerable{SyntaxNode}}, Func{SyntaxNode, int, ISyntaxFactsService, IEnumerable{SyntaxNode}}, CancellationToken)"/>.
/// A <typeparamref name="TSyntaxNode"/> instance is returned if:
/// - Selection is zero-width and inside/touching a Token with direct parent of type <typeparamref name="TSyntaxNode"/>.
/// - Selection is zero-width and touching a Token whose ancestor ends/starts precisely on current selection .
/// - Selection is zero-width and touching a Token whose ancestor of type <typeparamref name="TSyntaxNode"/> ends/starts precisely on current selection.
/// - Selection is zero-width and in whitespace that corresponds to a Token whose direct ancestor is of type of type <typeparamref name="TSyntaxNode"/>.
/// - Selection is zero-width and in a header (defined by ISyntaxFacts helpers) of an node of type of type <typeparamref name="TSyntaxNode"/>.
/// - Token whose direct parent of type <typeparamref name="TSyntaxNode"/> is selected.
/// - Whole node of a type <typeparamref name="TSyntaxNode"/> is selected.
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.