/// 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>
/// Attempts extracting (and testing with <paramref name="predicate"/> a Node for each Node it consideres (see above).
/// By default extracts initializer expressions from declarations and assignments.
/// </para>
/// <para>
/// Note: this function trims all whitespace from both the beginning and the end of given <paramref name="selection"/>.
/// The trimmed version is then used to determine relevant <see cref="SyntaxNode"/>. It also handles incomplete selections
/// 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="extractNode"/> enables testing with <paramref name="predicate"/> and potentially returning Nodes
/// that are under those that might be selected / considered (as described above). It is a <see cref="Func{SyntaxNode, SyntaxNode}"/> that
/// should always return either given Node or a Node somewhere below it that should be tested with <paramref name="predicate"/> and
/// potentially returned instead of current Node.
/// </para>
/// <para>
/// Note: this function trims all whitespace from both the beginning and the end of given <paramref name="selection"/>.
/// The trimmed version is then used to determine relevant <see cref="SyntaxNode"/>. It also handles incomplete selections
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
/// 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="extractNode"/> enables testing with <paramref name="predicate"/> and potentially returning Nodes
/// that are under those that might be selected / considered (as described above). It is a <see cref="Func{SyntaxNode, SyntaxNode}"/> that
/// should always return either given Node or a Node somewhere below it that should be tested with <paramref name="predicate"/> and
/// potentially returned instead of current Node.
/// E.g. <see cref="DefaultNodeExtractor(SyntaxNode, ISyntaxFactsService)"/>
/// allows returning right side Expresion node even if whole AssignmentNode is selected.
/// </para>
/// <para>
/// Note: this function strips all whitespace from both the beginning and the end of given <paramref name="selection"/>.
/// The stripped version is then used to determine relevant <see cref="SyntaxNode"/>. It also handles incomplete selections
/// 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>
/// Attempts extracting (and testing with <paramref name="predicate"/> a Node for each Node it consideres (see above).
/// By default extracts initializer expressions from declarations and assignments.
/// </para>
/// <para>
/// Note: this function strips all whitespace from both the beginning and the end of given <paramref name="selection"/>.
/// The stripped version is then used to determine relevant <see cref="SyntaxNode"/>. It also handles incomplete selections
/// Extractor function for <see cref="TryGetSelectedNodeAsync(Document, TextSpan, Predicate{SyntaxNode}, Func{SyntaxNode, ISyntaxFactsService, SyntaxNode}, CancellationToken)"/> methods that retrieves expressions from
/// declarations and assignments. Otherwise returns unchanged <paramref name="node"/>.