Change:
We have as explicit context key which is driven with the . This is all fine but actually not needed. Any configuration is automatically a context key when prefixed with - , the setting is and you can use as context key
That's useful, thank you I didn't know

Discussion:
import { DisposableStore, Disposable } from 'vs/base/common/lifecycle'; import { GutterActionsRegistry } from 'vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu'; import { Action } from 'vs/base/common/actions'; <del> import { CTX_INLINE_CHAT_TOOLBAR_ICON_ENABLED, IInlineChatService, ShowGutterIcon } from 'vs/workbench/contrib/inlineChat/common/inlineChat'; </del> <ins> import { IInlineChatService, ShowGutterIcon } from 'vs/workbench/contrib/inlineChat/common/inlineChat'; </ins> import { RunOnceScheduler } from 'vs/base/common/async'; import { Iterable } from 'vs/base/common/iterator'; import { Range } from 'vs/editor/common/core/range';

import { IBreakpoint, IDebugService, IDebugSession } from 'vs/workbench/contrib/debug/common/debug'; import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; import { URI } from 'vs/base/common/uri'; <del> import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; </del> <ins> import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; </ins> const GUTTER_INLINE_CHAT_OPAQUE_ICON = registerIcon('inline-chat-opaque', Codicon.sparkle, localize('startInlineChatOpaqueIcon', 'Icon which spawns the inline chat from the gutter. It is half opaque by default and becomes completely opaque on hover.')); const GUTTER_INLINE_CHAT_TRANSPARENT_ICON = registerIcon('inline-chat-transparent', Codicon.sparkle, localize('startInlineChatTransparentIcon', 'Icon which spawns the inline chat from the gutter. It is transparent by default and becomes opaque on hover.')); export class InlineChatDecorationsContribution extends Disposable implements IEditorContribution { <del> private _ctxToolbarIconEnabled: IContextKey<boolean>; </del> private _currentBreakpoints: readonly IBreakpoint[] = []; private _gutterDecorationID: string | undefined; private _inlineChatKeybinding: string | undefined;

super(); this._gutterDecorationTransparent = this._registerGutterDecoration(true); this._gutterDecorationOpaque = this._registerGutterDecoration(false); <del> this._ctxToolbarIconEnabled = CTX_INLINE_CHAT_TOOLBAR_ICON_ENABLED.bindTo(_contextKeyService); this._setToolbarIconEnablementToSetting(); </del> this._register(this._configurationService.onDidChangeConfiguration((e: IConfigurationChangeEvent) => { <del> if (e.affectsConfiguration(InlineChatDecorationsContribution.TOOLBAR_SETTING_ID)) { this._setToolbarIconEnablementToSetting(); return; } </del> if (!e.affectsConfiguration(InlineChatDecorationsContribution.GUTTER_SETTING_ID)) { return; }

this._onEnablementOrModelChanged(); } <del> private _setToolbarIconEnablementToSetting(): void { this._ctxToolbarIconEnabled.set(this._configurationService.getValue<boolean>(InlineChatDecorationsContribution.TOOLBAR_SETTING_ID)); } </del> private _registerGutterDecoration(isTransparent: boolean): ModelDecorationOptions { return ModelDecorationOptions.register({ description: 'inline-chat-decoration',

export const CTX_INLINE_CHAT_CHANGE_HAS_DIFF = new RawContextKey<boolean>('inlineChatChangeHasDiff', false, localize('inlineChatChangeHasDiff', "Whether the current change supports showing a diff")); export const CTX_INLINE_CHAT_CHANGE_SHOWS_DIFF = new RawContextKey<boolean>('inlineChatChangeShowsDiff', false, localize('inlineChatChangeShowsDiff', "Whether the current change showing a diff")); export const CTX_INLINE_CHAT_EDIT_MODE = new RawContextKey<EditMode>('config.inlineChat.mode', EditMode.Live); <del> export const CTX_INLINE_CHAT_TOOLBAR_ICON_ENABLED = new RawContextKey<boolean>('inlineChatToolbarIconEnabled', false, localize('inlineChatToolbarIconEnabled', "Whether the toolbar icon spawning inline chat is enabled.")); </del> <ins> export const CTX_INLINE_CHAT_TOOLBAR_ICON_ENABLED = new RawContextKey<boolean>('config.inlineChat.showToolbarIcon', false); </ins> // --- (select) action identifier