( env: CliEnv = getCliEnv(), )
| 284 | } |
| 285 | |
| 286 | const resolveZedSettingsPaths = ( |
| 287 | env: CliEnv = getCliEnv(), |
| 288 | ): string[] => { |
| 289 | const home = homedir() |
| 290 | const paths: string[] = [] |
| 291 | |
| 292 | const configDirs = new Set<string>() |
| 293 | |
| 294 | const xdgConfig = env.XDG_CONFIG_HOME ?? join(home, '.config') |
| 295 | configDirs.add(join(xdgConfig, 'zed')) |
| 296 | configDirs.add(join(xdgConfig, 'dev.zed.Zed')) |
| 297 | |
| 298 | if (process.platform === 'darwin') { |
| 299 | configDirs.add(join(home, 'Library', 'Application Support', 'Zed')) |
| 300 | configDirs.add(join(home, 'Library', 'Application Support', 'dev.zed.Zed')) |
| 301 | } else if (process.platform === 'win32') { |
| 302 | const appData = env.APPDATA |
| 303 | if (appData) { |
| 304 | configDirs.add(join(appData, 'Zed')) |
| 305 | configDirs.add(join(appData, 'dev.zed.Zed')) |
| 306 | } |
| 307 | } else { |
| 308 | configDirs.add(join(home, '.config', 'zed')) |
| 309 | configDirs.add(join(home, '.config', 'dev.zed.Zed')) |
| 310 | configDirs.add(join(home, '.local', 'share', 'zed')) |
| 311 | configDirs.add(join(home, '.local', 'share', 'dev.zed.Zed')) |
| 312 | } |
| 313 | |
| 314 | const legacyConfig = join(home, '.zed') |
| 315 | configDirs.add(legacyConfig) |
| 316 | |
| 317 | for (const dir of configDirs) { |
| 318 | paths.push(join(dir, 'settings.json')) |
| 319 | } |
| 320 | |
| 321 | return paths |
| 322 | } |
| 323 | |
| 324 | const extractVSCodeTheme = (content: string): ThemeName | null => { |
| 325 | // Try standard colorTheme setting |
no test coverage detected