提交 f4c429cc 编写于 作者: D David Poeschl

Add "Brace Matching" color

Partial fix for internal TFS bug #927616 ""Brace Matching (Highlight)"
Color setting is ignored"

This change adds a new "Brace Matching" color (not to be confused with
the existing "Brace Matching (Highlight)" and "Brace Matching
(Rectangle)" colors) that controls the appearance of brace matching. It
is user customizable and the Background color controls the fill
("Highlight") and the Foreground color controls the outline
("Rectangle").

The default background color was chosen to match Visual Studio 2013's
default "Brace Matching (Highlight)" color.

There will also be a related closed-source change for the themed colors,
and that change will complete the bug.
上级 d61d8fda
......@@ -308,6 +308,7 @@
<Compile Include="Implementation\BraceMatching\BraceHighlightingViewTaggerProvider.cs" />
<Compile Include="Implementation\BraceMatching\BraceHighlightTag.cs" />
<Compile Include="Implementation\BraceMatching\BraceMatchingService.cs" />
<Compile Include="Implementation\BraceMatching\ClassificationTypeDefinitions.cs" />
<Compile Include="Implementation\CallHierarchy\AbstractCallHierarchyCommandHandler.cs" />
<Compile Include="Implementation\CallHierarchy\CallHierarchyDetail.cs" />
<Compile Include="Implementation\CallHierarchy\CallHierarchyItem.cs" />
......
......@@ -637,6 +637,15 @@ internal class EditorFeaturesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Brace Matching.
/// </summary>
internal static string FontAndColors_BraceMatching {
get {
return ResourceManager.GetString("FontAndColors_BraceMatching", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Inline Rename.
/// </summary>
......
......@@ -733,4 +733,7 @@ Do you want to proceed?</value>
<data name="CursorMustBeOnAMemberName" xml:space="preserve">
<value>Cursor must be on a member name.</value>
</data>
<data name="FontAndColors_BraceMatching" xml:space="preserve">
<value>Brace Matching</value>
</data>
</root>
\ No newline at end of file
......@@ -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;
}
......
// 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);
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册