feat(platform): add VS Code Insiders and Kiro editor support

Added support for two new editors:
- VS Code Insiders (code-insiders command)
- Kiro (kido command) - VS Code fork

Changes:
- Added editor definitions to SUPPORTED_EDITORS list
- Added VSCodeInsidersIcon (reuses VS Code icon)
- Added KiroIcon with custom SVG logo
- Updated getEditorIcon() to handle both new commands
- Fixed logger initialization to be lazy-loaded, preventing circular
  dependency error with isBrowser variable during module initialization

Both editors were tested and successfully open directories on macOS.
This commit is contained in:
Shirone
2026-01-11 19:14:44 +01:00
parent 1b9acb1395
commit b9b3695497
2 changed files with 38 additions and 3 deletions

View File

@@ -21,8 +21,14 @@ const execFileAsync = promisify(execFile);
const isWindows = process.platform === 'win32';
const isMac = process.platform === 'darwin';
// Logger for editor detection
const logger = createLogger('editor');
// Lazy-initialized logger for editor detection
let logger: ReturnType<typeof createLogger> | null = null;
function getLogger() {
if (!logger) {
logger = createLogger('editor');
}
return logger;
}
// Cache with TTL for editor detection
let cachedEditors: EditorInfo[] | null = null;
@@ -106,6 +112,12 @@ const [PRIMARY_ANTIGRAVITY_COMMAND, ...LEGACY_ANTIGRAVITY_COMMANDS] = ANTIGRAVIT
const SUPPORTED_EDITORS: EditorDefinition[] = [
{ name: 'Cursor', cliCommand: 'cursor', macAppName: 'Cursor' },
{ name: 'VS Code', cliCommand: 'code', macAppName: 'Visual Studio Code' },
{
name: 'VS Code Insiders',
cliCommand: 'code-insiders',
macAppName: 'Visual Studio Code - Insiders',
},
{ name: 'Kiro', cliCommand: 'kido', macAppName: 'Kiro' },
{ name: 'Zed', cliCommand: 'zed', macAppName: 'Zed' },
{ name: 'Sublime Text', cliCommand: 'subl', macAppName: 'Sublime Text' },
{ name: 'Windsurf', cliCommand: 'windsurf', macAppName: 'Windsurf' },
@@ -146,7 +158,7 @@ async function isXcodeFullyInstalled(): Promise<boolean> {
const xcodeAppPath = await findMacApp('Xcode');
if (xedExists && xcodeAppPath) {
logger.warn(
getLogger().warn(
'Xcode is installed but xcode-select is pointing to Command Line Tools. ' +
'To use Xcode as an editor, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer'
);