From 34130bf8127bd9bb17ebd5f67448234f528bf931 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 26 Jul 2022 17:41:31 -0700 Subject: [PATCH 1/3] Move BraceMatching data service down to Features layer. --- .../BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs | 5 +++-- .../BraceMatching/CSharpEmbeddedLanguageBraceMatcher.cs | 4 ++-- .../BraceMatching/LessThanGreaterThanBraceMatcher.cs | 5 +++-- .../CSharp/BraceMatching/OpenCloseBraceBraceMatcher.cs | 5 +++-- .../CSharp/BraceMatching/OpenCloseBracketBraceMatcher.cs | 5 +++-- .../CSharp/BraceMatching/OpenCloseParenBraceMatcher.cs | 5 +++-- .../CSharp/BraceMatching/StringLiteralBraceMatcher.cs | 5 +++-- .../BraceMatching/BraceMatchingOptionsStorage.cs | 1 + .../VSTypeScript/VSTypeScriptBraceMatcher.cs | 5 +++-- .../Core/Portable}/BraceMatching/AbstractBraceMatcher.cs | 1 - .../BraceMatching/AbstractDirectiveTriviaBraceMatcher.cs | 2 +- .../AbstractEmbeddedLanguageBraceMatcher.cs | 2 -- .../Portable}/BraceMatching/BraceCharacterAndKind.cs | 5 +---- .../Core/Portable}/BraceMatching/BraceMatchingOptions.cs | 2 +- .../Core/Portable}/BraceMatching/BraceMatchingService.cs | 5 ++--- .../BraceMatching/ExportBraceMatcherAttribute.cs | 6 +++--- .../ExportEmbeddedLanguageBraceMatcherAttribute.cs | 0 .../Core/Portable}/BraceMatching/IBraceMatcher.cs | 2 +- .../Portable/BraceMatching}/IBraceMatchingService.cs | 2 +- .../BraceMatching}/IBraceMatchingServiceExtensions.cs | 2 +- .../BraceMatching/IEmbeddedLanguageBraceMatcher.cs | 1 - .../DocumentHighlighting/IDocumentHighlightsService.cs | 2 -- .../Json/LanguageServices}/JsonBraceMatcher.cs | 5 +---- .../LanguageServices}/RegexBraceMatcher.cs | 6 +++--- .../BraceMatching/AbstractVisualBasicBraceMatcher.vb | 2 +- .../BraceMatching/InterpolatedStringBraceMatcher.vb | 9 ++++----- .../BraceMatching/LessThanGreaterThanBraceMatcher.vb | 7 ++++--- .../BraceMatching/OpenCloseBraceBraceMatcher.vb | 7 ++++--- .../BraceMatching/OpenCloseParenBraceMatcher.vb | 7 ++++--- .../Portable}/BraceMatching/StringLiteralBraceMatcher.vb | 8 ++++---- .../VisualBasicDirectiveTriviaBraceMatcher.vb | 8 ++++---- .../VisualBasicEmbeddedLanguageBraceMatcher.vb | 6 +++--- 32 files changed, 67 insertions(+), 70 deletions(-) rename src/{EditorFeatures/Core => Features/Core/Portable}/BraceMatching/AbstractBraceMatcher.cs (98%) rename src/{EditorFeatures/Core/Extensibility => Features/Core/Portable}/BraceMatching/AbstractDirectiveTriviaBraceMatcher.cs (98%) rename src/{EditorFeatures/Core => Features/Core/Portable}/BraceMatching/AbstractEmbeddedLanguageBraceMatcher.cs (96%) rename src/{EditorFeatures/Core => Features/Core/Portable}/BraceMatching/BraceCharacterAndKind.cs (86%) rename src/{EditorFeatures/Core/Extensibility => Features/Core/Portable}/BraceMatching/BraceMatchingOptions.cs (93%) rename src/{EditorFeatures/Core => Features/Core/Portable}/BraceMatching/BraceMatchingService.cs (94%) rename src/{EditorFeatures/Core/Extensibility => Features/Core/Portable}/BraceMatching/ExportBraceMatcherAttribute.cs (79%) rename src/{EditorFeatures/Core => Features/Core/Portable}/BraceMatching/ExportEmbeddedLanguageBraceMatcherAttribute.cs (100%) rename src/{EditorFeatures/Core/Extensibility => Features/Core/Portable}/BraceMatching/IBraceMatcher.cs (97%) rename src/{EditorFeatures/Core => Features/Core/Portable/BraceMatching}/IBraceMatchingService.cs (94%) rename src/{EditorFeatures/Core/Shared/Extensions => Features/Core/Portable/BraceMatching}/IBraceMatchingServiceExtensions.cs (97%) rename src/{EditorFeatures/Core => Features/Core/Portable}/BraceMatching/IEmbeddedLanguageBraceMatcher.cs (94%) rename src/{EditorFeatures/Core/EmbeddedLanguages/Json => Features/Core/Portable/EmbeddedLanguages/Json/LanguageServices}/JsonBraceMatcher.cs (94%) rename src/{EditorFeatures/Core/EmbeddedLanguages/RegularExpressions => Features/Core/Portable/EmbeddedLanguages/RegularExpressions/LanguageServices}/RegexBraceMatcher.cs (96%) rename src/{EditorFeatures/VisualBasic => Features/VisualBasic/Portable}/BraceMatching/AbstractVisualBasicBraceMatcher.vb (91%) rename src/{EditorFeatures/VisualBasic => Features/VisualBasic/Portable}/BraceMatching/InterpolatedStringBraceMatcher.vb (89%) rename src/{EditorFeatures/VisualBasic => Features/VisualBasic/Portable}/BraceMatching/LessThanGreaterThanBraceMatcher.vb (85%) rename src/{EditorFeatures/VisualBasic => Features/VisualBasic/Portable}/BraceMatching/OpenCloseBraceBraceMatcher.vb (75%) rename src/{EditorFeatures/VisualBasic => Features/VisualBasic/Portable}/BraceMatching/OpenCloseParenBraceMatcher.vb (75%) rename src/{EditorFeatures/VisualBasic => Features/VisualBasic/Portable}/BraceMatching/StringLiteralBraceMatcher.vb (88%) rename src/{EditorFeatures/VisualBasic => Features/VisualBasic/Portable}/BraceMatching/VisualBasicDirectiveTriviaBraceMatcher.vb (91%) rename src/{EditorFeatures/VisualBasic => Features/VisualBasic/Portable}/BraceMatching/VisualBasicEmbeddedLanguageBraceMatcher.vb (86%) diff --git a/src/EditorFeatures/CSharp/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs b/src/EditorFeatures/CSharp/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs index 0da4f21b82113..cdec8d08c2ad1 100644 --- a/src/EditorFeatures/CSharp/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs +++ b/src/EditorFeatures/CSharp/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs @@ -4,9 +4,10 @@ using System; using System.Collections.Generic; -using System.ComponentModel.Composition; +using System.Composition; using System.Linq; using System.Threading; +using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.CSharp.Extensions; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Host.Mef; @@ -14,7 +15,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching { - [ExportBraceMatcher(LanguageNames.CSharp)] + [ExportBraceMatcher(LanguageNames.CSharp), Shared] internal class CSharpDirectiveTriviaBraceMatcher : AbstractDirectiveTriviaBraceMatcher> _braceMatchers; diff --git a/src/EditorFeatures/Core/Extensibility/BraceMatching/ExportBraceMatcherAttribute.cs b/src/Features/Core/Portable/BraceMatching/ExportBraceMatcherAttribute.cs similarity index 79% rename from src/EditorFeatures/Core/Extensibility/BraceMatching/ExportBraceMatcherAttribute.cs rename to src/Features/Core/Portable/BraceMatching/ExportBraceMatcherAttribute.cs index a366f21a272fa..929f252ecca38 100644 --- a/src/EditorFeatures/Core/Extensibility/BraceMatching/ExportBraceMatcherAttribute.cs +++ b/src/Features/Core/Portable/BraceMatching/ExportBraceMatcherAttribute.cs @@ -5,13 +5,13 @@ #nullable disable using System; -using System.ComponentModel.Composition; +using System.Composition; -namespace Microsoft.CodeAnalysis.Editor +namespace Microsoft.CodeAnalysis.BraceMatching { [MetadataAttribute] [AttributeUsage(AttributeTargets.Class)] - internal class ExportBraceMatcherAttribute : ExportAttribute + internal sealed class ExportBraceMatcherAttribute : ExportAttribute { public string Language { get; } diff --git a/src/EditorFeatures/Core/BraceMatching/ExportEmbeddedLanguageBraceMatcherAttribute.cs b/src/Features/Core/Portable/BraceMatching/ExportEmbeddedLanguageBraceMatcherAttribute.cs similarity index 100% rename from src/EditorFeatures/Core/BraceMatching/ExportEmbeddedLanguageBraceMatcherAttribute.cs rename to src/Features/Core/Portable/BraceMatching/ExportEmbeddedLanguageBraceMatcherAttribute.cs diff --git a/src/EditorFeatures/Core/Extensibility/BraceMatching/IBraceMatcher.cs b/src/Features/Core/Portable/BraceMatching/IBraceMatcher.cs similarity index 97% rename from src/EditorFeatures/Core/Extensibility/BraceMatching/IBraceMatcher.cs rename to src/Features/Core/Portable/BraceMatching/IBraceMatcher.cs index 02d4e75a62db4..12342548bb04a 100644 --- a/src/EditorFeatures/Core/Extensibility/BraceMatching/IBraceMatcher.cs +++ b/src/Features/Core/Portable/BraceMatching/IBraceMatcher.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Microsoft.CodeAnalysis.Editor +namespace Microsoft.CodeAnalysis.BraceMatching { internal interface IBraceMatcher { diff --git a/src/EditorFeatures/Core/IBraceMatchingService.cs b/src/Features/Core/Portable/BraceMatching/IBraceMatchingService.cs similarity index 94% rename from src/EditorFeatures/Core/IBraceMatchingService.cs rename to src/Features/Core/Portable/BraceMatching/IBraceMatchingService.cs index 2098011c8b070..7008e97f1eade 100644 --- a/src/EditorFeatures/Core/IBraceMatchingService.cs +++ b/src/Features/Core/Portable/BraceMatching/IBraceMatchingService.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.CodeAnalysis.Editor +namespace Microsoft.CodeAnalysis.BraceMatching { internal interface IBraceMatchingService { diff --git a/src/EditorFeatures/Core/Shared/Extensions/IBraceMatchingServiceExtensions.cs b/src/Features/Core/Portable/BraceMatching/IBraceMatchingServiceExtensions.cs similarity index 97% rename from src/EditorFeatures/Core/Shared/Extensions/IBraceMatchingServiceExtensions.cs rename to src/Features/Core/Portable/BraceMatching/IBraceMatchingServiceExtensions.cs index 752216cd48f85..12e991a789003 100644 --- a/src/EditorFeatures/Core/Shared/Extensions/IBraceMatchingServiceExtensions.cs +++ b/src/Features/Core/Portable/BraceMatching/IBraceMatchingServiceExtensions.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.CodeAnalysis.Editor.Shared.Extensions +namespace Microsoft.CodeAnalysis.BraceMatching { internal static class IBraceMatchingServiceExtensions { diff --git a/src/EditorFeatures/Core/BraceMatching/IEmbeddedLanguageBraceMatcher.cs b/src/Features/Core/Portable/BraceMatching/IEmbeddedLanguageBraceMatcher.cs similarity index 94% rename from src/EditorFeatures/Core/BraceMatching/IEmbeddedLanguageBraceMatcher.cs rename to src/Features/Core/Portable/BraceMatching/IEmbeddedLanguageBraceMatcher.cs index 80d3b6bd74596..af52cbaa0c080 100644 --- a/src/EditorFeatures/Core/BraceMatching/IEmbeddedLanguageBraceMatcher.cs +++ b/src/Features/Core/Portable/BraceMatching/IEmbeddedLanguageBraceMatcher.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.Threading; -using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.EmbeddedLanguages; namespace Microsoft.CodeAnalysis.BraceMatching diff --git a/src/Features/Core/Portable/DocumentHighlighting/IDocumentHighlightsService.cs b/src/Features/Core/Portable/DocumentHighlighting/IDocumentHighlightsService.cs index c9f7bdd501788..b5dc1c11e5ce6 100644 --- a/src/Features/Core/Portable/DocumentHighlighting/IDocumentHighlightsService.cs +++ b/src/Features/Core/Portable/DocumentHighlighting/IDocumentHighlightsService.cs @@ -6,9 +6,7 @@ using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Features.EmbeddedLanguages.RegularExpressions.LanguageServices; using Microsoft.CodeAnalysis.Host; -using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.DocumentHighlighting diff --git a/src/EditorFeatures/Core/EmbeddedLanguages/Json/JsonBraceMatcher.cs b/src/Features/Core/Portable/EmbeddedLanguages/Json/LanguageServices/JsonBraceMatcher.cs similarity index 94% rename from src/EditorFeatures/Core/EmbeddedLanguages/Json/JsonBraceMatcher.cs rename to src/Features/Core/Portable/EmbeddedLanguages/Json/LanguageServices/JsonBraceMatcher.cs index 98ca3effb4f6b..5cae292905389 100644 --- a/src/EditorFeatures/Core/EmbeddedLanguages/Json/JsonBraceMatcher.cs +++ b/src/Features/Core/Portable/EmbeddedLanguages/Json/LanguageServices/JsonBraceMatcher.cs @@ -6,16 +6,13 @@ using System.Composition; using System.Threading; using Microsoft.CodeAnalysis.BraceMatching; -using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.EmbeddedLanguages; using Microsoft.CodeAnalysis.EmbeddedLanguages.Common; using Microsoft.CodeAnalysis.EmbeddedLanguages.VirtualChars; -using Microsoft.CodeAnalysis.Features.EmbeddedLanguages.Json; -using Microsoft.CodeAnalysis.Features.EmbeddedLanguages.Json.LanguageServices; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Shared.Extensions; -namespace Microsoft.CodeAnalysis.EmbeddedLanguages.Json +namespace Microsoft.CodeAnalysis.Features.EmbeddedLanguages.Json.LanguageServices { using JsonToken = EmbeddedSyntaxToken; diff --git a/src/EditorFeatures/Core/EmbeddedLanguages/RegularExpressions/RegexBraceMatcher.cs b/src/Features/Core/Portable/EmbeddedLanguages/RegularExpressions/LanguageServices/RegexBraceMatcher.cs similarity index 96% rename from src/EditorFeatures/Core/EmbeddedLanguages/RegularExpressions/RegexBraceMatcher.cs rename to src/Features/Core/Portable/EmbeddedLanguages/RegularExpressions/LanguageServices/RegexBraceMatcher.cs index ad557e7d64b1e..fdc89b1d4de59 100644 --- a/src/EditorFeatures/Core/EmbeddedLanguages/RegularExpressions/RegexBraceMatcher.cs +++ b/src/Features/Core/Portable/EmbeddedLanguages/RegularExpressions/LanguageServices/RegexBraceMatcher.cs @@ -7,14 +7,14 @@ using System.Composition; using System.Threading; using Microsoft.CodeAnalysis.BraceMatching; -using Microsoft.CodeAnalysis.Editor; +using Microsoft.CodeAnalysis.EmbeddedLanguages; using Microsoft.CodeAnalysis.EmbeddedLanguages.Common; +using Microsoft.CodeAnalysis.EmbeddedLanguages.RegularExpressions; using Microsoft.CodeAnalysis.EmbeddedLanguages.VirtualChars; -using Microsoft.CodeAnalysis.Features.EmbeddedLanguages.RegularExpressions.LanguageServices; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Shared.Extensions; -namespace Microsoft.CodeAnalysis.EmbeddedLanguages.RegularExpressions +namespace Microsoft.CodeAnalysis.Features.EmbeddedLanguages.RegularExpressions.LanguageServices { using RegexToken = EmbeddedSyntaxToken; using RegexTrivia = EmbeddedSyntaxTrivia; diff --git a/src/EditorFeatures/VisualBasic/BraceMatching/AbstractVisualBasicBraceMatcher.vb b/src/Features/VisualBasic/Portable/BraceMatching/AbstractVisualBasicBraceMatcher.vb similarity index 91% rename from src/EditorFeatures/VisualBasic/BraceMatching/AbstractVisualBasicBraceMatcher.vb rename to src/Features/VisualBasic/Portable/BraceMatching/AbstractVisualBasicBraceMatcher.vb index 91141ae17e88a..44daa7be88c67 100644 --- a/src/EditorFeatures/VisualBasic/BraceMatching/AbstractVisualBasicBraceMatcher.vb +++ b/src/Features/VisualBasic/Portable/BraceMatching/AbstractVisualBasicBraceMatcher.vb @@ -4,7 +4,7 @@ Imports Microsoft.CodeAnalysis.BraceMatching -Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.BraceMatching +Namespace Microsoft.CodeAnalysis.VisualBasic.BraceMatching Friend Class AbstractVisualBasicBraceMatcher Inherits AbstractBraceMatcher diff --git a/src/EditorFeatures/VisualBasic/BraceMatching/InterpolatedStringBraceMatcher.vb b/src/Features/VisualBasic/Portable/BraceMatching/InterpolatedStringBraceMatcher.vb similarity index 89% rename from src/EditorFeatures/VisualBasic/BraceMatching/InterpolatedStringBraceMatcher.vb rename to src/Features/VisualBasic/Portable/BraceMatching/InterpolatedStringBraceMatcher.vb index 647e6d44a6c9a..cbcb87dc9b2d3 100644 --- a/src/EditorFeatures/VisualBasic/BraceMatching/InterpolatedStringBraceMatcher.vb +++ b/src/Features/VisualBasic/Portable/BraceMatching/InterpolatedStringBraceMatcher.vb @@ -2,16 +2,15 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. -Imports System.ComponentModel.Composition +Imports System.Composition Imports System.Threading -Imports System.Threading.Tasks +Imports Microsoft.CodeAnalysis.BraceMatching Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Syntax -Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.BraceMatching - - +Namespace Microsoft.CodeAnalysis.VisualBasic.BraceMatching + Friend Class InterpolatedStringBraceMatcher Implements IBraceMatcher diff --git a/src/EditorFeatures/VisualBasic/BraceMatching/LessThanGreaterThanBraceMatcher.vb b/src/Features/VisualBasic/Portable/BraceMatching/LessThanGreaterThanBraceMatcher.vb similarity index 85% rename from src/EditorFeatures/VisualBasic/BraceMatching/LessThanGreaterThanBraceMatcher.vb rename to src/Features/VisualBasic/Portable/BraceMatching/LessThanGreaterThanBraceMatcher.vb index 312c8d8b2aa84..e211b6e159d1d 100644 --- a/src/EditorFeatures/VisualBasic/BraceMatching/LessThanGreaterThanBraceMatcher.vb +++ b/src/Features/VisualBasic/Portable/BraceMatching/LessThanGreaterThanBraceMatcher.vb @@ -2,11 +2,12 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. -Imports System.ComponentModel.Composition +Imports System.Composition +Imports Microsoft.CodeAnalysis.BraceMatching Imports Microsoft.CodeAnalysis.Host.Mef -Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.BraceMatching - +Namespace Microsoft.CodeAnalysis.VisualBasic.BraceMatching + Friend Class LessThanGreaterThanBraceMatcher Inherits AbstractVisualBasicBraceMatcher diff --git a/src/EditorFeatures/VisualBasic/BraceMatching/OpenCloseBraceBraceMatcher.vb b/src/Features/VisualBasic/Portable/BraceMatching/OpenCloseBraceBraceMatcher.vb similarity index 75% rename from src/EditorFeatures/VisualBasic/BraceMatching/OpenCloseBraceBraceMatcher.vb rename to src/Features/VisualBasic/Portable/BraceMatching/OpenCloseBraceBraceMatcher.vb index 14ca5bda6829a..066c85498858e 100644 --- a/src/EditorFeatures/VisualBasic/BraceMatching/OpenCloseBraceBraceMatcher.vb +++ b/src/Features/VisualBasic/Portable/BraceMatching/OpenCloseBraceBraceMatcher.vb @@ -2,11 +2,12 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. -Imports System.ComponentModel.Composition +Imports System.Composition +Imports Microsoft.CodeAnalysis.BraceMatching Imports Microsoft.CodeAnalysis.Host.Mef -Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.BraceMatching - +Namespace Microsoft.CodeAnalysis.VisualBasic.BraceMatching + Friend Class OpenCloseBraceBraceMatcher Inherits AbstractVisualBasicBraceMatcher diff --git a/src/EditorFeatures/VisualBasic/BraceMatching/OpenCloseParenBraceMatcher.vb b/src/Features/VisualBasic/Portable/BraceMatching/OpenCloseParenBraceMatcher.vb similarity index 75% rename from src/EditorFeatures/VisualBasic/BraceMatching/OpenCloseParenBraceMatcher.vb rename to src/Features/VisualBasic/Portable/BraceMatching/OpenCloseParenBraceMatcher.vb index 53d4ced627d6d..5ac58ac66274f 100644 --- a/src/EditorFeatures/VisualBasic/BraceMatching/OpenCloseParenBraceMatcher.vb +++ b/src/Features/VisualBasic/Portable/BraceMatching/OpenCloseParenBraceMatcher.vb @@ -2,11 +2,12 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. -Imports System.ComponentModel.Composition +Imports System.Composition +Imports Microsoft.CodeAnalysis.BraceMatching Imports Microsoft.CodeAnalysis.Host.Mef -Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.BraceMatching - +Namespace Microsoft.CodeAnalysis.VisualBasic.BraceMatching + Friend Class OpenCloseParenBraceMatcher Inherits AbstractVisualBasicBraceMatcher diff --git a/src/EditorFeatures/VisualBasic/BraceMatching/StringLiteralBraceMatcher.vb b/src/Features/VisualBasic/Portable/BraceMatching/StringLiteralBraceMatcher.vb similarity index 88% rename from src/EditorFeatures/VisualBasic/BraceMatching/StringLiteralBraceMatcher.vb rename to src/Features/VisualBasic/Portable/BraceMatching/StringLiteralBraceMatcher.vb index 2a974bfc107f9..1f6565b1082e9 100644 --- a/src/EditorFeatures/VisualBasic/BraceMatching/StringLiteralBraceMatcher.vb +++ b/src/Features/VisualBasic/Portable/BraceMatching/StringLiteralBraceMatcher.vb @@ -2,14 +2,14 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. -Imports System.ComponentModel.Composition +Imports System.Composition Imports System.Threading -Imports System.Threading.Tasks +Imports Microsoft.CodeAnalysis.BraceMatching Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.Text -Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.BraceMatching - +Namespace Microsoft.CodeAnalysis.VisualBasic.BraceMatching + Friend Class StringLiteralBraceMatcher Implements IBraceMatcher diff --git a/src/EditorFeatures/VisualBasic/BraceMatching/VisualBasicDirectiveTriviaBraceMatcher.vb b/src/Features/VisualBasic/Portable/BraceMatching/VisualBasicDirectiveTriviaBraceMatcher.vb similarity index 91% rename from src/EditorFeatures/VisualBasic/BraceMatching/VisualBasicDirectiveTriviaBraceMatcher.vb rename to src/Features/VisualBasic/Portable/BraceMatching/VisualBasicDirectiveTriviaBraceMatcher.vb index 6f44b0de70dfa..b612a9882fd3a 100644 --- a/src/EditorFeatures/VisualBasic/BraceMatching/VisualBasicDirectiveTriviaBraceMatcher.vb +++ b/src/Features/VisualBasic/Portable/BraceMatching/VisualBasicDirectiveTriviaBraceMatcher.vb @@ -2,15 +2,15 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. -Imports System.ComponentModel.Composition +Imports System.Composition Imports System.Threading +Imports Microsoft.CodeAnalysis.BraceMatching Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic.Syntax -Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.BraceMatching - - +Namespace Microsoft.CodeAnalysis.VisualBasic.BraceMatching + Friend Class VisualBasicDirectiveTriviaBraceMatcher Inherits AbstractDirectiveTriviaBraceMatcher(Of DirectiveTriviaSyntax, IfDirectiveTriviaSyntax, IfDirectiveTriviaSyntax, diff --git a/src/EditorFeatures/VisualBasic/BraceMatching/VisualBasicEmbeddedLanguageBraceMatcher.vb b/src/Features/VisualBasic/Portable/BraceMatching/VisualBasicEmbeddedLanguageBraceMatcher.vb similarity index 86% rename from src/EditorFeatures/VisualBasic/BraceMatching/VisualBasicEmbeddedLanguageBraceMatcher.vb rename to src/Features/VisualBasic/Portable/BraceMatching/VisualBasicEmbeddedLanguageBraceMatcher.vb index 7f87e385ee92d..52e3b5539cbba 100644 --- a/src/EditorFeatures/VisualBasic/BraceMatching/VisualBasicEmbeddedLanguageBraceMatcher.vb +++ b/src/Features/VisualBasic/Portable/BraceMatching/VisualBasicEmbeddedLanguageBraceMatcher.vb @@ -2,15 +2,15 @@ ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. -Imports System.ComponentModel.Composition +Imports System.Composition Imports Microsoft.CodeAnalysis.BraceMatching Imports Microsoft.CodeAnalysis.EmbeddedLanguages Imports Microsoft.CodeAnalysis.Host.Mef Imports Microsoft.CodeAnalysis.VisualBasic.EmbeddedLanguages.LanguageServices Imports Microsoft.CodeAnalysis.VisualBasic.LanguageServices -Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.BraceMatching - +Namespace Microsoft.CodeAnalysis.VisualBasic.BraceMatching + Friend Class VisualBasicEmbeddedLanguageBraceMatcher Inherits AbstractEmbeddedLanguageBraceMatcher From 03324a9eb13d42ce92b4efef184fc2dc9eb9f9e4 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 26 Jul 2022 17:45:21 -0700 Subject: [PATCH 2/3] Mop up --- .../CommandHandlers/GoToMatchingBraceCommandHandler.cs | 1 + src/EditorFeatures/Test/Attributes/AttributeTests.cs | 6 +----- src/EditorFeatures/Test/Options/GlobalOptionsTests.cs | 1 + .../MultiCharacterBraceHighlightingTests.cs | 1 + .../BraceMatching/AbstractBraceMatcherTests.cs | 2 +- .../BraceMatching/AspNetCoreBraceMatchingResult.cs | 1 + .../IAspNetCoreEmbeddedLanguageBraceMatcher.cs | 1 + .../FSharp/Internal/Editor/FSharpBraceMatcher.cs | 6 +++--- .../Core/Def/Implementation/AbstractVsTextViewFilter.cs | 1 + src/VisualStudio/Core/Test/AbstractTextViewFilterTests.vb | 1 + 10 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/EditorFeatures/Core.Cocoa/CommandHandlers/GoToMatchingBraceCommandHandler.cs b/src/EditorFeatures/Core.Cocoa/CommandHandlers/GoToMatchingBraceCommandHandler.cs index 932120bcdb19f..09120547e905b 100644 --- a/src/EditorFeatures/Core.Cocoa/CommandHandlers/GoToMatchingBraceCommandHandler.cs +++ b/src/EditorFeatures/Core.Cocoa/CommandHandlers/GoToMatchingBraceCommandHandler.cs @@ -6,6 +6,7 @@ using System; using System.ComponentModel.Composition; +using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.Editor.Shared.Extensions; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Options; diff --git a/src/EditorFeatures/Test/Attributes/AttributeTests.cs b/src/EditorFeatures/Test/Attributes/AttributeTests.cs index a38d454df66fe..afee395267424 100644 --- a/src/EditorFeatures/Test/Attributes/AttributeTests.cs +++ b/src/EditorFeatures/Test/Attributes/AttributeTests.cs @@ -5,11 +5,7 @@ #nullable disable using System; -using Microsoft.CodeAnalysis.Classification.Classifiers; -using Microsoft.CodeAnalysis.CodeRefactorings; -using Microsoft.CodeAnalysis.Editor; -using Microsoft.CodeAnalysis.Text; -using Roslyn.Test.Utilities; +using Microsoft.CodeAnalysis.BraceMatching; using Xunit; namespace Microsoft.CodeAnalysis.Editor.UnitTests.Attributes diff --git a/src/EditorFeatures/Test/Options/GlobalOptionsTests.cs b/src/EditorFeatures/Test/Options/GlobalOptionsTests.cs index 0b88199e75047..49780942417d1 100644 --- a/src/EditorFeatures/Test/Options/GlobalOptionsTests.cs +++ b/src/EditorFeatures/Test/Options/GlobalOptionsTests.cs @@ -11,6 +11,7 @@ using System.Reflection; using System.Runtime.Serialization; using Microsoft.CodeAnalysis.AddImport; +using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.Classification; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeStyle; diff --git a/src/EditorFeatures/TestUtilities/BraceHighlighting/MultiCharacterBraceHighlightingTests.cs b/src/EditorFeatures/TestUtilities/BraceHighlighting/MultiCharacterBraceHighlightingTests.cs index 9b8848a4bc59f..90c6f8d1c8eea 100644 --- a/src/EditorFeatures/TestUtilities/BraceHighlighting/MultiCharacterBraceHighlightingTests.cs +++ b/src/EditorFeatures/TestUtilities/BraceHighlighting/MultiCharacterBraceHighlightingTests.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Text; diff --git a/src/EditorFeatures/TestUtilities/BraceMatching/AbstractBraceMatcherTests.cs b/src/EditorFeatures/TestUtilities/BraceMatching/AbstractBraceMatcherTests.cs index d8706354634eb..c29e64cf018fb 100644 --- a/src/EditorFeatures/TestUtilities/BraceMatching/AbstractBraceMatcherTests.cs +++ b/src/EditorFeatures/TestUtilities/BraceMatching/AbstractBraceMatcherTests.cs @@ -9,7 +9,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Editor.Shared.Extensions; +using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces; using Microsoft.CodeAnalysis.Test.Utilities; using Microsoft.CodeAnalysis.Text; diff --git a/src/Tools/ExternalAccess/AspNetCore/EmbeddedLanguages/BraceMatching/AspNetCoreBraceMatchingResult.cs b/src/Tools/ExternalAccess/AspNetCore/EmbeddedLanguages/BraceMatching/AspNetCoreBraceMatchingResult.cs index 05ff4ee8310a4..eb9e9bf4cc3ae 100644 --- a/src/Tools/ExternalAccess/AspNetCore/EmbeddedLanguages/BraceMatching/AspNetCoreBraceMatchingResult.cs +++ b/src/Tools/ExternalAccess/AspNetCore/EmbeddedLanguages/BraceMatching/AspNetCoreBraceMatchingResult.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Text; diff --git a/src/Tools/ExternalAccess/AspNetCore/EmbeddedLanguages/BraceMatching/IAspNetCoreEmbeddedLanguageBraceMatcher.cs b/src/Tools/ExternalAccess/AspNetCore/EmbeddedLanguages/BraceMatching/IAspNetCoreEmbeddedLanguageBraceMatcher.cs index aaec3f234017d..e5a1b76c93a19 100644 --- a/src/Tools/ExternalAccess/AspNetCore/EmbeddedLanguages/BraceMatching/IAspNetCoreEmbeddedLanguageBraceMatcher.cs +++ b/src/Tools/ExternalAccess/AspNetCore/EmbeddedLanguages/BraceMatching/IAspNetCoreEmbeddedLanguageBraceMatcher.cs @@ -4,6 +4,7 @@ using System.Threading; using Microsoft.CodeAnalysis.Editor; +using Microsoft.CodeAnalysis.BraceMatching; namespace Microsoft.CodeAnalysis.ExternalAccess.AspNetCore.EmbeddedLanguages { diff --git a/src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpBraceMatcher.cs b/src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpBraceMatcher.cs index 59badf84a22b4..105dede75bc62 100644 --- a/src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpBraceMatcher.cs +++ b/src/Tools/ExternalAccess/FSharp/Internal/Editor/FSharpBraceMatcher.cs @@ -5,16 +5,16 @@ #nullable disable using System; -using System.ComponentModel.Composition; +using System.Composition; using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Editor; +using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor; using Microsoft.CodeAnalysis.Host.Mef; namespace Microsoft.CodeAnalysis.ExternalAccess.FSharp.Internal.Editor { - [ExportBraceMatcher(LanguageNames.FSharp)] + [ExportBraceMatcher(LanguageNames.FSharp), Shared] internal class FSharpBraceMatcher : IBraceMatcher { private readonly IFSharpBraceMatcher _braceMatcher; diff --git a/src/VisualStudio/Core/Def/Implementation/AbstractVsTextViewFilter.cs b/src/VisualStudio/Core/Def/Implementation/AbstractVsTextViewFilter.cs index 6561bc241a402..2804464b5372e 100644 --- a/src/VisualStudio/Core/Def/Implementation/AbstractVsTextViewFilter.cs +++ b/src/VisualStudio/Core/Def/Implementation/AbstractVsTextViewFilter.cs @@ -7,6 +7,7 @@ using System; using System.Linq; using System.Threading; +using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.Debugging; using Microsoft.CodeAnalysis.Editor; using Microsoft.CodeAnalysis.Editor.Host; diff --git a/src/VisualStudio/Core/Test/AbstractTextViewFilterTests.vb b/src/VisualStudio/Core/Test/AbstractTextViewFilterTests.vb index 0d168a3fd1849..91ba5f3e7de9d 100644 --- a/src/VisualStudio/Core/Test/AbstractTextViewFilterTests.vb +++ b/src/VisualStudio/Core/Test/AbstractTextViewFilterTests.vb @@ -4,6 +4,7 @@ Imports System.Threading Imports Microsoft.CodeAnalysis +Imports Microsoft.CodeAnalysis.BraceMatching Imports Microsoft.CodeAnalysis.Editor Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces Imports Microsoft.CodeAnalysis.Test.Utilities From ed4f098d026ef75046b5217744aa2ecfc718ddbe Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 26 Jul 2022 17:49:51 -0700 Subject: [PATCH 3/3] Move down. --- .../Portable}/BraceMatching/AbstractCSharpBraceMatcher.cs | 2 +- .../BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs | 2 +- .../BraceMatching/CSharpEmbeddedLanguageBraceMatcher.cs | 2 +- .../Portable}/BraceMatching/LessThanGreaterThanBraceMatcher.cs | 2 +- .../Portable}/BraceMatching/OpenCloseBraceBraceMatcher.cs | 2 +- .../Portable}/BraceMatching/OpenCloseBracketBraceMatcher.cs | 2 +- .../Portable}/BraceMatching/OpenCloseParenBraceMatcher.cs | 2 +- .../CSharp/Portable}/BraceMatching/StringLiteralBraceMatcher.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename src/{EditorFeatures/CSharp => Features/CSharp/Portable}/BraceMatching/AbstractCSharpBraceMatcher.cs (91%) rename src/{EditorFeatures/CSharp => Features/CSharp/Portable}/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs (96%) rename src/{EditorFeatures/CSharp => Features/CSharp/Portable}/BraceMatching/CSharpEmbeddedLanguageBraceMatcher.cs (94%) rename src/{EditorFeatures/CSharp => Features/CSharp/Portable}/BraceMatching/LessThanGreaterThanBraceMatcher.cs (92%) rename src/{EditorFeatures/CSharp => Features/CSharp/Portable}/BraceMatching/OpenCloseBraceBraceMatcher.cs (92%) rename src/{EditorFeatures/CSharp => Features/CSharp/Portable}/BraceMatching/OpenCloseBracketBraceMatcher.cs (92%) rename src/{EditorFeatures/CSharp => Features/CSharp/Portable}/BraceMatching/OpenCloseParenBraceMatcher.cs (92%) rename src/{EditorFeatures/CSharp => Features/CSharp/Portable}/BraceMatching/StringLiteralBraceMatcher.cs (98%) diff --git a/src/EditorFeatures/CSharp/BraceMatching/AbstractCSharpBraceMatcher.cs b/src/Features/CSharp/Portable/BraceMatching/AbstractCSharpBraceMatcher.cs similarity index 91% rename from src/EditorFeatures/CSharp/BraceMatching/AbstractCSharpBraceMatcher.cs rename to src/Features/CSharp/Portable/BraceMatching/AbstractCSharpBraceMatcher.cs index 0a3ec3be5557b..1e45c7aa47af1 100644 --- a/src/EditorFeatures/CSharp/BraceMatching/AbstractCSharpBraceMatcher.cs +++ b/src/Features/CSharp/Portable/BraceMatching/AbstractCSharpBraceMatcher.cs @@ -5,7 +5,7 @@ using Microsoft.CodeAnalysis.BraceMatching; using Microsoft.CodeAnalysis.CSharp; -namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching +namespace Microsoft.CodeAnalysis.CSharp.BraceMatching { internal abstract class AbstractCSharpBraceMatcher : AbstractBraceMatcher { diff --git a/src/EditorFeatures/CSharp/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs b/src/Features/CSharp/Portable/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs similarity index 96% rename from src/EditorFeatures/CSharp/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs rename to src/Features/CSharp/Portable/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs index cdec8d08c2ad1..32bd7062c9884 100644 --- a/src/EditorFeatures/CSharp/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs +++ b/src/Features/CSharp/Portable/BraceMatching/CSharpDirectiveTriviaBraceMatcher.cs @@ -13,7 +13,7 @@ using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.Text; -namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching +namespace Microsoft.CodeAnalysis.CSharp.BraceMatching { [ExportBraceMatcher(LanguageNames.CSharp), Shared] internal class CSharpDirectiveTriviaBraceMatcher : AbstractDirectiveTriviaBraceMatcher