提交 b394dee6 编写于 作者: C Cyrus Najmabadi

Move files.

上级 014ff885
......@@ -5,7 +5,7 @@
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.CSharp.Editor.Wrapping.SeparatedSyntaxList;
using Microsoft.CodeAnalysis.Editor.CSharp.Wrapping.BinaryExpression;
using Microsoft.CodeAnalysis.Editor.CSharp.Wrapping.Call;
using Microsoft.CodeAnalysis.Editor.CSharp.Wrapping.CallExpression;
using Microsoft.CodeAnalysis.Editor.Wrapping;
namespace Microsoft.CodeAnalysis.Editor.CSharp.Wrapping
......@@ -18,7 +18,7 @@ internal class CSharpWrappingCodeRefactoringProvider : AbstractWrappingCodeRefac
new CSharpArgumentWrapper(),
new CSharpParameterWrapper(),
new CSharpBinaryExpressionWrapper(),
new CSharpCallWrapper());
new CSharpCallExpressionWrapper());
public CSharpWrappingCodeRefactoringProvider()
: base(s_wrappers)
......
......@@ -2,11 +2,11 @@
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Editor.Wrapping.Call;
using Microsoft.CodeAnalysis.Editor.Wrapping.CallExpression;
namespace Microsoft.CodeAnalysis.Editor.CSharp.Wrapping.Call
namespace Microsoft.CodeAnalysis.Editor.CSharp.Wrapping.CallExpression
{
internal class CSharpCallWrapper : AbstractCallWrapper<
internal class CSharpCallExpressionWrapper : AbstractCallExpressionWrapper<
ExpressionSyntax,
NameSyntax,
MemberAccessExpressionSyntax,
......@@ -14,7 +14,7 @@ internal class CSharpCallWrapper : AbstractCallWrapper<
ElementAccessExpressionSyntax,
BaseArgumentListSyntax>
{
public CSharpCallWrapper()
public CSharpCallExpressionWrapper()
: base(CSharpSyntaxFactsService.Instance)
{
}
......
......@@ -11,7 +11,7 @@
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Wrapping
{
public class BinaryWrappingTests : AbstractWrappingTests
public class BinaryExpressionWrappingTests : AbstractWrappingTests
{
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(Workspace workspace, TestParameters parameters)
=> new CSharpWrappingCodeRefactoringProvider();
......
......@@ -8,7 +8,7 @@
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Wrapping
{
public class CallWrappingTests : AbstractWrappingTests
public class CallExpressionWrappingTests : AbstractWrappingTests
{
protected override CodeRefactoringProvider CreateCodeRefactoringProvider(Workspace workspace, TestParameters parameters)
=> new CSharpWrappingCodeRefactoringProvider();
......
......@@ -6,9 +6,9 @@
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.PooledObjects;
namespace Microsoft.CodeAnalysis.Editor.Wrapping.Call
namespace Microsoft.CodeAnalysis.Editor.Wrapping.CallExpression
{
internal abstract partial class AbstractCallWrapper : AbstractSyntaxWrapper
internal abstract partial class AbstractCallExpressionWrapper : AbstractSyntaxWrapper
{
/// <summary>
/// Gets the language specific trivia that should be inserted before an operator if the
......@@ -32,10 +32,10 @@ internal abstract partial class AbstractCallWrapper : AbstractSyntaxWrapper
/// .P3.I1[...]
/// </c>
///
/// Note: for the sake of simplicity, from now on, every time an invocation is
/// referred to, it means either an InvocationExpression or an ElementAccessExpression.
/// Note: for the sake of simplicity, from now on, every time we talk about a CallExpression,
/// it means either an InvocationExpression or an ElementAccessExpression.
///
/// The way this wrapper works is breaking up a long dotted expression into 'call-chunks'
/// The way this wrapper works is breaking up a long dotted call expression into 'call-chunks'
/// of the form `.P1.P2.P3.M(...)` i.e. a *non-empty* sequence of dot-and-name pairs
/// followed by one or more ArgumentLists. In this example the sequence is considered:
///
......@@ -60,13 +60,13 @@ internal abstract partial class AbstractCallWrapper : AbstractSyntaxWrapper
/// 'wrap long', then the wrapping only occurs if the current call-chunk's end
/// would go past the preferred wrapping column
/// </summary>
internal abstract partial class AbstractCallWrapper<
internal abstract partial class AbstractCallExpressionWrapper<
TExpressionSyntax,
TNameSyntax,
TMemberAccessExpressionSyntax,
TInvocationExpressionSyntax,
TElementAccessExpressionSyntax,
TBaseArgumentListSyntax> : AbstractCallWrapper
TBaseArgumentListSyntax> : AbstractCallExpressionWrapper
where TExpressionSyntax : SyntaxNode
where TNameSyntax : TExpressionSyntax
where TMemberAccessExpressionSyntax : TExpressionSyntax
......@@ -76,7 +76,7 @@ internal abstract partial class AbstractCallWrapper<
{
private readonly ISyntaxFactsService _syntaxFacts;
protected AbstractCallWrapper(
protected AbstractCallExpressionWrapper(
ISyntaxFactsService syntaxFacts)
{
_syntaxFacts = syntaxFacts;
......@@ -86,13 +86,13 @@ internal abstract partial class AbstractCallWrapper<
Document document, int position, SyntaxNode node, CancellationToken cancellationToken)
{
// has to either be `expr(...)` or `expr[...]`
if (!IsInvocationOrElementAccessExpression(node))
if (!IsCallExpression(node))
{
return null;
}
// Has to be the topmost invocation/element-access.
if (IsInvocationOrElementAccessExpression(node.Parent))
if (IsCallExpression(node.Parent))
{
return null;
}
......@@ -107,7 +107,7 @@ internal abstract partial class AbstractCallWrapper<
return null;
}
// Don't process this invocation expression if it's contained in some higher member
// Don't process this call expression if it's contained in some higher member
// call-chunk expression. We'll take care of this when we hit the parent.
var current = node;
while (current.Parent is TMemberAccessExpressionSyntax)
......@@ -115,7 +115,7 @@ internal abstract partial class AbstractCallWrapper<
current = current.Parent;
}
if (IsInvocationOrElementAccessExpression(current.Parent))
if (IsCallExpression(current.Parent))
{
return null;
}
......@@ -150,17 +150,17 @@ internal abstract partial class AbstractCallWrapper<
// the set of wrapping options to provide.
var sourceText = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
var options = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false);
return new CallCodeActionComputer(
return new CallExpressionCodeActionComputer(
this, document, sourceText, options, callChunks, cancellationToken);
}
private bool IsInvocationOrElementAccessExpression(SyntaxNode node)
=> IsInvocationOrElementAccessExpression(node, out _, out _);
private bool IsCallExpression(SyntaxNode node)
=> IsCallExpression(node, out _, out _);
private bool IsInvocationOrElementAccessExpression(
private bool IsCallExpression(
SyntaxNode node, out TExpressionSyntax expression, out TBaseArgumentListSyntax argumentList)
{
if (IsInvocationOrElementAccessExpressionWorker(
if (IsCallExpressionWorker(
node, out var expressionNode, out var argumentListNode))
{
expression = (TExpressionSyntax)expressionNode;
......@@ -173,7 +173,7 @@ private bool IsInvocationOrElementAccessExpression(SyntaxNode node)
return false;
}
private bool IsInvocationOrElementAccessExpressionWorker(
private bool IsCallExpressionWorker(
SyntaxNode node, out SyntaxNode expression, out SyntaxNode argumentList)
{
if (node is TInvocationExpressionSyntax)
......@@ -208,7 +208,7 @@ private void AddChunks(SyntaxNode node, ArrayBuilder<CallChunk> chunks)
// Walk downwards, consuming argument lists.
// Note: because of how we walk down, the arg lists will be reverse order.
// We take care of that below.
while (IsInvocationOrElementAccessExpression(node, out var expression, out var argumentList))
while (IsCallExpression(node, out var expression, out var argumentList))
{
argumentLists.Add(argumentList);
node = expression;
......
......@@ -6,9 +6,9 @@
using System.Linq;
using Microsoft.CodeAnalysis.Shared.Extensions;
namespace Microsoft.CodeAnalysis.Editor.Wrapping.Call
namespace Microsoft.CodeAnalysis.Editor.Wrapping.CallExpression
{
internal abstract partial class AbstractCallWrapper<
internal abstract partial class AbstractCallExpressionWrapper<
TExpressionSyntax,
TNameSyntax,
TMemberAccessExpressionSyntax,
......
......@@ -11,9 +11,9 @@
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.Utilities;
namespace Microsoft.CodeAnalysis.Editor.Wrapping.Call
namespace Microsoft.CodeAnalysis.Editor.Wrapping.CallExpression
{
internal abstract partial class AbstractCallWrapper<
internal abstract partial class AbstractCallExpressionWrapper<
TExpressionSyntax,
TNameSyntax,
TMemberAccessExpressionSyntax,
......@@ -34,8 +34,8 @@ internal abstract partial class AbstractCallWrapper<
/// if wrap-long produces the same results as wrap-each, then the caller will
/// filter it out.
/// </summary>
private class CallCodeActionComputer :
AbstractCodeActionComputer<AbstractCallWrapper>
private class CallExpressionCodeActionComputer :
AbstractCodeActionComputer<AbstractCallExpressionWrapper>
{
/// <summary>
/// The chunks to normalize and wrap. The first chunk will be normalized,
......@@ -56,8 +56,8 @@ private class CallCodeActionComputer :
/// </summary>
private readonly SyntaxTriviaList _newlineBeforeOperatorTrivia;
public CallCodeActionComputer(
AbstractCallWrapper service,
public CallExpressionCodeActionComputer(
AbstractCallExpressionWrapper service,
Document document,
SourceText originalSourceText,
DocumentOptionSet options,
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports Microsoft.CodeAnalysis.Editor.Wrapping.Call
Imports Microsoft.CodeAnalysis.Editor.Wrapping.CallExpression
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.Wrapping.Call
Friend Class VisualBasicCallWrapper
Inherits AbstractCallWrapper(Of
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.Wrapping.CallExpression
Friend Class VisualBasicCallExpressionWrapper
Inherits AbstractCallExpressionWrapper(Of
ExpressionSyntax,
NameSyntax,
MemberAccessExpressionSyntax,
......
......@@ -4,7 +4,7 @@ Imports System.Collections.Immutable
Imports System.Composition
Imports Microsoft.CodeAnalysis.CodeRefactorings
Imports Microsoft.CodeAnalysis.Editor.VisualBasic.Wrapping.BinaryExpression
Imports Microsoft.CodeAnalysis.Editor.VisualBasic.Wrapping.Call
Imports Microsoft.CodeAnalysis.Editor.VisualBasic.Wrapping.CallExpression
Imports Microsoft.CodeAnalysis.Editor.VisualBasic.Wrapping.SeparatedSyntaxList
Imports Microsoft.CodeAnalysis.Editor.Wrapping
......@@ -18,7 +18,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.Wrapping
New VisualBasicArgumentWrapper(),
New VisualBasicParameterWrapper(),
New VisualBasicBinaryExpressionWrapper(),
New VisualBasicCallWrapper())
New VisualBasicCallExpressionWrapper())
Public Sub New()
MyBase.New(s_wrappers)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册