Open History to see the last commit
1import { Schema } from "effect";
2import { TrimmedNonEmptyString } from "./baseSchemas";
3
4export const EDITORS = [
5 { id: "cursor", label: "Cursor", command: "cursor", supportsGoto: true },
6 { id: "trae", label: "Trae", command: "trae", supportsGoto: true },
7 { id: "vscode", label: "VS Code", command: "code", supportsGoto: true },
8 {
9 id: "vscode-insiders",
10 label: "VS Code Insiders",
11 command: "code-insiders",
12 supportsGoto: true,
13 },
14 { id: "vscodium", label: "VSCodium", command: "codium", supportsGoto: true },
15 { id: "zed", label: "Zed", command: "zed", supportsGoto: false },
16 { id: "antigravity", label: "Antigravity", command: "agy", supportsGoto: false },
17 { id: "file-manager", label: "File Manager", command: null, supportsGoto: false },
18] as const;
19
20export const EditorId = Schema.Literals(EDITORS.map((e) => e.id));
21export type EditorId = typeof EditorId.Type;
22
23export const OpenInEditorInput = Schema.Struct({
24 cwd: TrimmedNonEmptyString,
25 editor: EditorId,
26});
27export type OpenInEditorInput = typeof OpenInEditorInput.Type;
28
29export class OpenError extends Schema.TaggedErrorClass<OpenError>()("OpenError", {
30 message: Schema.String,
31 cause: Schema.optional(Schema.Defect),
32}) {}