diff --git a/src/EditorFeatures/Core/EditorFeatures.csproj b/src/EditorFeatures/Core/EditorFeatures.csproj index f8c3111891166b86178fd66f10b9841372e5ba02..2bac1c9d2fe560841f85c02edfe7550dcd9ee0d3 100644 --- a/src/EditorFeatures/Core/EditorFeatures.csproj +++ b/src/EditorFeatures/Core/EditorFeatures.csproj @@ -308,6 +308,7 @@ + diff --git a/src/EditorFeatures/Core/EditorFeaturesResources.Designer.cs b/src/EditorFeatures/Core/EditorFeaturesResources.Designer.cs index 202c09799a0a63765e6e17694f416b5dfe8d20fb..763fa726c29aa5d65107c510aa600a662a1791b3 100644 --- a/src/EditorFeatures/Core/EditorFeaturesResources.Designer.cs +++ b/src/EditorFeatures/Core/EditorFeaturesResources.Designer.cs @@ -637,6 +637,15 @@ internal class EditorFeaturesResources { } } + /// + /// Looks up a localized string similar to Brace Matching. + /// + internal static string FontAndColors_BraceMatching { + get { + return ResourceManager.GetString("FontAndColors_BraceMatching", resourceCulture); + } + } + /// /// Looks up a localized string similar to Inline Rename. /// diff --git a/src/EditorFeatures/Core/EditorFeaturesResources.resx b/src/EditorFeatures/Core/EditorFeaturesResources.resx index 4a4398ee5d91ee56dcb4e9c1322f25453e04bbb3..91ea64f271f3939f3b289941e282b1d32463281e 100644 --- a/src/EditorFeatures/Core/EditorFeaturesResources.resx +++ b/src/EditorFeatures/Core/EditorFeaturesResources.resx @@ -733,4 +733,7 @@ Do you want to proceed? Cursor must be on a member name. + + Brace Matching + \ No newline at end of file diff --git a/src/EditorFeatures/Core/Implementation/BraceMatching/BraceHighlightTag.cs b/src/EditorFeatures/Core/Implementation/BraceMatching/BraceHighlightTag.cs index a3f969575647d4ef069e2c97c413ab3eccf16c36..8e260be71437eedb508a0f9915101b70a2f10065 100644 --- a/src/EditorFeatures/Core/Implementation/BraceMatching/BraceHighlightTag.cs +++ b/src/EditorFeatures/Core/Implementation/BraceMatching/BraceHighlightTag.cs @@ -6,15 +6,13 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.BraceMatching { internal class BraceHighlightTag : TextMarkerTag { - internal const string TagId = "bracehighlight"; - public static readonly BraceHighlightTag StartTag = new BraceHighlightTag(navigateToStart: true); public static readonly BraceHighlightTag EndTag = new BraceHighlightTag(navigateToStart: false); public bool NavigateToStart { get; } private BraceHighlightTag(bool navigateToStart) - : base(TagId) + : base(ClassificationTypeDefinitions.BraceMatchingName) { this.NavigateToStart = navigateToStart; } diff --git a/src/EditorFeatures/Core/Implementation/BraceMatching/ClassificationTypeDefinitions.cs b/src/EditorFeatures/Core/Implementation/BraceMatching/ClassificationTypeDefinitions.cs new file mode 100644 index 0000000000000000000000000000000000000000..b099f5a2e81f0b1a5246a7a9374b2ef82131524b --- /dev/null +++ b/src/EditorFeatures/Core/Implementation/BraceMatching/ClassificationTypeDefinitions.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.ComponentModel.Composition; +using System.Windows.Media; +using Microsoft.VisualStudio.Language.StandardClassification; +using Microsoft.VisualStudio.Text.Classification; +using Microsoft.VisualStudio.Utilities; + +namespace Microsoft.CodeAnalysis.Editor.Implementation.BraceMatching +{ + internal sealed class ClassificationTypeDefinitions + { + public const string BraceMatchingName = "brace matching"; + + [Export] + [Name(BraceMatchingName)] + [BaseDefinition(PredefinedClassificationTypeNames.FormalLanguage)] + internal readonly ClassificationTypeDefinition BraceMatching; + + [Export(typeof(EditorFormatDefinition))] + [ClassificationType(ClassificationTypeNames = BraceMatchingName)] + [Name(BraceMatchingName)] + [Order(After = Priority.High)] + [UserVisible(true)] + private class BraceMatchingFormatDefinition : ClassificationFormatDefinition + { + private BraceMatchingFormatDefinition() + { + this.DisplayName = EditorFeaturesResources.FontAndColors_BraceMatching; + this.BackgroundColor = Color.FromRgb(0xDB, 0xE0, 0xCC); + } + } + } +}