mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 08:31:14 -07:00
[Extension Reloading]: Update custom commands, add enable/disable command (#12547)
This commit is contained in:
@@ -4,8 +4,11 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { LoadedSettings } from '../config/settings.js';
|
||||
import { SettingScope } from '../config/settings.js';
|
||||
import type {
|
||||
LoadableSettingScope,
|
||||
LoadedSettings,
|
||||
} from '../config/settings.js';
|
||||
import { isLoadableSettingScope, SettingScope } from '../config/settings.js';
|
||||
import { settingExistsInScope } from './settingsUtils.js';
|
||||
|
||||
/**
|
||||
@@ -20,7 +23,10 @@ export const SCOPE_LABELS = {
|
||||
/**
|
||||
* Helper function to get scope items for radio button selects
|
||||
*/
|
||||
export function getScopeItems() {
|
||||
export function getScopeItems(): Array<{
|
||||
label: string;
|
||||
value: LoadableSettingScope;
|
||||
}> {
|
||||
return [
|
||||
{ label: SCOPE_LABELS[SettingScope.User], value: SettingScope.User },
|
||||
{
|
||||
@@ -36,12 +42,12 @@ export function getScopeItems() {
|
||||
*/
|
||||
export function getScopeMessageForSetting(
|
||||
settingKey: string,
|
||||
selectedScope: SettingScope,
|
||||
selectedScope: LoadableSettingScope,
|
||||
settings: LoadedSettings,
|
||||
): string {
|
||||
const otherScopes = Object.values(SettingScope).filter(
|
||||
(scope) => scope !== selectedScope,
|
||||
);
|
||||
const otherScopes = Object.values(SettingScope)
|
||||
.filter(isLoadableSettingScope)
|
||||
.filter((scope) => scope !== selectedScope);
|
||||
|
||||
const modifiedInOtherScopes = otherScopes.filter((scope) => {
|
||||
const scopeSettings = settings.forScope(scope).settings;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
import type {
|
||||
Settings,
|
||||
SettingScope,
|
||||
LoadedSettings,
|
||||
LoadableSettingScope,
|
||||
} from '../config/settings.js';
|
||||
import type {
|
||||
SettingDefinition,
|
||||
@@ -391,7 +391,7 @@ export function saveModifiedSettings(
|
||||
modifiedSettings: Set<string>,
|
||||
pendingSettings: Settings,
|
||||
loadedSettings: LoadedSettings,
|
||||
scope: SettingScope,
|
||||
scope: LoadableSettingScope,
|
||||
): void {
|
||||
modifiedSettings.forEach((settingKey) => {
|
||||
const path = settingKey.split('.');
|
||||
|
||||
Reference in New Issue
Block a user