Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

editor.ts

26 lines995 Bytes

1import { Schema } from "effect";
2import { TrimmedNonEmptyString } from "./baseSchemas";
3​
4export const EDITORS = [
5 { id: "cursor", label: "Cursor", command: "cursor", supportsGoto: true },
6 { id: "vscode", label: "VS Code", command: "code", supportsGoto: true },
7 {
8 id: "vscode-insiders",
9 label: "VS Code Insiders",
10 command: "code-insiders",
11 supportsGoto: true,
12 },
13 { id: "vscodium", label: "VSCodium", command: "codium", supportsGoto: true },
14 { id: "zed", label: "Zed", command: "zed", supportsGoto: false },
15 { id: "antigravity", label: "Antigravity", command: "agy", supportsGoto: false },
16 { id: "file-manager", label: "File Manager", command: null, supportsGoto: false },
17] as const;
18​
19export const EditorId = Schema.Literals(EDITORS.map((e) => e.id));
20export type EditorId = typeof EditorId.Type;
21​
22export const OpenInEditorInput = Schema.Struct({
23 cwd: TrimmedNonEmptyString,
24 editor: EditorId,
25});
26export type OpenInEditorInput = typeof OpenInEditorInput.Type;