From cd8078c4df2df28aef6c194b255568579884df75 Mon Sep 17 00:00:00 2001 From: francis-andrade Date: Sun, 3 Dec 2017 16:40:15 +0000 Subject: [PATCH 1/3] Fixes issue #16228 --- .../bracketMatching/bracketMatching.ts | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts index fbd1a37d39c96..5df1f747a6fc1 100644 --- a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts @@ -16,10 +16,19 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/browser/editorExtensions'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; +import { registerThemingParticipant, themeColorFromId} from 'vs/platform/theme/common/themeService'; +import { editorBracketMatchBackground, editorBracketMatchBorder} from 'vs/editor/common/view/editorColorRegistry'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; +import { registerColor, overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/common/colorRegistry'; + + +export const editorWordHighlight = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable.')); +export const editorWordHighlightStrong = registerColor('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hc: null }, nls.localize('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable.')); + +export const overviewRulerWordHighlightForeground = registerColor('editorOverviewRuler.wordHighlightForeground', { dark: '#A0A0A0', light: '#A0A0A0', hc: '#A0A0A0' }, nls.localize('overviewRulerWordHighlightForeground', 'Overview ruler marker color for symbol highlights.')); +export const overviewRulerWordHighlightStrongForeground = registerColor('editorOverviewRuler.wordHighlightStrongForeground', { dark: '#C0A0C0', light: '#C0A0C0', hc: '#C0A0C0' }, nls.localize('overviewRulerWordHighlightStrongForeground', 'Overview ruler marker color for write-access symbol highlights.')); + class SelectBracketAction extends EditorAction { constructor() { @@ -150,7 +159,12 @@ export class BracketMatchingController extends Disposable implements editorCommo private static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: 'bracket-match' + className: 'bracket-match', + overviewRuler: { + color: themeColorFromId(overviewRulerSelectionHighlightForeground), + darkColor: themeColorFromId(overviewRulerSelectionHighlightForeground), + position: editorCommon.OverviewRulerLane.Center + } }); private _updateBrackets(): void { From 8e93e7e47b632d0cbc91637720a4e6b034747087 Mon Sep 17 00:00:00 2001 From: francis-andrade Date: Wed, 6 Dec 2017 13:08:45 +0000 Subject: [PATCH 2/3] Fixed Identation --- src/vs/editor/contrib/bracketMatching/bracketMatching.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts index 5df1f747a6fc1..5e6d3e66eede2 100644 --- a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts @@ -16,11 +16,11 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { registerEditorAction, registerEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/browser/editorExtensions'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { registerThemingParticipant, themeColorFromId} from 'vs/platform/theme/common/themeService'; -import { editorBracketMatchBackground, editorBracketMatchBorder} from 'vs/editor/common/view/editorColorRegistry'; +import { registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/common/themeService'; +import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { registerColor, overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/common/colorRegistry'; export const editorWordHighlight = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable.')); From 8c81274edbe0bfcbbd259c077a4d3b44fd00b6c5 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 24 Jan 2018 09:15:30 +0100 Subject: [PATCH 3/3] Fix color registration --- .../contrib/bracketMatching/bracketMatching.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts index 0ce6d4667cf05..5b602985086f1 100644 --- a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts @@ -20,14 +20,10 @@ import { registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/ import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { registerColor, overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor } from 'vs/platform/theme/common/colorRegistry'; import { TrackedRangeStickiness, IModelDeltaDecoration, OverviewRulerLane } from 'vs/editor/common/model'; -export const editorWordHighlight = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable.')); -export const editorWordHighlightStrong = registerColor('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hc: null }, nls.localize('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable.')); - -export const overviewRulerWordHighlightForeground = registerColor('editorOverviewRuler.wordHighlightForeground', { dark: '#A0A0A0', light: '#A0A0A0', hc: '#A0A0A0' }, nls.localize('overviewRulerWordHighlightForeground', 'Overview ruler marker color for symbol highlights.')); -export const overviewRulerWordHighlightStrongForeground = registerColor('editorOverviewRuler.wordHighlightStrongForeground', { dark: '#C0A0C0', light: '#C0A0C0', hc: '#C0A0C0' }, nls.localize('overviewRulerWordHighlightStrongForeground', 'Overview ruler marker color for write-access symbol highlights.')); +const overviewRulerBracketMatchForeground = registerColor('editorOverviewRuler.bracketMatchForeground', { dark: '#A0A0A0', light: '#A0A0A0', hc: '#A0A0A0' }, nls.localize('overviewRulerBracketMatchForeground', 'Overview ruler marker color for matching brackets.')); class JumpToBracketAction extends EditorAction { constructor() { @@ -223,8 +219,8 @@ export class BracketMatchingController extends Disposable implements editorCommo stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'bracket-match', overviewRuler: { - color: themeColorFromId(overviewRulerSelectionHighlightForeground), - darkColor: themeColorFromId(overviewRulerSelectionHighlightForeground), + color: themeColorFromId(overviewRulerBracketMatchForeground), + darkColor: themeColorFromId(overviewRulerBracketMatchForeground), position: OverviewRulerLane.Center } });