Skip to content

Commit

Permalink
Merge pull request #62965 from CyrusNajmabadi/braceMatchingDowqn
Browse files Browse the repository at this point in the history
Move BraceMatching data service down to Features layer.
  • Loading branch information
CyrusNajmabadi committed Jul 27, 2022
2 parents bfb1e25 + ed4f098 commit 35fda5c
Show file tree
Hide file tree
Showing 43 changed files with 87 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.DocumentHighlighting;
using Microsoft.CodeAnalysis.Options;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
// See the LICENSE file in the project root for more information.

using System;
using System.ComponentModel.Composition;
using System.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.BraceMatching;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api;
using Microsoft.CodeAnalysis.Host.Mef;

namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript
{
[ExportBraceMatcher(InternalLanguageNames.TypeScript)]
[ExportBraceMatcher(InternalLanguageNames.TypeScript), Shared]
internal sealed class VSTypeScriptBraceMatcher : IBraceMatcher
{
private readonly IVSTypeScriptBraceMatcherImplementation _impl;
Expand Down
6 changes: 1 addition & 5 deletions src/EditorFeatures/Test/Attributes/AttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/EditorFeatures/Test/Options/GlobalOptionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@

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;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
namespace Microsoft.CodeAnalysis.CSharp.BraceMatching
{
[ExportBraceMatcher(LanguageNames.CSharp)]
[ExportBraceMatcher(LanguageNames.CSharp), Shared]
internal class CSharpDirectiveTriviaBraceMatcher : AbstractDirectiveTriviaBraceMatcher<DirectiveTriviaSyntax,
IfDirectiveTriviaSyntax, ElifDirectiveTriviaSyntax,
ElseDirectiveTriviaSyntax, EndIfDirectiveTriviaSyntax,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.BraceMatching;
using Microsoft.CodeAnalysis.CSharp.EmbeddedLanguages.LanguageServices;
using Microsoft.CodeAnalysis.CSharp.LanguageServices;
using Microsoft.CodeAnalysis.EmbeddedLanguages;
using Microsoft.CodeAnalysis.Host.Mef;

namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
namespace Microsoft.CodeAnalysis.CSharp.BraceMatching
{
[ExportBraceMatcher(LanguageNames.CSharp)]
[ExportBraceMatcher(LanguageNames.CSharp), Shared]
internal class CSharpEmbeddedLanguageBraceMatcher : AbstractEmbeddedLanguageBraceMatcher
{
[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// See the LICENSE file in the project root for more information.

using System;
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.BraceMatching;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Host.Mef;

namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
namespace Microsoft.CodeAnalysis.CSharp.BraceMatching
{
[ExportBraceMatcher(LanguageNames.CSharp)]
[ExportBraceMatcher(LanguageNames.CSharp), Shared]
internal class LessThanGreaterThanBraceMatcher : AbstractCSharpBraceMatcher
{
[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// See the LICENSE file in the project root for more information.

using System;
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.BraceMatching;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Host.Mef;

namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
namespace Microsoft.CodeAnalysis.CSharp.BraceMatching
{
[ExportBraceMatcher(LanguageNames.CSharp)]
[ExportBraceMatcher(LanguageNames.CSharp), Shared]
internal class OpenCloseBraceBraceMatcher : AbstractCSharpBraceMatcher
{
[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// See the LICENSE file in the project root for more information.

using System;
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.BraceMatching;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Host.Mef;

namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
namespace Microsoft.CodeAnalysis.CSharp.BraceMatching
{
[ExportBraceMatcher(LanguageNames.CSharp)]
[ExportBraceMatcher(LanguageNames.CSharp), Shared]
internal class OpenCloseBracketBraceMatcher : AbstractCSharpBraceMatcher
{
[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// See the LICENSE file in the project root for more information.

using System;
using System.ComponentModel.Composition;
using System.Composition;
using Microsoft.CodeAnalysis.BraceMatching;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Host.Mef;

namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
namespace Microsoft.CodeAnalysis.CSharp.BraceMatching
{
[ExportBraceMatcher(LanguageNames.CSharp)]
[ExportBraceMatcher(LanguageNames.CSharp), Shared]
internal class OpenCloseParenBraceMatcher : AbstractCSharpBraceMatcher
{
[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
// See the LICENSE file in the project root for more information.

using System;
using System.ComponentModel.Composition;
using System.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.BraceMatching;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.Editor.CSharp.BraceMatching
namespace Microsoft.CodeAnalysis.CSharp.BraceMatching
{
[ExportBraceMatcher(LanguageNames.CSharp)]
[ExportBraceMatcher(LanguageNames.CSharp), Shared]
internal class StringLiteralBraceMatcher : IBraceMatcher
{
[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor;

namespace Microsoft.CodeAnalysis.BraceMatching
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.Editor
namespace Microsoft.CodeAnalysis.BraceMatching
{
internal abstract class AbstractDirectiveTriviaBraceMatcher<TDirectiveTriviaSyntax,
TIfDirectiveTriviaSyntax, TElseIfDirectiveTriviaSyntax,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.EmbeddedLanguages;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Shared.Extensions;

namespace Microsoft.CodeAnalysis.BraceMatching
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#nullable disable

using Microsoft;

namespace Microsoft.CodeAnalysis.BraceMatching
{
internal struct BraceCharacterAndKind
internal readonly struct BraceCharacterAndKind
{
public char Character { get; }
public int Kind { get; }

public BraceCharacterAndKind(char character, int kind)
: this()
{
this.Character = character;
this.Kind = kind;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Runtime.Serialization;
using Microsoft.CodeAnalysis.DocumentHighlighting;

namespace Microsoft.CodeAnalysis.Editor
namespace Microsoft.CodeAnalysis.BraceMatching
{
[DataContract]
internal readonly record struct BraceMatchingOptions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.ComponentModel.Composition;
using System.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.Host.Mef;

namespace Microsoft.CodeAnalysis.BraceMatching
{
[Export(typeof(IBraceMatchingService))]
[Export(typeof(IBraceMatchingService)), Shared]
internal class BraceMatchingService : IBraceMatchingService
{
private readonly ImmutableArray<Lazy<IBraceMatcher, LanguageMetadata>> _braceMatchers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.CodeAnalysis.Editor
namespace Microsoft.CodeAnalysis.BraceMatching
{
internal interface IBraceMatcher
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.Editor
namespace Microsoft.CodeAnalysis.BraceMatching
{
internal interface IBraceMatchingService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<JsonKind>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RegexKind>;
using RegexTrivia = EmbeddedSyntaxTrivia<RegexKind>;
Expand Down
Loading

0 comments on commit 35fda5c

Please sign in to comment.