Download packages/cli/src/ui/editors/editorSettingsManager.ts from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/editors/editorSettingsManager.ts
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/editors/editorSettingsManager.ts
-
curl -L -o editorSettingsManager.ts https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/editors/editorSettingsManager.ts
1.4 kB
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { | |
| allowEditorTypeInSandbox, | |
| hasValidEditorCommand, | |
| type EditorType, | |
| EDITOR_DISPLAY_NAMES, | |
| } from '@google/gemini-cli-core'; | |
| export interface EditorDisplay { | |
| name: string; | |
| type: EditorType | 'not_set'; | |
| disabled: boolean; | |
| } | |
| class EditorSettingsManager { | |
| private readonly availableEditors: EditorDisplay[]; | |
| constructor() { | |
| // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion | |
| const editorTypes = Object.keys( | |
| EDITOR_DISPLAY_NAMES, | |
| ).sort() as EditorType[]; | |
| this.availableEditors = [ | |
| { | |
| name: 'None', | |
| type: 'not_set', | |
| disabled: false, | |
| }, | |
| ...editorTypes.map((type) => { | |
| const hasEditor = hasValidEditorCommand(type); | |
| const isAllowedInSandbox = allowEditorTypeInSandbox(type); | |
| let labelSuffix = !isAllowedInSandbox | |
| ? ' (Not available in sandbox)' | |
| : ''; | |
| labelSuffix = !hasEditor ? ' (Not installed)' : labelSuffix; | |
| return { | |
| name: EDITOR_DISPLAY_NAMES[type] + labelSuffix, | |
| type, | |
| disabled: !hasEditor || !isAllowedInSandbox, | |
| }; | |
| }), | |
| ]; | |
| } | |
| getAvailableEditorDisplays(): EditorDisplay[] { | |
| return this.availableEditors; | |
| } | |
| } | |
| export const editorSettingsManager = new EditorSettingsManager(); | |