From 9d10f25bcf129cfc80e0fccd7b5133e914d761ba Mon Sep 17 00:00:00 2001 From: CyrusNajmabadi Date: Wed, 2 Nov 2016 00:33:03 -0700 Subject: [PATCH] Move files. --- .../CSharpEditorServicesTest.csproj | 2 +- ...ertPlaceholderToInterpolatedStringTests.cs | 4 +- .../BasicEditorServicesTest.vbproj | 2 +- ...ertPlaceholderToInterpolatedStringTests.vb | 229 +++++++++--------- .../CSharp/Portable/CSharpFeatures.csproj | 2 +- ...ToInterpolatedStringRefactoringProvider.cs | 5 +- ...ToInterpolatedStringRefactoringProvider.cs | 3 +- src/Features/Core/Portable/Features.csproj | 2 +- .../VisualBasic/Portable/BasicFeatures.vbproj | 2 +- ...ToInterpolatedStringRefactoringProvider.vb | 16 -- ...ToInterpolatedStringRefactoringProvider.vb | 17 ++ 11 files changed, 145 insertions(+), 139 deletions(-) rename src/EditorFeatures/CSharpTest/{CodeActions => }/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs (98%) rename src/EditorFeatures/VisualBasicTest/{CodeActions => }/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.vb (59%) rename src/Features/CSharp/Portable/{CodeRefactorings => }/ConvertToInterpolatedString/CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (77%) rename src/Features/Core/Portable/{CodeRefactorings => }/ConvertToInterpolatedString/AbstractConvertPlaceholdToInterpolatedStringRefactoringProvider.cs (99%) delete mode 100644 src/Features/VisualBasic/Portable/CodeRefactorings/ConvertToInterpolatedString/VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider.vb create mode 100644 src/Features/VisualBasic/Portable/ConvertToInterpolatedString/VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider.vb diff --git a/src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj b/src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj index 60673332320..2310695d20c 100644 --- a/src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj +++ b/src/EditorFeatures/CSharpTest/CSharpEditorServicesTest.csproj @@ -139,7 +139,7 @@ - + diff --git a/src/EditorFeatures/CSharpTest/CodeActions/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs b/src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs similarity index 98% rename from src/EditorFeatures/CSharpTest/CodeActions/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs rename to src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs index 3781e245877..db36ec6d599 100644 --- a/src/EditorFeatures/CSharpTest/CodeActions/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs +++ b/src/EditorFeatures/CSharpTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.cs @@ -2,12 +2,12 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.CodeRefactorings; -using Microsoft.CodeAnalysis.CSharp.CodeRefactorings.ConvertToInterpolatedString; +using Microsoft.CodeAnalysis.CSharp.ConvertToInterpolatedString; using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeRefactorings; using Roslyn.Test.Utilities; using Xunit; -namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CodeActions.ConvertToInterpolatedString +namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ConvertToInterpolatedString { public class ConvertPlaceholderToInterpolatedStringTests : AbstractCSharpCodeActionTest { diff --git a/src/EditorFeatures/VisualBasicTest/BasicEditorServicesTest.vbproj b/src/EditorFeatures/VisualBasicTest/BasicEditorServicesTest.vbproj index 4bcbe73df05..96a03f77b2c 100644 --- a/src/EditorFeatures/VisualBasicTest/BasicEditorServicesTest.vbproj +++ b/src/EditorFeatures/VisualBasicTest/BasicEditorServicesTest.vbproj @@ -120,7 +120,7 @@ - + diff --git a/src/EditorFeatures/VisualBasicTest/CodeActions/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.vb b/src/EditorFeatures/VisualBasicTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.vb similarity index 59% rename from src/EditorFeatures/VisualBasicTest/CodeActions/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.vb rename to src/EditorFeatures/VisualBasicTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.vb index 496a3baf90a..8e91b3e6c22 100644 --- a/src/EditorFeatures/VisualBasicTest/CodeActions/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.vb +++ b/src/EditorFeatures/VisualBasicTest/ConvertToInterpolatedString/ConvertPlaceholderToInterpolatedStringTests.vb @@ -4,17 +4,19 @@ Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.CodeRefactorings Imports Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests Imports Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.CodeRefactorings +Imports Microsoft.CodeAnalysis.VisualBasic.ConvertToInterpolatedString -Public Class ConvertPlaceholderToInterpolatedStringTests - Inherits AbstractVisualBasicCodeActionTest +Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.UnitTests.ConvertToInterpolatedString + Public Class ConvertPlaceholderToInterpolatedStringTests + Inherits AbstractVisualBasicCodeActionTest - Protected Overrides Function CreateCodeRefactoringProvider(workspace As Workspace) As CodeRefactoringProvider - Return New VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider() - End Function + Protected Overrides Function CreateCodeRefactoringProvider(workspace As Workspace) As CodeRefactoringProvider + Return New VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider() + End Function - - Public Async Function TestSingleItemSubstitution() As Task - Dim text = + + Public Async Function TestSingleItemSubstitution() As Task + Dim text = Imports System Module T Sub M() @@ -22,7 +24,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -30,12 +32,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestItemOrdering() As Task - Dim text = + + Public Async Function TestItemOrdering() As Task + Dim text = Imports System Module T Sub M() @@ -43,7 +45,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -51,12 +53,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestItemOrdering2() As Task - Dim text = + + Public Async Function TestItemOrdering2() As Task + Dim text = Imports System Module T Sub M() @@ -64,7 +66,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -72,12 +74,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestItemOrdering3() As Task - Dim text = + + Public Async Function TestItemOrdering3() As Task + Dim text = Imports System Module T Sub M() @@ -85,7 +87,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -93,12 +95,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestItemOutsideRange() As Task - Dim text = + + Public Async Function TestItemOutsideRange() As Task + Dim text = Imports System Module T Sub M() @@ -106,7 +108,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -114,12 +116,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestItemDoNotHaveCast() As Task - Dim text = + + Public Async Function TestItemDoNotHaveCast() As Task + Dim text = Imports System Module T Sub M() @@ -127,7 +129,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -135,12 +137,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestItemWithoutSyntaxErrorDoesNotHaveCast() As Task - Dim text = + + Public Async Function TestItemWithoutSyntaxErrorDoesNotHaveCast() As Task + Dim text = Imports System Module T Sub M() @@ -148,7 +150,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -156,12 +158,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestPreserveParenthesis() As Task - Dim text = + + Public Async Function TestPreserveParenthesis() As Task + Dim text = Imports System Module T Sub M() @@ -169,7 +171,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -177,12 +179,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestMultiLineExpression() As Task - Dim text = + + Public Async Function TestMultiLineExpression() As Task + Dim text = Imports System Module T Sub M() @@ -192,7 +194,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -202,12 +204,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestFormatSpecifiers() As Task - Dim text = + + Public Async Function TestFormatSpecifiers() As Task + Dim text = Imports System Module T Sub M() @@ -217,7 +219,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -226,12 +228,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestFormatSpecifiers2() As Task - Dim text = + + Public Async Function TestFormatSpecifiers2() As Task + Dim text = Imports System Module T Sub M() @@ -239,7 +241,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -247,12 +249,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestFormatSpecifiers3() As Task - Dim text = + + Public Async Function TestFormatSpecifiers3() As Task + Dim text = Imports System Module T Sub M() @@ -266,7 +268,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -279,12 +281,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestFormatSpecifiers4() As Task - Dim text = + + Public Async Function TestFormatSpecifiers4() As Task + Dim text = Imports System Module T Sub M() @@ -292,7 +294,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -300,12 +302,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestFormatSpecifiers5() As Task - Dim text = + + Public Async Function TestFormatSpecifiers5() As Task + Dim text = Imports System Module T Sub M() @@ -327,7 +329,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -347,12 +349,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestFormatSpecifiers6() As Task - Dim text = + + Public Async Function TestFormatSpecifiers6() As Task + Dim text = Imports System Module T Sub M() @@ -363,7 +365,7 @@ Module T End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -374,12 +376,12 @@ Module T End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestMultilineStringLiteral2() As Task - Dim text = + + Public Async Function TestMultilineStringLiteral2() As Task + Dim text = Imports System Module T Sub M() @@ -393,7 +395,7 @@ And {1,10} ({1,8:X8}) End Sub End Module.ConvertTestSourceTag() - Dim expected = + Dim expected = Imports System Module T Sub M() @@ -406,30 +408,31 @@ And {value2,10} ({value2,8:X8}) End Sub End Module.ConvertTestSourceTag() - Await TestAsync(text, expected) - End Function + Await TestAsync(text, expected) + End Function - - Public Async Function TestParamsArray() As Task - Dim text = + + Public Async Function TestParamsArray() As Task + Dim text = Imports System Module T Sub M(args As String()) Dim s = [|String.Format("{0}", args)|] End Sub End Module.ConvertTestSourceTag() - Await TestMissingAsync(text) - End Function + Await TestMissingAsync(text) + End Function - - - Public Async Function TestInvocationWithNullArguments() As Task - Dim text = + + + Public Async Function TestInvocationWithNullArguments() As Task + Dim text = "Module Module1 Sub Main() [|TaskAwaiter|] End Sub End Module" - Await TestMissingAsync(text) - End Function -End Class + Await TestMissingAsync(text) + End Function + End Class +End Namespace \ No newline at end of file diff --git a/src/Features/CSharp/Portable/CSharpFeatures.csproj b/src/Features/CSharp/Portable/CSharpFeatures.csproj index 82a3e1b3a1c..85bcbd77152 100644 --- a/src/Features/CSharp/Portable/CSharpFeatures.csproj +++ b/src/Features/CSharp/Portable/CSharpFeatures.csproj @@ -112,7 +112,7 @@ - + diff --git a/src/Features/CSharp/Portable/CodeRefactorings/ConvertToInterpolatedString/CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider.cs b/src/Features/CSharp/Portable/ConvertToInterpolatedString/CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider.cs similarity index 77% rename from src/Features/CSharp/Portable/CodeRefactorings/ConvertToInterpolatedString/CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider.cs rename to src/Features/CSharp/Portable/ConvertToInterpolatedString/CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider.cs index a2264561234..738fffca196 100644 --- a/src/Features/CSharp/Portable/CodeRefactorings/ConvertToInterpolatedString/CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider.cs +++ b/src/Features/CSharp/Portable/ConvertToInterpolatedString/CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider.cs @@ -2,13 +2,14 @@ using System.Composition; using Microsoft.CodeAnalysis.CodeRefactorings; +using Microsoft.CodeAnalysis.ConvertToInterpolatedString; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace Microsoft.CodeAnalysis.CSharp.CodeRefactorings.ConvertToInterpolatedString +namespace Microsoft.CodeAnalysis.CSharp.ConvertToInterpolatedString { [ExportCodeRefactoringProvider(LanguageNames.CSharp, Name = PredefinedCodeRefactoringProviderNames.ConvertToInterpolatedString), Shared] internal partial class CSharpConvertPlaceholderToInterpolatedStringRefactoringProvider : - AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider + AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider { protected override SyntaxNode GetInterpolatedString(string text) => SyntaxFactory.ParseExpression("$" + text) as InterpolatedStringExpressionSyntax; diff --git a/src/Features/Core/Portable/CodeRefactorings/ConvertToInterpolatedString/AbstractConvertPlaceholdToInterpolatedStringRefactoringProvider.cs b/src/Features/Core/Portable/ConvertToInterpolatedString/AbstractConvertPlaceholdToInterpolatedStringRefactoringProvider.cs similarity index 99% rename from src/Features/Core/Portable/CodeRefactorings/ConvertToInterpolatedString/AbstractConvertPlaceholdToInterpolatedStringRefactoringProvider.cs rename to src/Features/Core/Portable/ConvertToInterpolatedString/AbstractConvertPlaceholdToInterpolatedStringRefactoringProvider.cs index 67130561867..e19b19741ea 100644 --- a/src/Features/Core/Portable/CodeRefactorings/ConvertToInterpolatedString/AbstractConvertPlaceholdToInterpolatedStringRefactoringProvider.cs +++ b/src/Features/Core/Portable/ConvertToInterpolatedString/AbstractConvertPlaceholdToInterpolatedStringRefactoringProvider.cs @@ -12,8 +12,9 @@ using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Simplification; using Microsoft.CodeAnalysis.Formatting; +using Microsoft.CodeAnalysis.CodeRefactorings; -namespace Microsoft.CodeAnalysis.CodeRefactorings +namespace Microsoft.CodeAnalysis.ConvertToInterpolatedString { internal abstract class AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider : CodeRefactoringProvider where TExpressionSyntax : SyntaxNode diff --git a/src/Features/Core/Portable/Features.csproj b/src/Features/Core/Portable/Features.csproj index b8a28eff1e7..d2752e202f3 100644 --- a/src/Features/Core/Portable/Features.csproj +++ b/src/Features/Core/Portable/Features.csproj @@ -213,7 +213,7 @@ - + diff --git a/src/Features/VisualBasic/Portable/BasicFeatures.vbproj b/src/Features/VisualBasic/Portable/BasicFeatures.vbproj index 244683a712f..3d29b967f23 100644 --- a/src/Features/VisualBasic/Portable/BasicFeatures.vbproj +++ b/src/Features/VisualBasic/Portable/BasicFeatures.vbproj @@ -123,7 +123,7 @@ - + diff --git a/src/Features/VisualBasic/Portable/CodeRefactorings/ConvertToInterpolatedString/VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider.vb b/src/Features/VisualBasic/Portable/CodeRefactorings/ConvertToInterpolatedString/VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider.vb deleted file mode 100644 index b6ec291e522..00000000000 --- a/src/Features/VisualBasic/Portable/CodeRefactorings/ConvertToInterpolatedString/VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider.vb +++ /dev/null @@ -1,16 +0,0 @@ -' 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 System.Composition -Imports Microsoft.CodeAnalysis -Imports Microsoft.CodeAnalysis.CodeRefactorings -Imports Microsoft.CodeAnalysis.VisualBasic -Imports Microsoft.CodeAnalysis.VisualBasic.Syntax - - -Partial Friend Class VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider - Inherits AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider(Of InvocationExpressionSyntax, ExpressionSyntax, ArgumentSyntax, LiteralExpressionSyntax) - - Protected Overrides Function GetInterpolatedString(text As String) As SyntaxNode - Return TryCast(SyntaxFactory.ParseExpression("$" + text), InterpolatedStringExpressionSyntax) - End Function -End Class \ No newline at end of file diff --git a/src/Features/VisualBasic/Portable/ConvertToInterpolatedString/VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider.vb b/src/Features/VisualBasic/Portable/ConvertToInterpolatedString/VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider.vb new file mode 100644 index 00000000000..2cdb38ce05e --- /dev/null +++ b/src/Features/VisualBasic/Portable/ConvertToInterpolatedString/VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider.vb @@ -0,0 +1,17 @@ +' 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 System.Composition +Imports Microsoft.CodeAnalysis.CodeRefactorings +Imports Microsoft.CodeAnalysis.ConvertToInterpolatedString +Imports Microsoft.CodeAnalysis.VisualBasic.Syntax + +Namespace Microsoft.CodeAnalysis.VisualBasic.ConvertToInterpolatedString + + Partial Friend Class VisualBasicConvertPlaceholderToInterpolatedStringRefactoringProvider + Inherits AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider(Of InvocationExpressionSyntax, ExpressionSyntax, ArgumentSyntax, LiteralExpressionSyntax) + + Protected Overrides Function GetInterpolatedString(text As String) As SyntaxNode + Return TryCast(SyntaxFactory.ParseExpression("$" + text), InterpolatedStringExpressionSyntax) + End Function + End Class +End Namespace \ No newline at end of file -- GitLab