提交 4e4e10aa 编写于 作者: P Petr Houška

Improve docs.

上级 86debe42
......@@ -88,10 +88,10 @@ protected async Task<SyntaxNode> TryGetSelectedNodeAsync(Document document, Text
// While we want to do most extractions for both selections and just caret location (empty selection), extractions based
// on type's header node (caret is anywhere in a header of wanted type e.g. `in[||]t A { get; set; }) are limited to
// empty selections. Otherwise `[|int|] A { get; set; }) would trigger all refactorings for Property Decl.
// Thus: selection -> extractParentsOfHeader: false; location -> extractParentsOfHeader
//
// See local function TryGetAcceptedNodeOrExtracted DefaultNodeExtractor for more info.
// Handle selections:
// - The smallest node whose FullSpan includes the whole (trimmed) selection
// - Using FullSpan is important because it handles over-selection with comments
......@@ -294,6 +294,11 @@ private static TextSpan GetSpanWithoutAttributes(SyntaxNode node, SyntaxNode roo
/// 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.
/// </para>
/// <para>
/// The rationale behind <paramref name="extractParentsOfHeader"/> is following. We want to extract a parent Node of header Node/Token
/// if its just for location (empty selection) but not for selection. We assume that if user selects just one node he wants to work
/// 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>
protected virtual SyntaxNode DefaultNodeExtractor(SyntaxNode node, ISyntaxFactsService syntaxFacts, bool extractParentsOfHeader)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册