Files
openidea/src/bindings.ts
T
l0ng-ai 79b73394d8 Merge remote-tracking branch 'origin/main' into feat/dotnet-run-configs
# Conflicts:
#	crates/ide-run/src/detect.rs
#	src/platform/locales/text/zh.json
2026-11-01 19:32:30 +08:00

6514 lines
262 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// @ts-nocheck
/* eslint-disable */
// Generated by tauri-specta. Do not edit; run `pnpm gen:bindings`.
// This file has been generated by Tauri Specta. Do not edit this file manually.
import { invoke as __TAURI_INVOKE, Channel } from "@tauri-apps/api/core";
/** Commands */
export const commands = {
appInfo: () => __TAURI_INVOKE<AppInfo>("app_info"),
recentProjects: () => __TAURI_INVOKE<RecentProject[]>("recent_projects"),
removeRecentProject: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("remove_recent_project", { path })),
openProject: (path: string) => typedError<ProjectInfo_Serialize, IdeError>(__TAURI_INVOKE("open_project", { path })),
projectTrustStatus: (path: string) => typedError<TrustStatus, IdeError>(__TAURI_INVOKE("project_trust_status", { path })),
projectTrustList: () => typedError<TrustDecisions, IdeError>(__TAURI_INVOKE("project_trust_list")),
projectTrustSet: (path: string, trusted: boolean, folder: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("project_trust_set", { path, trusted, folder })),
projectTrustRemoveLocation: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("project_trust_remove_location", { path })),
workspaceCreate: (path: string, name: string, projects: string[]) => typedError<IpcPath, IdeError>(__TAURI_INVOKE("workspace_create", { path, name, projects })),
workspaceAttach: (path: string) => typedError<IpcPath, IdeError>(__TAURI_INVOKE("workspace_attach", { path })),
workspaceUpdate: (name: string, projects: string[]) => typedError<ProjectInfo_Serialize, IdeError>(__TAURI_INVOKE("workspace_update", { name, projects })),
windowGroupCurrent: () => typedError<WindowTab[], IdeError>(__TAURI_INVOKE("window_group_current")),
windowGroupMerge: () => typedError<null, IdeError>(__TAURI_INVOKE("window_group_merge")),
windowGroupSelect: (label: string) => typedError<null, IdeError>(__TAURI_INVOKE("window_group_select", { label })),
windowGroupDetach: () => typedError<null, IdeError>(__TAURI_INVOKE("window_group_detach")),
windowGroupClose: (label: string) => typedError<null, IdeError>(__TAURI_INVOKE("window_group_close", { label })),
windowGroupReorder: (labels: string[]) => typedError<null, IdeError>(__TAURI_INVOKE("window_group_reorder", { labels })),
windowGroupRestore: () => typedError<null, IdeError>(__TAURI_INVOKE("window_group_restore")),
/**
* Edits the loose file `path` in this window without a project (LightEdit);
* a window already in LightEdit keeps its files. Returns the effective (global) settings.
*/
lightEditOpen: (path: string) => typedError<Settings_Serialize, IdeError>(__TAURI_INVOKE("light_edit_open", { path })),
/** The project open in this window (a settings window: its parent's), if any. */
projectCurrent: () => __TAURI_INVOKE<{
trusted: boolean,
root: IpcPath,
name: string,
isGit: boolean,
settings: Settings_Serialize,
workspace?: Workspace_Serialize | null,
} | null>("project_current"),
closeProject: () => __TAURI_INVOKE<void>("close_project"),
languages: () => __TAURI_INVOKE<LanguageInfo_Serialize[]>("languages"),
/** Effective settings for the window's project, or global settings without one. */
settingsGet: () => __TAURI_INVOKE<Settings_Serialize>("settings_get"),
/**
* Defaults plus the global layer, without any project's values: what new
* projects (and projects without their own value) get.
*/
settingsGetGlobal: () => __TAURI_INVOKE<Settings_Serialize>("settings_get_global"),
/**
* `value` is JSON text, e.g. `14` or `"dark"`. Every window (for a project
* value: that project's windows) is told (`IdeEvent::SettingsChanged`) so it
* re-reads its effective settings.
*/
settingsSet: (scope: SettingsScope, key: string, value: string) => typedError<Settings_Serialize, IdeError>(__TAURI_INVOKE("settings_set", { scope, key, value })),
/**
* File › Manage IDE Settings › Export Settings…: the global settings plus the
* frontend's IDE-level `storage` (live / file templates, macros) to `path`.
*/
settingsExport: (path: string, storage: { [key in string]: string }) => typedError<null, IdeError>(__TAURI_INVOKE("settings_export", { path, storage })),
/** Import Settings…: replaces the global settings with the file's; every window re-reads them. */
settingsImport: (path: string) => typedError<SettingsImport_Serialize, IdeError>(__TAURI_INVOKE("settings_import", { path })),
/**
* File › Rename Project…: the project's display name (title bar, recent
* projects); an empty `name` restores the folder name. Stored in the project's settings.
*/
projectRename: (name: string) => typedError<ProjectInfo_Serialize, IdeError>(__TAURI_INVOKE("project_rename", { name })),
/**
* Effective source / test / resource / excluded roots of the window's project:
* auto-detected from build files, overridden by Settings › Project Structure.
*/
projectRoots: () => typedError<ProjectRoots, IdeError>(__TAURI_INVOKE("project_roots")),
cancelRequest: (id: RequestId) => __TAURI_INVOKE<void>("cancel_request", { id }),
/**
* Stops a background task the backend reported with `cancellable` set; false when it
* has ended or can't be cancelled.
*/
cancelTask: (id: TaskId) => __TAURI_INVOKE<boolean>("cancel_task", { id }),
/** Routes frontend logs into the backend `tracing` pipeline. */
logFrontend: (level: LogLevel, message: string) => __TAURI_INVOKE<void>("log_frontend", { level, message }),
/** Streams the project's agent events to this window; returns every task. */
agentSubscribe: (onEvent: Channel<AgentEvent>) => typedError<AgentTask[], IdeError>(__TAURI_INVOKE("agent_subscribe", { onEvent })),
agentProviders: () => typedError<AgentProvider[], IdeError>(__TAURI_INVOKE("agent_providers")),
/**
* Agents of the ACP Registry this machine can run, with what is installed; the list
* saved earlier when the registry is unreachable. Cancel with `cancel_request(request)`.
*/
agentRegistryList: (request: RequestId) => typedError<AgentRegistry, IdeError>(__TAURI_INVOKE("agent_registry_list", { request })),
/**
* Installs the registry's current version of agent `id` (also to update it), streaming
* progress through `on_event`. Cancel with `cancel_request(request)`.
*/
agentRegistryInstall: (id: string, request: RequestId, onEvent: Channel<InstallEvent>) => typedError<null, IdeError>(__TAURI_INVOKE("agent_registry_install", { id, request, onEvent })),
/** Removes a registry agent: its agent file and installed files. */
agentRegistryRemove: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("agent_registry_remove", { id })),
/**
* Slash commands to complete for `provider` in `task`'s directory, or in the project
* before a task exists (skills and custom commands on disk included).
*/
agentCommands: (provider: string, task: string | null) => typedError<AgentCommand[], IdeError>(__TAURI_INVOKE("agent_commands", { provider, task })),
/** Entries of `task`'s conversation, or of its subagent `subagent`'s. */
agentEntries: (task: string, subagent: string | null) => typedError<AgentEntry[], IdeError>(__TAURI_INVOKE("agent_entries", { task, subagent })),
agentCreate: (request: NewAgentTask) => typedError<AgentTask, IdeError>(__TAURI_INVOKE("agent_create", { request })),
/** Sends a message; while the agent works it is queued, or with `now` it interrupts the turn. */
agentPrompt: (task: string, prompt: AgentPrompt, now: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("agent_prompt", { task, prompt, now })),
/** Drops a queued message and returns it (to edit it). */
agentUnqueue: (task: string, queued: string) => typedError<AgentQueued, IdeError>(__TAURI_INVOKE("agent_unqueue", { task, queued })),
/** Sends a queued message now, interrupting the current turn. */
agentSendQueuedNow: (task: string, queued: string) => typedError<null, IdeError>(__TAURI_INVOKE("agent_send_queued_now", { task, queued })),
/** Changes a session setting (model, mode, thinking effort…). */
agentSetConfig: (task: string, option: string, value: string) => typedError<null, IdeError>(__TAURI_INVOKE("agent_set_config", { task, option, value })),
/** Copies the task's conversation into a new task, up to its first `turns` turns (all when `None`). */
agentFork: (task: string, turns: number | null) => typedError<AgentTask, IdeError>(__TAURI_INVOKE("agent_fork", { task, turns })),
/** Drops the task's turns after its first `turns`; returns the message of the first dropped one. */
agentRollback: (task: string, turns: number) => typedError<{
text: string,
files: IpcPath[],
images: AgentImage[],
} | null, IdeError>(__TAURI_INVOKE("agent_rollback", { task, turns })),
/**
* What the agent reports about itself when it starts (no session: no MCP servers, hooks
* or sign-in run). Remembered until `refresh`.
*/
agentProbe: (provider: string, refresh: boolean) => typedError<AgentProbe, IdeError>(__TAURI_INVOKE("agent_probe", { provider, refresh })),
/** Stops the task's current turn, or with `subagent` only that subagent's work. */
agentCancel: (task: string, subagent: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("agent_cancel", { task, subagent })),
/** Answers a permission request; `option: null` cancels it. */
agentRespond: (task: string, permission: number, option: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("agent_respond", { task, permission, option })),
agentArchive: (task: string) => typedError<null, IdeError>(__TAURI_INVOKE("agent_archive", { task })),
agentUnarchive: (task: string) => typedError<null, IdeError>(__TAURI_INVOKE("agent_unarchive", { task })),
agentDelete: (task: string, removeWorktree: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("agent_delete", { task, removeWorktree })),
agentChanges: (task: string) => typedError<AgentChange[], IdeError>(__TAURI_INVOKE("agent_changes", { task })),
/** Content of `path` when the task started (left side of its diff). */
agentBaseText: (task: string, path: IpcPath) => typedError<string | null, IdeError>(__TAURI_INVOKE("agent_base_text", { task, path })),
notebookOpen: (path: string) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_open", { path })),
notebookGet: (id: string) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_get", { id })),
notebookEdit: (id: string, version: number, edit: NotebookEdit) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_edit", { id, version, edit })),
notebookSave: (id: string) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_save", { id })),
notebookReload: (id: string) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_reload", { id })),
notebookUndo: (id: string) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_undo", { id })),
notebookRedo: (id: string) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_redo", { id })),
notebookClose: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("notebook_close", { id })),
notebookExecute: (id: string, cells: string[], python: string | null, request: RequestId, onOutput: Channel<NotebookOutputEvent>) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_execute", { id, cells, python, request, onOutput })),
notebookInterrupt: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("notebook_interrupt", { id })),
notebookRestart: (id: string) => typedError<NotebookSnapshot, IdeError>(__TAURI_INVOKE("notebook_restart", { id })),
fsReadDir: (path: string) => typedError<FileEntry[], IdeError>(__TAURI_INVOKE("fs_read_dir", { path })),
fsEntryKind: (path: string) => typedError<EntryKind, IdeError>(__TAURI_INVOKE("fs_entry_kind", { path })),
/** Size and text/binary classification, from the file's head only. */
fsProbe: (path: string) => typedError<FileProbe, IdeError>(__TAURI_INVOKE("fs_probe", { path })),
/** Up to `len` bytes from `offset` (capped per call), base64-encoded. */
fsReadRange: (path: string, offset: number, len: number) => typedError<ByteRange, IdeError>(__TAURI_INVOKE("fs_read_range", { path, offset, len })),
/** An image file as a `data:` URL. */
fsReadImage: (path: string) => typedError<string, IdeError>(__TAURI_INVOKE("fs_read_image", { path })),
/**
* Creates an empty file; inside a project, honours the EditorConfig
* `charset` (writes the BOM for `utf-8-bom` / UTF-16).
*/
fsCreateFile: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("fs_create_file", { path })),
fsCreateFileBytes: (path: string, data: number[]) => typedError<null, IdeError>(__TAURI_INVOKE("fs_create_file_bytes", { path, data })),
fsCreateDir: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("fs_create_dir", { path })),
fsRename: (from: string, to: string) => typedError<null, IdeError>(__TAURI_INVOKE("fs_rename", { from, to })),
/**
* Toggle Read-only Attribute: sets the writable bit (and the open document's
* state). Returns whether the file is read-only now.
*/
fsSetWritable: (path: string, writable: boolean) => typedError<boolean, IdeError>(__TAURI_INVOKE("fs_set_writable", { path, writable })),
/** Moving to the trash can take a while (large trees): kept off the main thread. */
fsDelete: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("fs_delete", { path })),
fsCopy: (from: string, to: string) => typedError<null, IdeError>(__TAURI_INVOKE("fs_copy", { from, to })),
fsCopyMerge: (sourceRoot: string, destinationRoot: string, path: string, overwrite: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("fs_copy_merge", { sourceRoot, destinationRoot, path, overwrite })),
fsCompareDirectories: (left: string, right: string, request: RequestId, onProgress: Channel<DirectoryCompareProgress>) => typedError<DirectoryCompareEntry[], IdeError>(__TAURI_INVOKE("fs_compare_directories", { left, right, request, onProgress })),
/**
* Reads a text file without opening it as a document (previews, quick
* definition). Prefers the unsaved buffer when the file is open.
*/
fsReadText: (path: string) => typedError<string, IdeError>(__TAURI_INVOKE("fs_read_text", { path })),
/** Absolute paths on the clipboard, empty when it holds no file list. */
clipboardFileList: () => typedError<string[], IdeError>(__TAURI_INVOKE("clipboard_file_list")),
/** Whether the clipboard holds files: cheap, for the Paste item's enabled state. */
clipboardHasFiles: () => __TAURI_INVOKE<boolean>("clipboard_has_files"),
/**
* Replaces the clipboard with `paths`, so Explorer can paste them. Best-effort:
* false when the clipboard stayed busy; the caller keeps working either way.
*/
clipboardSetFileList: (paths: string[]) => typedError<boolean, IdeError>(__TAURI_INVOKE("clipboard_set_file_list", { paths })),
/**
* Every installed family, sorted, each flagged monospaced or not. Read on
* first use (off the command threads), cached, and re-queried on `refresh`.
*/
systemFontFamilies: (refresh: boolean) => typedError<FontFamily[], IdeError>(__TAURI_INVOKE("system_font_families", { refresh })),
/**
* Opens a document. Async: reading and decoding a large file must not block
* the main thread (synchronous commands run on it).
*/
docOpen: (path: string) => typedError<DocumentInfo, IdeError>(__TAURI_INVOKE("doc_open", { path })),
/**
* Opens a read-only virtual document (see `lsp_virtual_document`) as an
* editor buffer, so syntax features and language-server requests work in it.
*/
docOpenVirtual: (uri: string) => typedError<DocumentInfo, IdeError>(__TAURI_INVOKE("doc_open_virtual", { uri })),
docClose: (doc: DocId) => typedError<null, IdeError>(__TAURI_INVOKE("doc_close", { doc })),
/**
* Applies a CodeMirror change set; returns the new version. Rejects with
* `outOfSync` when `base_version` is stale; the UI then calls `doc_snapshot`.
*/
docEdit: (doc: DocId, baseVersion: number, changes: ChangeSet) => typedError<number, IdeError>(__TAURI_INVOKE("doc_edit", { doc, baseVersion, changes })),
docSave: (doc: DocId) => typedError<null, IdeError>(__TAURI_INVOKE("doc_save", { doc })),
docSaveAll: () => typedError<null, IdeError>(__TAURI_INVOKE("doc_save_all")),
docSyncFromDisk: () => typedError<null, IdeError>(__TAURI_INVOKE("doc_sync_from_disk")),
docSnapshot: (doc: DocId) => typedError<DocumentInfo, IdeError>(__TAURI_INVOKE("doc_snapshot", { doc })),
/**
* The CodeMirror mode `path` gets when opened (`DocumentInfo::ui_mode`),
* without opening it: previews of closed files.
*/
docUiMode: (path: string) => typedError<string | null, IdeError>(__TAURI_INVOKE("doc_ui_mode", { path })),
/** "Reload with Encoding" (`reload`) or "Convert to Encoding"; returns the new encoding label. */
docSetEncoding: (doc: DocId, encoding: string, reload: boolean) => typedError<string, IdeError>(__TAURI_INVOKE("doc_set_encoding", { doc, encoding, reload })),
docSetLineEnding: (doc: DocId, lineEnding: LineEnding) => typedError<null, IdeError>(__TAURI_INVOKE("doc_set_line_ending", { doc, lineEnding })),
/**
* Structure view: LSP document symbols when available (with tree-sitter
* visibility), tree-sitter otherwise.
* Tree-sitter answers come from the per-document tree cache (incremental
* re-parse); large documents get no syntax structure.
*/
docOutline: (doc: DocId) => typedError<OutlineItem[], IdeError>(__TAURI_INVOKE("doc_outline", { doc })),
docFolding: (doc: DocId) => typedError<FoldRange[], IdeError>(__TAURI_INVOKE("doc_folding", { doc })),
/**
* Tree-sitter highlighting for languages the UI has no CodeMirror mode for;
* empty when the grammar has no highlights query or the document is large.
*/
docHighlights: (doc: DocId) => typedError<SyntaxHighlights, IdeError>(__TAURI_INVOKE("doc_highlights", { doc })),
/**
* Extend Selection (⌥↑): syntax ranges around `offset`, innermost first.
* Large documents fall back to word / line / document ranges.
*/
docSelectionRanges: (doc: DocId, offset: number) => typedError<Range[], IdeError>(__TAURI_INVOKE("doc_selection_ranges", { doc, offset })),
jvmFilePresentations: (paths: string[]) => typedError<JvmFilePresentation[], IdeError>(__TAURI_INVOKE("jvm_file_presentations", { paths })),
/**
* What the structure service supports for a language (`tree`: every query,
* `locals`: scope analysis).
*/
syntaxSupport: (language: LanguageId) => typedError<StructureSupport, IdeError>(__TAURI_INVOKE("syntax_support", { language })),
/** The smallest named node covering `range`, with its ancestors (parent first). */
syntaxNodeAt: (doc: DocId, range: Range, request: number | null) => typedError<{
node: SyntaxNode,
/** Parent first, the root last. */
ancestors: SyntaxNode[],
} | null, IdeError>(__TAURI_INVOKE("syntax_node_at", { doc, range, request })),
/**
* The expression a selection denotes (exact or minimally enclosing), with its
* statement, block and caret candidates.
*/
syntaxExpressionAt: (doc: DocId, range: Range, request: number | null) => typedError<ExpressionAt, IdeError>(__TAURI_INVOKE("syntax_expression_at", { doc, range, request })),
/** `ERROR` / `MISSING` nodes (e.g. a missing `;`) in document order. */
syntaxErrors: (doc: DocId, request: number | null) => typedError<SyntaxErrors, IdeError>(__TAURI_INVOKE("syntax_errors", { doc, request })),
/**
* Scope analysis of the identifier at `pos`: its local definition and
* references, or why it is not a local.
*/
syntaxLocals: (doc: DocId, pos: Pos, request: number | null) => typedError<Locals, IdeError>(__TAURI_INVOKE("syntax_locals", { doc, pos, request })),
/** Identifier tokens spelled `name` in a document, excluding comments and strings. */
syntaxIdentifiers: (doc: DocId, name: string, request: number | null) => typedError<IdentifierOccurrence[], IdeError>(__TAURI_INVOKE("syntax_identifiers", { doc, name, request })),
/**
* [`syntax_identifiers`] over files (open buffers win over disk); files
* without occurrences or without a grammar are left out. Cancellable.
*/
syntaxIdentifiersInFiles: (paths: string[], name: string, request: RequestId) => typedError<FileIdentifiers[], IdeError>(__TAURI_INVOKE("syntax_identifiers_in_files", { paths, name, request })),
/**
* Extend Selection chain plus statement / declaration ranges at `pos`
* (Move Statement, Complete Statement for languages without a Lezer grammar).
*/
syntaxStructuralRanges: (doc: DocId, pos: Pos, request: number | null) => typedError<StructuralRanges, IdeError>(__TAURI_INVOKE("syntax_structural_ranges", { doc, pos, request })),
historyList: (path: string) => typedError<HistoryEntry[], IdeError>(__TAURI_INVOKE("history_list", { path })),
historyContent: (id: string) => typedError<string, IdeError>(__TAURI_INVOKE("history_content", { id })),
/** Show History on a folder: snapshots of the files under it (deleted ones included) and labels. */
historyListDir: (path: string) => typedError<DirectoryHistory, IdeError>(__TAURI_INVOKE("history_list_dir", { path })),
/** Local History › Put Label…: a named point in the history of every file. */
historyPutLabel: (label: string) => typedError<null, IdeError>(__TAURI_INVOKE("history_put_label", { label })),
/**
* Revert to a snapshot: writes its content to `path` (re-creating a deleted
* file and its folders); an open editor updates in place.
*/
historyRestore: (path: string, id: string) => typedError<null, IdeError>(__TAURI_INVOKE("history_restore", { path, id })),
/** `workspace/willRenameFiles` on every interested server (before the move). Cancellable. */
refactorFileMoveEdits: (request: RequestId, moves: FileMove[]) => typedError<FileRenameEdits, IdeError>(__TAURI_INVOKE("refactor_file_move_edits", { request, moves })),
/**
* "Search in comments and strings": textual occurrences of the moved files'
* names, qualified names and paths (before the move). Cancellable.
*/
refactorFileMoveTextEdits: (request: RequestId, moves: FileMove[]) => typedError<WorkspaceEdit, IdeError>(__TAURI_INVOKE("refactor_file_move_text_edits", { request, moves })),
/**
* Applies `edit` (from [`refactor_file_move_edits`], possibly empty), moves the
* files and notifies the servers. Returns the id for [`refactor_undo_file_move`].
*/
refactorMoveFiles: (moves: FileMove[], edit: WorkspaceEdit, label: string) => typedError<number, IdeError>(__TAURI_INVOKE("refactor_move_files", { moves, edit, label })),
/** Undoes a file move: moves back and reverts the reference updates. */
refactorUndoFileMove: (id: number) => typedError<UndoOutcome, IdeError>(__TAURI_INVOKE("refactor_undo_file_move", { id })),
/** Whether the file move `id` can still be undone. */
refactorCanUndoFileMove: (id: number) => typedError<boolean, IdeError>(__TAURI_INVOKE("refactor_can_undo_file_move", { id })),
/** Schedules the invalidation for the next start (`None` cancels a pending one). */
cachesScheduleInvalidation: (options: {
/** Local History of every project. */
localHistory?: boolean,
/** Language server workspaces (jdtls `-data`, …): servers re-import the project. */
languageServers?: boolean,
/** Build tool sync results (Maven / Gradle) and other per-project caches. */
buildCaches?: boolean,
} | null) => typedError<null, IdeError>(__TAURI_INVOKE("caches_schedule_invalidation", { options })),
/** Quits through every window's unsaved-changes check, then starts again. */
appRestart: () => __TAURI_INVOKE<void>("app_restart"),
indexStatus: () => typedError<IndexStatus, IdeError>(__TAURI_INVOKE("index_status")),
findFiles: (query: string, limit: number) => typedError<FileMatch[], IdeError>(__TAURI_INVOKE("find_files", { query, limit })),
findSymbols: (query: string, filter: SymbolFilter, limit: number) => typedError<SymbolMatch[], IdeError>(__TAURI_INVOKE("find_symbols", { query, filter, limit })),
markRecent: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("mark_recent", { path })),
/** Recently opened files, most recent first (⌘E). */
recentFiles: () => typedError<IpcPath[], IdeError>(__TAURI_INVOKE("recent_files")),
removeRecent: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("remove_recent", { path })),
/** The web reference at `pos` of `doc` and its targets; `None` when there is no reference. */
webGoto: (doc: DocId, pos: Pos) => typedError<{
reference: WebReference,
targets: Location[],
} | null, IdeError>(__TAURI_INVOKE("web_goto", { doc, pos })),
/** The existing file or directory a path written in `from` names (`href`, `url()`, a string literal). */
fsResolveReference: (from: IpcPath, value: string) => typedError<string | null, IdeError>(__TAURI_INVOKE("fs_resolve_reference", { from, value })),
/** Files and folders that continue `prefix`, a path being typed in `from`. */
pathCompletions: (from: IpcPath, prefix: string) => typedError<PathCompletion[], IdeError>(__TAURI_INVOKE("path_completions", { from, prefix })),
/** Paths in an HTML document or stylesheet that name no existing file. */
webUnresolvedReferences: (doc: DocId) => typedError<FileReference[], IdeError>(__TAURI_INVOKE("web_unresolved_references", { doc })),
dependencyVersions: (doc: DocId, offset: number | null, request: RequestId) => typedError<DependencyVersions[], IdeError>(__TAURI_INVOKE("dependency_versions", { doc, offset, request })),
/**
* Misspelt words in the comments, string literals and declared names of
* `doc` that `scope` includes (all of its text for prose). Cancel with
* `cancel_request(request)`.
*/
spellCheck: (doc: DocId, scope: SpellScope, request: RequestId) => typedError<Typo[], IdeError>(__TAURI_INVOKE("spell_check", { doc, scope, request })),
/** Replacements for a misspelt `word`, best first (Typo › Change to…). */
spellSuggest: (word: string) => typedError<string[], IdeError>(__TAURI_INVOKE("spell_suggest", { word })),
/**
* Find in Files. Results stream through `on_event`; ends with `Done`.
* Cancel with `cancel_request(request)`.
*/
searchStart: (request: RequestId, query: SearchQuery, onEvent: Channel<SearchEvent>) => typedError<null, IdeError>(__TAURI_INVOKE("search_start", { request, query, onEvent })),
/**
* Replace in Files. Runs off the command thread; progress streams through
* `on_event` and ends with `Done`. Cancel with `cancel_request(request)`.
*
* Edits go through the document layer as one patch per file, so open editors
* update live and undo the whole file's replacements in one step. Unsaved
* editor buffers are replaced in place and left unsaved; files that were not
* open are opened transiently, saved and closed.
*/
replaceInFiles: (request: RequestId, query: SearchQuery, replacement: string, preserveCase: boolean, targets: ReplaceTarget[], onEvent: Channel<ReplaceEvent>) => typedError<null, IdeError>(__TAURI_INVOKE("replace_in_files", { request, query, replacement, preserveCase, targets, onEvent })),
/** Before / after text of `path` for Replace › Preview (unsaved buffer included). */
replacePreview: (query: SearchQuery, replacement: string, preserveCase: boolean, path: string, only: Pos[] | null) => typedError<ReplacePreview, IdeError>(__TAURI_INVOKE("replace_preview", { query, replacement, preserveCase, path, only })),
/** Validates a query (e.g. regex syntax) while the user types. */
searchValidate: (query: SearchQuery) => typedError<null, IdeError>(__TAURI_INVOKE("search_validate", { query })),
lspCompletion: (request: RequestId, doc: DocId, pos: Pos, trigger: string | null) => typedError<CompletionList, IdeError>(__TAURI_INVOKE("lsp_completion", { request, doc, pos, trigger })),
/** Inline (ghost text) suggestions at `pos`; `automatic` when triggered by typing. */
lspInlineCompletion: (request: RequestId, doc: DocId, pos: Pos, automatic: boolean) => typedError<InlineCompletionItem[], IdeError>(__TAURI_INVOKE("lsp_inline_completion", { request, doc, pos, automatic })),
lspResolveCompletion: (doc: DocId, item: CompletionItem) => typedError<CompletionItem, IdeError>(__TAURI_INVOKE("lsp_resolve_completion", { doc, item })),
lspHover: (request: RequestId, doc: DocId, pos: Pos) => typedError<{
contents: Markup,
range: Range | null,
} | null, IdeError>(__TAURI_INVOKE("lsp_hover", { request, doc, pos })),
lspSignatureHelp: (doc: DocId, pos: Pos) => typedError<{
signatures: Signature[],
activeSignature: number,
activeParameter: number,
} | null, IdeError>(__TAURI_INVOKE("lsp_signature_help", { doc, pos })),
lspGoto: (doc: DocId, pos: Pos, kind: GotoKind) => typedError<Location[], IdeError>(__TAURI_INVOKE("lsp_goto", { doc, pos, kind })),
/**
* Implementations of the symbols at `positions`, one list per position (the
* editor's "is implemented / overridden" gutter markers). Cancel with
* `cancel_request(request)`.
*/
lspImplementations: (request: RequestId, doc: DocId, positions: Pos[]) => typedError<Location[][], IdeError>(__TAURI_INVOKE("lsp_implementations", { request, doc, positions })),
/**
* Contents of a read-only language-server document, including JDT library
* classes and disk class files. Cached per project.
*/
lspVirtualDocument: (uri: string) => typedError<VirtualDocument, IdeError>(__TAURI_INVOKE("lsp_virtual_document", { uri })),
lspResolveClassFile: (path: string) => typedError<string, IdeError>(__TAURI_INVOKE("lsp_resolve_class_file", { path })),
/**
* References of the symbol at `pos`. `project_wide` also searches project files
* outside the language server's analysis scope; bulk scans over many symbols
* leave it off. Cancel with `cancel_request(request)`.
*/
lspReferences: (request: RequestId, doc: DocId, pos: Pos, includeDeclaration: boolean, projectWide: boolean) => typedError<References, IdeError>(__TAURI_INVOKE("lsp_references", { request, doc, pos, includeDeclaration, projectWide })),
lspDocumentHighlights: (doc: DocId, pos: Pos) => typedError<Highlight[], IdeError>(__TAURI_INVOKE("lsp_document_highlights", { doc, pos })),
lspWorkspaceSymbols: (request: RequestId, query: string) => typedError<WorkspaceSymbol[], IdeError>(__TAURI_INVOKE("lsp_workspace_symbols", { request, query })),
lspCodeActions: (doc: DocId, range: Range, only: string[]) => typedError<CodeAction[], IdeError>(__TAURI_INVOKE("lsp_code_actions", { doc, range, only })),
/** Cancellable code actions with the kinds the servers advertise (Refactor This, refactoring availability). */
lspCodeActionQuery: (request: RequestId, doc: DocId, range: Range, only: string[]) => typedError<CodeActionQuery, IdeError>(__TAURI_INVOKE("lsp_code_action_query", { request, doc, range, only })),
/** Resolves a code action's edit without applying it (intention preview). */
lspResolveCodeAction: (doc: DocId, action: CodeAction) => typedError<CodeAction, IdeError>(__TAURI_INVOKE("lsp_resolve_code_action", { doc, action })),
/** Resolves (if needed), applies the edit, then runs the command of a code action. */
lspApplyCodeAction: (doc: DocId, action: CodeAction) => typedError<null, IdeError>(__TAURI_INVOKE("lsp_apply_code_action", { doc, action })),
lspPrepareRename: (doc: DocId, pos: Pos) => typedError<{
start: Pos,
end: Pos,
} | null, IdeError>(__TAURI_INVOKE("lsp_prepare_rename", { doc, pos })),
/** Computes the rename edit without applying it, so the UI can preview conflicts. */
lspRename: (request: RequestId, doc: DocId, pos: Pos, newName: string) => typedError<Renamed, IdeError>(__TAURI_INVOKE("lsp_rename", { request, doc, pos, newName })),
lspFormat: (doc: DocId, range: {
start: Pos,
end: Pos,
} | null, options: FormatOptions) => typedError<TextEdit[], IdeError>(__TAURI_INVOKE("lsp_format", { doc, range, options })),
lspInlayHints: (doc: DocId, range: Range) => typedError<InlayHint[], IdeError>(__TAURI_INVOKE("lsp_inlay_hints", { doc, range })),
lspSemanticTokens: (doc: DocId) => typedError<{
/** Flattened `[line, col, len, typeIdx, modifierBits]` quintuples (absolute). */
data: number[],
tokenTypes: string[],
tokenModifiers: string[],
} | null, IdeError>(__TAURI_INVOKE("lsp_semantic_tokens", { doc })),
lspCodeLens: (doc: DocId) => typedError<CodeLens[], IdeError>(__TAURI_INVOKE("lsp_code_lens", { doc })),
/** Links in a document (`href`s, Markdown links, `#include`s…) from its language servers. */
lspDocumentLinks: (doc: DocId) => typedError<DocumentLink[], IdeError>(__TAURI_INVOKE("lsp_document_links", { doc })),
lspCallHierarchy: (request: RequestId, doc: DocId, pos: Pos, direction: HierarchyDirection) => typedError<CallHierarchy, IdeError>(__TAURI_INVOKE("lsp_call_hierarchy", { request, doc, pos, direction })),
lspTypeHierarchy: (doc: DocId, pos: Pos, direction: HierarchyDirection) => typedError<HierarchyItem[], IdeError>(__TAURI_INVOKE("lsp_type_hierarchy", { doc, pos, direction })),
lspServers: () => typedError<ServerInfo[], IdeError>(__TAURI_INVOKE("lsp_servers")),
/** Re-emits the language servers' current diagnostics (the UI loaded after they arrived). */
lspResendDiagnostics: () => typedError<null, IdeError>(__TAURI_INVOKE("lsp_resend_diagnostics")),
lspRestart: (server: ServerId) => typedError<null, IdeError>(__TAURI_INVOKE("lsp_restart", { server })),
/** Applies a (previewed) workspace edit, e.g. after rename confirmation. */
applyWorkspaceEdit: (edit: WorkspaceEdit) => typedError<null, IdeError>(__TAURI_INVOKE("apply_workspace_edit", { edit })),
/**
* Runs a server command (`workspace/executeCommand`), e.g. a completion item's
* follow-up command. Edits the server requests arrive via `workspace/applyEdit`.
*/
lspExecuteCommand: (doc: DocId, command: Command) => typedError<null, IdeError>(__TAURI_INVOKE("lsp_execute_command", { doc, command })),
lspResolveCommand: (request: RequestId, doc: DocId, server: ServerId, command: Command, answers: FormAnswer[]) => typedError<{
command: Command,
formFields: FormField[],
formAnswers: FormAnswer[],
} | null, IdeError>(__TAURI_INVOKE("lsp_resolve_command", { request, doc, server, command, answers })),
lspExecuteCodeAction: (request: RequestId, doc: DocId, action: CodeAction, answers: FormAnswer[]) => typedError<IpcPath[], IdeError>(__TAURI_INVOKE("lsp_execute_code_action", { request, doc, action, answers })),
/** Changes of every repository of the project. */
vcsStatus: () => typedError<FileStatus[], IdeError>(__TAURI_INVOKE("vcs_status")),
/** The project's repositories, the primary one first. */
vcsRoots: () => typedError<VcsRoot[], IdeError>(__TAURI_INVOKE("vcs_roots")),
vcsBranchInfo: (repo: string | null) => typedError<BranchInfo, IdeError>(__TAURI_INVOKE("vcs_branch_info", { repo })),
/** Gutter change markers for a file, computed against its current (unsaved) text. */
vcsLineHunks: (path: string) => typedError<LineHunk[], IdeError>(__TAURI_INVOKE("vcs_line_hunks", { path })),
vcsFileAt: (path: string, rev: string | null) => typedError<string | null, IdeError>(__TAURI_INVOKE("vcs_file_at", { path, rev })),
vcsBlame: (path: string, text: string | null, revision: string | null) => typedError<BlameLine[], IdeError>(__TAURI_INVOKE("vcs_blame", { path, text, revision })),
vcsLog: (repo: string | null, query: LogQuery) => typedError<Commit[], IdeError>(__TAURI_INVOKE("vcs_log", { repo, query })),
vcsCommitFiles: (repo: string | null, commit: string) => typedError<ChangedFile[], IdeError>(__TAURI_INVOKE("vcs_commit_files", { repo, commit })),
/** Combined changes of several commits, `commits` oldest first. */
vcsCommitsChanges: (repo: string | null, commits: string[]) => typedError<RevisionChange[], IdeError>(__TAURI_INVOKE("vcs_commits_changes", { repo, commits })),
vcsBranches: (repo: string | null) => typedError<Branch[], IdeError>(__TAURI_INVOKE("vcs_branches", { repo })),
vcsStashes: (repo: string | null) => typedError<Stash[], IdeError>(__TAURI_INVOKE("vcs_stashes", { repo })),
vcsStage: (paths: string[]) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_stage", { paths })),
vcsAddToIgnore: (paths: string[], destination: IgnoreDestination) => typedError<string[], IdeError>(__TAURI_INVOKE("vcs_add_to_ignore", { paths, destination })),
vcsUnstage: (paths: string[]) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_unstage", { paths })),
vcsStagePatch: (patch: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_stage_patch", { patch })),
vcsDiscard: (paths: string[]) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_discard", { paths })),
vcsCommit: (repo: string | null, message: string, options: CommitOptions) => typedError<string, IdeError>(__TAURI_INVOKE("vcs_commit", { repo, message, options })),
vcsCheckout: (repo: string | null, branch: string, create: boolean, options: {
mode?: CheckoutMode,
/** Required when checking out a remote branch whose local namesake is ahead of it. */
diverged?: DivergedLocal | null,
} | null) => typedError<CheckoutOutcome, IdeError>(__TAURI_INVOKE("vcs_checkout", { repo, branch, create, options })),
vcsDeleteBranch: (repo: string | null, branch: string) => typedError<DeletedBranch, IdeError>(__TAURI_INVOKE("vcs_delete_branch", { repo, branch })),
/** "Restore" of the branch-deleted notification. */
vcsRestoreBranch: (repo: string | null, deleted: DeletedBranch) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_restore_branch", { repo, deleted })),
/** New Branch: creates `name` at `start` (HEAD when absent), optionally checking it out. */
vcsCreateBranch: (repo: string | null, name: string, start: string | null, checkout: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_create_branch", { repo, name, start, checkout })),
/**
* Undo Commit: moves HEAD back to the commit's parent, keeping its changes staged.
* Returns the undone commit's message.
*/
vcsUndoCommit: (repo: string | null, commit: string) => typedError<string, IdeError>(__TAURI_INVOKE("vcs_undo_commit", { repo, commit })),
vcsRenameBranch: (repo: string | null, from: string, to: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_rename_branch", { repo, from, to })),
vcsMerge: (repo: string | null, branch: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_merge", { repo, branch })),
vcsRebase: (repo: string | null, onto: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_rebase", { repo, onto })),
vcsStashPush: (repo: string | null, message: string | null, includeUntracked: boolean, keepIndex: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_stash_push", { repo, message, includeUntracked, keepIndex })),
vcsStashApply: (repo: string | null, index: number, pop: boolean, reinstateIndex: boolean, branch: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_stash_apply", { repo, index, pop, reinstateIndex, branch })),
vcsStashDrop: (repo: string | null, index: number) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_stash_drop", { repo, index })),
/** Network operation; progress lines stream through `on_output`. Cancellable. */
vcsRemote: (repo: string | null, request: RequestId, op: RemoteOp, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_remote", { repo, request, op, onOutput })),
/** The user's side is `ours` (sides swapped during a rebase, as in IDEA). */
vcsConflictVersions: (path: string) => typedError<MergeVersions, IdeError>(__TAURI_INVOKE("vcs_conflict_versions", { path })),
vcsDiffText: (path: string, staged: boolean) => typedError<string, IdeError>(__TAURI_INVOKE("vcs_diff_text", { path, staged })),
/** Line hunks between two arbitrary texts (diff viewer, commit dialog). */
vcsDiffHunks: (oldText: string, newText: string) => __TAURI_INVOKE<LineHunk[]>("vcs_diff_hunks", { oldText, newText }),
/**
* Stages only the selected hunks of a file's working-tree changes.
* Indices refer to `vcs_diff_hunks(index_text, worktree_text)`.
*/
vcsStageHunks: (path: string, hunks: number[]) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_stage_hunks", { path, hunks })),
/** Clones a repository (Get from VCS). Works without an open project. */
vcsClone: (request: RequestId, url: string, dest: string, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_clone", { request, url, dest, onOutput })),
/** `git init` in `dir` (File › New Project… "Create Git repository"). */
vcsInit: (dir: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_init", { dir })),
/**
* Settings › Git › Test: runs `git --version` on `path`, or on the auto-detected
* executable when `path` is empty.
*/
vcsGitVersion: (path: string) => typedError<GitExecutableInfo, IdeError>(__TAURI_INVOKE("vcs_git_version", { path })),
/** The auto-detected git executable (shown as the field's placeholder). */
vcsDetectedGit: () => __TAURI_INVOKE<string | null>("vcs_detected_git"),
/** `git config --get <key>` in the project repository; `None` when unset. */
vcsConfigGet: (repo: string | null, key: string) => typedError<string | null, IdeError>(__TAURI_INVOKE("vcs_config_get", { repo, key })),
/**
* Local history operation that may take a while (hooks, large checkouts); git's
* output streams through `on_output`. Cancellable.
*/
vcsOperation: (repo: string | null, request: RequestId, op: GitOperation, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_operation", { repo, request, op, onOutput })),
vcsCreateTag: (repo: string | null, name: string, commit: string, message: string | null, force: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_create_tag", { repo, name, commit, message, force })),
vcsTags: (repo: string | null) => typedError<string[], IdeError>(__TAURI_INVOKE("vcs_tags", { repo })),
/** Merge dialog: merges `branches` into the current branch. */
vcsMergeWith: (repo: string | null, branches: string[], options: MergeOptions) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_merge_with", { repo, branches, options })),
/** Rebase dialog: rebases the current branch onto `upstream` (or `--onto`). */
vcsRebaseWith: (repo: string | null, upstream: string, options: RebaseOptions) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_rebase_with", { repo, upstream, options })),
vcsRemotes: (repo: string | null) => typedError<Remote[], IdeError>(__TAURI_INVOKE("vcs_remotes", { repo })),
vcsEditRemote: (repo: string | null, edit: RemoteEdit) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_edit_remote", { repo, edit })),
vcsWorktrees: (repo: string | null) => typedError<Worktree[], IdeError>(__TAURI_INVOKE("vcs_worktrees", { repo })),
vcsAddWorktree: (repo: string | null, path: string, commitish: string, newBranch: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_add_worktree", { repo, path, commitish, newBranch })),
vcsRemoveWorktree: (repo: string | null, path: string, force: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_remove_worktree", { repo, path, force })),
/** Compare with Local: tracked files that differ between `rev` and the working tree. */
vcsDiffWithWorktree: (repo: string | null, rev: string) => typedError<ChangedFile[], IdeError>(__TAURI_INVOKE("vcs_diff_with_worktree", { repo, rev })),
vcsCompareScope: (paths: string[]) => typedError<CompareScope, IdeError>(__TAURI_INVOKE("vcs_compare_scope", { paths })),
vcsComparePaths: (paths: string[], revision: string, repositories: string[] | null, request: RequestId) => typedError<CompareResult, IdeError>(__TAURI_INVOKE("vcs_compare_paths", { paths, revision, repositories, request })),
/** Files that differ between two revisions (the "N files updated" of Update Project). */
vcsDiffRevisions: (repo: string | null, from: string, to: string) => typedError<ChangedFile[], IdeError>(__TAURI_INVOKE("vcs_diff_revisions", { repo, from, to })),
/** The best common ancestor of `a` and `b` (`git merge-base`), if any. */
vcsMergeBase: (repo: string | null, a: string, b: string) => typedError<string | null, IdeError>(__TAURI_INVOKE("vcs_merge_base", { repo, a, b })),
vcsCreatePatch: (repo: string | null, source: PatchSource) => typedError<string, IdeError>(__TAURI_INVOKE("vcs_create_patch", { repo, source })),
vcsPatchPreview: (repo: string | null, patch: string) => typedError<PatchFile[], IdeError>(__TAURI_INVOKE("vcs_patch_preview", { repo, patch })),
vcsApplyPatch: (repo: string | null, patch: string) => typedError<ApplyOutcome, IdeError>(__TAURI_INVOKE("vcs_apply_patch", { repo, patch })),
/** Shelve Changes: saves the changes of `paths` as a patch on the shelf and reverts them. */
vcsShelve: (name: string, paths: string[]) => typedError<ShelvedChangeList, IdeError>(__TAURI_INVOKE("vcs_shelve", { name, paths })),
vcsShelves: () => typedError<ShelvedChangeList[], IdeError>(__TAURI_INVOKE("vcs_shelves")),
/**
* Unshelve: applies the shelved patch (3-way merging; conflicts are left for the
* merge UI); with `remove`, deletes it from the shelf.
*/
vcsUnshelve: (id: string, remove: boolean, path: string | null) => typedError<ApplyOutcome, IdeError>(__TAURI_INVOKE("vcs_unshelve", { id, remove, path })),
vcsShelfDelete: (id: string, path: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_shelf_delete", { id, path })),
vcsShelfRename: (id: string, name: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_shelf_rename", { id, name })),
vcsShelfPatch: (id: string, path: string | null) => typedError<string, IdeError>(__TAURI_INVOKE("vcs_shelf_patch", { id, path })),
vcsShelfDiff: (id: string) => typedError<ShelfDiffFile[], IdeError>(__TAURI_INVOKE("vcs_shelf_diff", { id })),
vcsShelfImport: (name: string, patch: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_shelf_import", { name, patch })),
vcsChangelistsLoad: () => typedError<ChangelistState, IdeError>(__TAURI_INVOKE("vcs_changelists_load")),
vcsChangelistsSave: (changelists: ChangelistState) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_changelists_save", { changelists })),
/** Create Patch › Save to file. */
vcsWritePatch: (path: string, patch: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_write_patch", { path, patch })),
/**
* Async to stay off the main thread: forking the IDE (its whole address space)
* to start the shell takes tens of milliseconds, a frozen UI if run there.
*/
termSpawn: (options: TerminalOptions, onOutput: Channel<string>) => typedError<TerminalInfo, IdeError>(__TAURI_INVOKE("term_spawn", { options, onOutput })),
termWrite: (id: TerminalId, data: string) => typedError<null, IdeError>(__TAURI_INVOKE("term_write", { id, data })),
termResize: (id: TerminalId, cols: number, rows: number) => typedError<null, IdeError>(__TAURI_INVOKE("term_resize", { id, cols, rows })),
termKill: (id: TerminalId) => typedError<null, IdeError>(__TAURI_INVOKE("term_kill", { id })),
/**
* Whether the session is running a command (closing its tab asks first). A
* `tcgetpgrp` or one process snapshot: async only to stay off the main thread.
*/
termIsBusy: (id: TerminalId) => typedError<boolean, IdeError>(__TAURI_INVOKE("term_is_busy", { id })),
/** Shell used when Settings › Terminal › Shell path is empty. */
termDefaultShell: () => __TAURI_INVOKE<string>("term_default_shell"),
/** Installed shells for the Terminal's "New Predefined Session" menu. */
termAvailableShells: () => __TAURI_INVOKE<string[]>("term_available_shells"),
/** Detected configs followed by user-defined ones (user ids win on conflict). */
runConfigs: () => typedError<RunConfig_Serialize[], IdeError>(__TAURI_INVOKE("run_configs")),
runDotnetResolve: (config: RunConfig_Deserialize, debug: boolean) => typedError<RunConfig_Serialize, IdeError>(__TAURI_INVOKE("run_dotnet_resolve", { config, debug })),
runSaveConfigs: (configs: RunConfig_Deserialize[], removedDetectedIds: string[] | null) => typedError<null, IdeError>(__TAURI_INVOKE("run_save_configs", { configs, removedDetectedIds })),
/** Configuration templates: per-type defaults applied to new configurations. */
runTemplates: () => typedError<RunConfig_Serialize[], IdeError>(__TAURI_INVOKE("run_templates")),
runSaveTemplates: (templates: RunConfig_Deserialize[]) => typedError<null, IdeError>(__TAURI_INVOKE("run_save_templates", { templates })),
/** The environment runs inherit when "Include system environment variables" is on. */
runSystemEnv: () => __TAURI_INVOKE<{ [key in string]: string }>("run_system_env"),
runStart: (config: RunConfig_Deserialize, onOutput: Channel<OutputChunk>) => typedError<RunInfo, IdeError>(__TAURI_INVOKE("run_start", { config, onOutput })),
runStop: (id: RunId) => typedError<null, IdeError>(__TAURI_INVOKE("run_stop", { id })),
runStdin: (id: RunId, data: string) => typedError<null, IdeError>(__TAURI_INVOKE("run_stdin", { id, data })),
runList: () => __TAURI_INVOKE<RunInfo[]>("run_list"),
runCloseStdin: (id: RunId) => typedError<null, IdeError>(__TAURI_INVOKE("run_close_stdin", { id })),
/** Terminal size of a run started with "Emulate terminal in output console". */
runResize: (id: RunId, cols: number, rows: number) => typedError<null, IdeError>(__TAURI_INVOKE("run_resize", { id, cols, rows })),
/** Writes the Gradle init script adding `jvm_args` to the JVMs the build forks; returns its path. */
runGradleJvmArgsScript: (jvmArgs: string[]) => typedError<string, IdeError>(__TAURI_INVOKE("run_gradle_jvm_args_script", { jvmArgs })),
runTomcatHome: (home: string) => typedError<TomcatHome, IdeError>(__TAURI_INVOKE("run_tomcat_home", { home })),
runTomcatArtifacts: () => typedError<WebArtifact[], IdeError>(__TAURI_INVOKE("run_tomcat_artifacts")),
runTomcatBuild: (config: RunConfig_Deserialize) => typedError<({
/** Stable id, e.g. `npm:dev`, `cargo:run:app`, or a uuid for user-defined. */
id: string,
name: string,
/** `npm` | `cargo` | `gradle` | `maven` | `go` | `python` | `pytest` | `make` | `shell` … */
kind: string,
command: string,
args: string[],
cwd: IpcPath | null,
env: { [key in string]: string },
/** Detected configs are regenerated; user configs persist in `.openidea/run.toml`. */
detected: boolean,
/** Test runner configs render results in the test tree. */
isTest: boolean,
/** DAP adapter that can debug this config, if any. */
debugAdapter: string | null,
/** "Allow multiple instances": Run on a running config starts another one instead of restarting it. */
allowParallel?: boolean,
}) & (RunExtras_Serialize) | null, IdeError>(__TAURI_INVOKE("run_tomcat_build", { config })),
runApplicationBuild: (config: RunConfig_Deserialize, module: string) => typedError<RunConfig_Serialize, IdeError>(__TAURI_INVOKE("run_application_build", { config, module })),
runApplicationPublish: (config: RunConfig_Deserialize, classPaths: string[], mainClass: string) => typedError<null, IdeError>(__TAURI_INVOKE("run_application_publish", { config, classPaths, mainClass })),
runTomcatUpdate: (config: RunConfig_Deserialize, mode: string) => typedError<null, IdeError>(__TAURI_INVOKE("run_tomcat_update", { config, mode })),
/**
* Results from the JUnit XML reports (Surefire, Failsafe, Gradle) of the module at
* `module` (relative to the project root) written since `since_ms` (Unix epoch, ms).
*/
runTestReports: (module: string | null, sinceMs: number | null) => typedError<TestCaseReport[], IdeError>(__TAURI_INVOKE("run_test_reports", { module, sinceMs })),
/** Maven and Gradle projects of the window's project, from the build files plus the last sync. */
buildModel: () => typedError<BuildModel, IdeError>(__TAURI_INVOKE("build_model")),
/**
* Runs Maven (`help:effective-pom dependency:tree`) or Gradle (`tasks --all`) in the
* background, reporting progress on `on_progress`; cancellable with `cancel_request(request)`.
* Returns the refreshed model; a failed build is reported in its `syncError`.
*/
buildSync: (tool: BuildTool, request: RequestId, offline: boolean, profiles: string[], onProgress: Channel<SyncProgress>) => typedError<BuildModel, IdeError>(__TAURI_INVOKE("build_sync", { tool, request, offline, profiles, onProgress })),
/** Where the direct dependency `dependency` of the Maven module `pom` is declared. */
mavenDependencyDeclaration: (pom: string, dependency: ArtifactKey) => typedError<Location, IdeError>(__TAURI_INVOKE("maven_dependency_declaration", { pom, dependency })),
/**
* Adds an `<exclusion>` of `exclusion` to the declaration of the direct dependency
* `dependency` of the Maven module `pom`, through the open document when there is one
* (saved). Returns the declaration; nothing changes when it already excludes it.
*/
mavenExcludeDependency: (pom: string, dependency: ArtifactKey, exclusion: ArtifactKey) => typedError<Location, IdeError>(__TAURI_INVOKE("maven_exclude_dependency", { pom, dependency, exclusion })),
/**
* Build › Build Project / Rebuild Project / Build Module (`file`: a file or folder of the
* module) / Build Artifacts, streaming the console and messages on `on_event`; cancellable
* with `cancel_request(request)`. Diagnostics of `clear` (the files of the previous build)
* are cleared first; the new messages are published as `build` diagnostics.
*/
buildRun: (kind: BuildKind, file: string | null, request: RequestId, clear: string[], onEvent: Channel<BuildEvent>) => typedError<BuildResult, IdeError>(__TAURI_INVOKE("build_run", { kind, file, request, clear, onEvent })),
/**
* Cancellable with `cancel_request(request)`.
* Builds the workspace (when `build`), then resolves the runtime (or test)
* classpath and the JDK of the module at `module` (absolute, or relative to the project root).
* A module with Kotlin / Groovy / Scala sources is built by its build system, whose class directories come first.
*/
javaResolveLaunch: (module: string, test: boolean, build: boolean, request: RequestId) => typedError<JavaLaunchInfo, IdeError>(__TAURI_INVOKE("java_resolve_launch", { module, test, build, request })),
/** Port of java-debug's DAP server inside the jdtls serving `module` (started on demand). */
javaDebugServer: (module: string) => typedError<number, IdeError>(__TAURI_INVOKE("java_debug_server", { module })),
/** Incremental build of the jdtls workspace serving `module` (e.g. before HotSwap). */
javaBuildWorkspace: (module: string) => typedError<JavaBuildStatus, IdeError>(__TAURI_INVOKE("java_build_workspace", { module })),
/** Starts a session owned by this window: its events (and those of child sessions) go here only. */
debugStart: (config: LaunchConfig) => typedError<DebugSessionId, IdeError>(__TAURI_INVOKE("debug_start", { config })),
debugSetBreakpoints: (path: string, breakpoints: Breakpoint[]) => typedError<BreakpointState[], IdeError>(__TAURI_INVOKE("debug_set_breakpoints", { path, breakpoints })),
debugThreads: (session: DebugSessionId) => typedError<ThreadInfo[], IdeError>(__TAURI_INVOKE("debug_threads", { session })),
debugStackTrace: (session: DebugSessionId, threadId: number) => typedError<StackFrame[], IdeError>(__TAURI_INVOKE("debug_stack_trace", { session, threadId })),
debugScopes: (session: DebugSessionId, frameId: number) => typedError<Scope[], IdeError>(__TAURI_INVOKE("debug_scopes", { session, frameId })),
debugVariables: (session: DebugSessionId, reference: number) => typedError<Variable[], IdeError>(__TAURI_INVOKE("debug_variables", { session, reference })),
debugEvaluate: (session: DebugSessionId, frameId: number | null, expression: string) => typedError<Variable, IdeError>(__TAURI_INVOKE("debug_evaluate", { session, frameId, expression })),
debugResume: (session: DebugSessionId, threadId: number) => typedError<null, IdeError>(__TAURI_INVOKE("debug_resume", { session, threadId })),
debugPause: (session: DebugSessionId, threadId: number) => typedError<null, IdeError>(__TAURI_INVOKE("debug_pause", { session, threadId })),
debugStep: (session: DebugSessionId, threadId: number, kind: StepKind) => typedError<null, IdeError>(__TAURI_INVOKE("debug_step", { session, threadId, kind })),
debugRunTo: (session: DebugSessionId, threadId: number, path: string, line: number, force: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("debug_run_to", { session, threadId, path, line, force })),
debugStop: (session: DebugSessionId) => typedError<null, IdeError>(__TAURI_INVOKE("debug_stop", { session })),
/** Evaluate with an explicit DAP context: `repl`, `watch`, `hover` or `clipboard`. */
debugEvaluateIn: (session: DebugSessionId, frameId: number | null, expression: string, context: string | null) => typedError<Variable, IdeError>(__TAURI_INVOKE("debug_evaluate_in", { session, frameId, expression, context })),
/** Last known verification states of a file's breakpoints (refetch on `breakpointsChanged`). */
debugBreakpointStates: (path: string) => typedError<BreakpointState[], IdeError>(__TAURI_INVOKE("debug_breakpoint_states", { path })),
/** This window's live sessions, including adapter-started child sessions. */
debugSessions: () => typedError<SessionInfo[], IdeError>(__TAURI_INVOKE("debug_sessions")),
/** Status of every known language server / debug adapter and the languages using it. */
toolsList: () => typedError<ToolInfo[], IdeError>(__TAURI_INVOKE("tools_list")),
/**
* Installs (or reinstalls) a tool into `<app-data>/tools`, streaming output through
* `on_event`. Cancel with `cancel_request(request)`.
*/
toolsInstall: (name: string, request: RequestId, onEvent: Channel<InstallEvent>) => typedError<ToolInfo, IdeError>(__TAURI_INVOKE("tools_install", { name, request, onEvent })),
/** Removes a tool the IDE installed. */
toolsUninstall: (name: string) => typedError<ToolInfo, IdeError>(__TAURI_INVOKE("tools_uninstall", { name })),
/** JDK distributions Download JDK offers. */
jdkDownloadVendors: () => __TAURI_INVOKE<JdkVendor[]>("jdk_download_vendors"),
/** Java versions `vendor` publishes; cancellable with `cancel_request(request)`. */
jdkDownloadReleases: (vendor: string, request: RequestId) => typedError<JdkReleases, IdeError>(__TAURI_INVOKE("jdk_download_releases", { vendor, request })),
/** Where Download JDK puts JDKs unless told otherwise. */
jdkDownloadLocation: () => typedError<IpcPath, IdeError>(__TAURI_INVOKE("jdk_download_location")),
/**
* Downloads the latest `vendor` JDK of Java `version` into `location` (default:
* [`jdk_download_location`]), streaming progress through `on_event`; cancellable
* with `cancel_request(request)`. The JDK is then detected like an installed one,
* and language servers waiting for a JDK (jdtls) start on it.
*/
jdkDownload: (vendor: string, version: number, location: string | null, request: RequestId, onEvent: Channel<InstallEvent>) => typedError<Sdk, IdeError>(__TAURI_INVOKE("jdk_download", { vendor, version, location, request, onEvent })),
/** Installed interpreters / toolchains of `kind`; project-local ones first. */
sdkDetect: (kind: SdkKind) => typedError<Sdk[], IdeError>(__TAURI_INVOKE("sdk_detect", { kind })),
/** The interpreter the project uses: the configured one, else its virtualenv. */
sdkPythonEffective: () => typedError<string | null, IdeError>(__TAURI_INVOKE("sdk_python_effective")),
/**
* SDK / library source folders shown under "External Libraries" in the Project view,
* with the Maven / Gradle dependency jars of the build model.
*/
sdkProjectLibraries: () => typedError<LibraryGroup[], IdeError>(__TAURI_INVOKE("sdk_project_libraries")),
/** Looks up `names` (bare command names): `node_modules/.bin` above `near`, then the search path. */
sdkLocateTools: (names: string[], near: string | null) => typedError<LocatedTools, IdeError>(__TAURI_INVOKE("sdk_locate_tools", { names, near })),
/** `base -m venv location`; output lines stream through `on_output`. */
sdkPythonCreateVenv: (base: string, location: string, request: RequestId, onOutput: Channel<string>) => typedError<Sdk, IdeError>(__TAURI_INVOKE("sdk_python_create_venv", { base, location, request, onOutput })),
sdkPythonPackages: (python: string, request: RequestId) => typedError<PythonPackage[], IdeError>(__TAURI_INVOKE("sdk_python_packages", { python, request })),
/** Installs (`uninstall = false`) or removes a package; output streams through `on_output`. */
sdkPythonPip: (python: string, requirement: string, uninstall: boolean, upgrade: boolean, request: RequestId, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("sdk_python_pip", { python, requirement, uninstall, upgrade, request, onOutput })),
/**
* Opens `path` in a new window (`new_window`) or tells the caller to open it
* itself (`current`). A project already open in some window is focused instead.
* `files` then open in that project's editor.
*/
windowOpenProject: (path: string, newWindow: boolean, files: string[]) => typedError<OpenOutcome, IdeError>(__TAURI_INVOKE("window_open_project", { path, newWindow, files })),
/**
* Loose `files` opened from a window without a local project: a file inside a local project
* open in some window goes to that window, the others to the LightEdit window (this one,
* another, or a new one from a remote project window). Returns the files this window opens
* itself, in LightEdit.
*/
windowOpenFiles: (files: string[]) => typedError<IpcPath[], IdeError>(__TAURI_INVOKE("window_open_files", { files })),
/**
* Detaches an editor tab: opens `file` in a forced new window (`project`, None
* for LightEdit, decided by the caller), bypassing the focus-an-existing-window
* routing of [`window_open_project`] / [`window_open_files`].
*/
windowOpenFileInNewWindow: (project: string | null, file: string) => typedError<OpenOutcome, IdeError>(__TAURI_INVOKE("window_open_file_in_new_window", { project, file })),
/**
* [`window_open_project`] for folder `path` on the host of SSH configuration
* `ssh_config` (Remote Development); a new window connects itself.
*/
windowOpenRemote: (sshConfig: string, path: string, newWindow: boolean) => typedError<OpenOutcome, IdeError>(__TAURI_INVOKE("window_open_remote", { sshConfig, path, newWindow })),
/** Opens an empty (welcome) window; returns its label. */
windowNew: () => typedError<string, IdeError>(__TAURI_INVOKE("window_new")),
/**
* Opens this window's Settings window on `page` (or focuses it and navigates);
* `new_projects` edits the global layer only ("Settings for New Projects").
* `background` (`#rrggbb`) paints a new window until its page has loaded.
*/
windowOpenSettings: (page: string | null, newProjects: boolean, background: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("window_open_settings", { page, newProjects, background })),
/** Focuses the next / previous window (⌘` / ⇧⌘`). */
windowCycle: (forward: boolean) => __TAURI_INVOKE<void>("window_cycle", { forward }),
windowToggleFullscreen: () => typedError<boolean, IdeError>(__TAURI_INVOKE("window_toggle_fullscreen")),
/** Height of the web title bar in native logical pixels (CSS height × IDE zoom). */
windowSetTitlebarHeight: (height: number | null) => typedError<null, IdeError>(__TAURI_INVOKE("window_set_titlebar_height", { height })),
/** What this window was opened for (taken once). */
windowTakeLaunch: () => __TAURI_INVOKE<{
/** Project folder to open. */
project: IpcPath | null,
/**
* Files to open in the editor: in `project` once it is open, else in this
* window's project or (without one) in LightEdit.
*/
files: IpcPath[],
/** Remote project to open (Remote Development). */
remote: RemoteLaunch | null,
/** Settings windows: the page to show. */
settingsPage: string | null,
/** Settings windows: edit the global layer only ("Settings for New Projects"). */
newProjects: boolean,
} | null>("window_take_launch"),
windowCloseContext: () => __TAURI_INVOKE<CloseContext>("window_close_context"),
/** Projects open in project windows, in window order (title bar project widget). */
windowOpenProjects: () => typedError<OpenProject[], IdeError>(__TAURI_INVOKE("window_open_projects")),
/** Quits: closes every window, each of which runs its own unsaved-changes check. */
appQuit: () => __TAURI_INVOKE<void>("app_quit"),
/** A window vetoed the quit (user cancelled its unsaved-changes prompt). */
appCancelQuit: () => __TAURI_INVOKE<void>("app_cancel_quit"),
/** Sets the menu's labels / shortcut text (on locale or keymap change) and rebuilds it. */
menuConfigure: (config: MenuConfig) => __TAURI_INVOKE<void>("menu_configure", { config }),
/** Rebuilds the menu (e.g. after the recent-projects list changed). */
menuRefresh: () => __TAURI_INVOKE<void>("menu_refresh"),
/** The menu bar for a title bar drawn by the frontend (Windows). */
menuModel: () => __TAURI_INVOKE<MenuNode[]>("menu_model"),
/**
* Action ids the focused window cannot run now: their native menu items are
* disabled in place (no rebuild).
*/
menuSetDisabled: (ids: string[]) => __TAURI_INVOKE<void>("menu_set_disabled", { ids }),
appLogLocation: () => typedError<LogLocation, IdeError>(__TAURI_INVOKE("app_log_location")),
appBuildInfo: () => __TAURI_INVOKE<BuildInfo>("app_build_info"),
appCheckUpdate: () => typedError<UpdateCheck, IdeError>(__TAURI_INVOKE("app_check_update")),
/**
* The background check made once per process when the first window starts;
* later calls (other windows) and debug builds get `None`. Failures are logged,
* not reported: the user didn't ask for this check.
*/
appStartupUpdateCheck: () => __TAURI_INVOKE<{
version: string,
currentVersion: string,
notes: string | null,
date: string | null,
} | null>("app_startup_update_check"),
/**
* Downloads and installs the available update, streaming progress to `on_progress`.
* Cancellable through `request` until the download completes; the UI then restarts
* with `app_restart`. One install runs at a time.
*/
appInstallUpdate: (request: RequestId, onProgress: Channel<UpdateProgress>) => typedError<null, IdeError>(__TAURI_INVOKE("app_install_update", { request, onProgress })),
debugExceptionFilters: () => typedError<SessionExceptionFilters[], IdeError>(__TAURI_INVOKE("debug_exception_filters")),
debugSetExceptionBreakpoints: (choices: { [key in string]: boolean }) => typedError<null, IdeError>(__TAURI_INVOKE("debug_set_exception_breakpoints", { choices })),
debugSetVariable: (session: DebugSessionId, container: number, name: string, evaluateName: string | null, frameId: number | null, value: string) => typedError<Variable, IdeError>(__TAURI_INVOKE("debug_set_variable", { session, container, name, evaluateName, frameId, value })),
/** Force Step Over: step over with every breakpoint suspended until the step ends. */
debugForceStepOver: (session: DebugSessionId, threadId: number) => typedError<null, IdeError>(__TAURI_INVOKE("debug_force_step_over", { session, threadId })),
/** Smart Step Into: the calls on the current line of `frame_id`. */
debugStepInTargets: (session: DebugSessionId, frameId: number) => typedError<StepInTarget[], IdeError>(__TAURI_INVOKE("debug_step_in_targets", { session, frameId })),
debugStepInTarget: (session: DebugSessionId, threadId: number, targetId: number) => typedError<null, IdeError>(__TAURI_INVOKE("debug_step_in_target", { session, threadId, targetId })),
/** Reset Frame (Drop Frame). */
debugRestartFrame: (session: DebugSessionId, frameId: number) => typedError<null, IdeError>(__TAURI_INVOKE("debug_restart_frame", { session, frameId })),
debugCapabilities: (session: DebugSessionId) => typedError<DebugCapabilities, IdeError>(__TAURI_INVOKE("debug_capabilities", { session })),
/** Method breakpoints (all files); states aligned with `breakpoints`. */
debugSetFunctionBreakpoints: (breakpoints: FunctionBreakpoint[]) => typedError<BreakpointState[], IdeError>(__TAURI_INVOKE("debug_set_function_breakpoints", { breakpoints })),
/** Field watchpoints; states aligned with `breakpoints`. */
debugSetDataBreakpoints: (breakpoints: DataBreakpoint[]) => typedError<BreakpointState[], IdeError>(__TAURI_INVOKE("debug_set_data_breakpoints", { breakpoints })),
debugDataBreakpointInfo: (session: DebugSessionId, container: number, name: string, frameId: number | null) => typedError<DataBreakpointInfo, IdeError>(__TAURI_INVOKE("debug_data_breakpoint_info", { session, container, name, frameId })),
/** Attach to Process: the user's processes a debugger can attach to. */
debugAttachableProcesses: () => typedError<AttachableProcess[], IdeError>(__TAURI_INVOKE("debug_attachable_processes")),
/**
* Remote JVM Debug in listen mode: waits (cancellable through `request`) for the remote
* JVM to connect to `host:port`; returns the loopback port java-debug attaches to.
*/
debugListenForJvm: (request: RequestId, host: string, port: number) => typedError<number, IdeError>(__TAURI_INVOKE("debug_listen_for_jvm", { request, host, port })),
/** HotSwap (Reload Changed Classes) in a java-debug session. */
debugRedefineClasses: (session: DebugSessionId) => typedError<HotSwapResult, IdeError>(__TAURI_INVOKE("debug_redefine_classes", { session })),
/**
* How to run `config` with coverage: the command to launch and where its report will be,
* or which tool is missing.
*/
coveragePrepare: (config: RunConfig_Deserialize) => typedError<CoveragePrepared_Serialize, IdeError>(__TAURI_INVOKE("coverage_prepare", { config })),
/** Reads the report a coverage run left behind. */
coverageCollect: (report: CoverageReportSpec) => typedError<CoverageSuite, IdeError>(__TAURI_INVOKE("coverage_collect", { report })),
/**
* Reads a report collected elsewhere (CI): lcov, a Go cover profile or JaCoCo XML,
* with paths mapped into this project.
*/
coverageImport: (path: IpcPath) => typedError<CoverageSuite, IdeError>(__TAURI_INVOKE("coverage_import", { path })),
/** The browsers installed on this machine. */
webBrowsers: () => typedError<Browser[], IdeError>(__TAURI_INVOKE("web_browsers")),
/** The built-in server's URL for `path` (started on first use). */
webUrl: (path: IpcPath) => typedError<string, IdeError>(__TAURI_INVOKE("web_url", { path })),
/** Opens `url` in `browser` (an id from `web_browsers`), or the default browser. */
webOpen: (url: string, browser: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("web_open", { url, browser })),
/** How to run `config` under a sampling profiler, or which profiler is missing. */
profilerPrepare: (config: RunConfig_Deserialize) => typedError<ProfilePrepared_Serialize, IdeError>(__TAURI_INVOKE("profiler_prepare", { config })),
/** Reads the profile a profiled run left behind. */
profilerCollect: (spec: ProfileSpec) => typedError<Profile, IdeError>(__TAURI_INVOKE("profiler_collect", { spec })),
/** Routes this window's plugin events to `on_event` (replaces an earlier subscription). */
pluginSubscribe: (onEvent: Channel<PluginEvent>) => __TAURI_INVOKE<void>("plugin_subscribe", { onEvent }),
/**
* Installed plugins plus the dev plugins of this window's project
* (`<project>/.openidea/plugins/*`, rescanned on every call).
*/
pluginList: () => typedError<PluginsSnapshot, IdeError>(__TAURI_INVOKE("plugin_list")),
pluginSetEnabled: (id: string, enabled: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("plugin_set_enabled", { id, enabled })),
/** Installs the plugin package in `path` (a folder with `plugin.toml`). */
pluginInstallDir: (path: string) => typedError<PluginInfo, IdeError>(__TAURI_INVOKE("plugin_install_dir", { path })),
/**
* Plugin packages available locally for installation: `<resources>/plugins`
* when bundled, plus the repository's sample `plugins/` in debug builds.
* There is no network marketplace.
*/
pluginCatalog: () => typedError<CatalogPlugin[], IdeError>(__TAURI_INVOKE("plugin_catalog")),
pluginUninstall: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("plugin_uninstall", { id })),
/** Re-reads a plugin from disk (after rebuilding a dev plugin). */
pluginReload: (id: string) => typedError<PluginInfo, IdeError>(__TAURI_INVOKE("plugin_reload", { id })),
/** Runs a plugin command in the context of this window's project. */
pluginRunCommand: (pluginId: string, commandId: string, arg: string | null) => typedError<string | null, IdeError>(__TAURI_INVOKE("plugin_run_command", { pluginId, commandId, arg })),
/** The UI reports the focused editor's file (`active-file` for plugins). */
pluginSetActiveFile: (path: string | null) => __TAURI_INVOKE<void>("plugin_set_active_file", { path }),
/** Selects a plugin theme; both `None` restores the built-in theme. */
pluginSetTheme: (pluginId: string | null, themeId: string | null) => typedError<{
pluginId: string,
theme: ThemeDef,
} | null, IdeError>(__TAURI_INVOKE("plugin_set_theme", { pluginId, themeId })),
/**
* The UI reports the selected plugin theme's resolved frame colour (`#rrggbb[aa]`),
* which new windows open in before their page loads.
*/
pluginSetThemeFrame: (color: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("plugin_set_theme_frame", { color })),
/**
* Snapshot of process memory and subsystem sizes, summed over all projects.
* Async: the process walk runs on the blocking pool, not the main thread.
*/
appMetrics: () => typedError<AppMetrics, IdeError>(__TAURI_INVOKE("app_metrics")),
/**
* "Clear caches": drops syntax trees and EditorConfig files of the window's
* project, shrinks the in-memory index and compacts its on-disk cache.
*/
clearCaches: () => typedError<ClearCachesResult, IdeError>(__TAURI_INVOKE("clear_caches")),
/**
* Inspect Code: diagnostics of every file in `scope` that a language server
* serves. Files stream through `on_event` as they finish; ends with `Done`.
*/
inspectCode: (request: RequestId, scope: SearchScope, onEvent: Channel<InspectEvent>) => typedError<null, IdeError>(__TAURI_INVOKE("inspect_code", { request, scope, onEvent })),
/** Locate Duplicates over the files of `scope`. */
analysisLocateDuplicates: (request: RequestId, scope: SearchScope, options: DuplicateOptions) => typedError<DuplicatesReport, IdeError>(__TAURI_INVOKE("analysis_locate_duplicates", { request, scope, options })),
/** Languages Search Structurally supports (those with a bundled grammar). */
structuralLanguages: () => typedError<StructuralLanguage[], IdeError>(__TAURI_INVOKE("structural_languages")),
/** Checks a structural search template (and language) while the user types. */
structuralValidate: (query: StructuralQuery) => typedError<null, IdeError>(__TAURI_INVOKE("structural_validate", { query })),
/**
* Search Structurally over `scope`; files with matches stream through
* `on_event`, ending with `Done`. With a replacement, matches carry their
* replacement text (applied by the UI as a workspace edit).
*/
structuralSearch: (request: RequestId, scope: SearchScope, query: StructuralQuery, onEvent: Channel<StructuralEvent>) => typedError<null, IdeError>(__TAURI_INVOKE("structural_search", { request, scope, query, onEvent })),
/** Availability plus containers, images, volumes and networks. */
dockerSnapshot: (endpoint: DockerEndpoint) => typedError<DockerSnapshot, IdeError>(__TAURI_INVOKE("docker_snapshot", { endpoint })),
dockerContainerOp: (endpoint: DockerEndpoint, ids: string[], op: ContainerOp) => typedError<null, IdeError>(__TAURI_INVOKE("docker_container_op", { endpoint, ids, op })),
dockerRemove: (endpoint: DockerEndpoint, object: DockerObject, ids: string[], force: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("docker_remove", { endpoint, object, ids, force })),
/** Pretty-printed `docker inspect` JSON. */
dockerInspect: (endpoint: DockerEndpoint, object: DockerObject, id: string) => typedError<string, IdeError>(__TAURI_INVOKE("docker_inspect", { endpoint, object, id })),
/** Streams a container's log lines until it stops or the request is cancelled. */
dockerLogs: (request: RequestId, endpoint: DockerEndpoint, id: string, tail: number, follow: boolean, timestamps: boolean, onLine: Channel<DockerLogLine>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_logs", { request, endpoint, id, tail, follow, timestamps, onLine })),
/** Follows `docker events` until the daemon goes away or the request is cancelled. */
dockerEvents: (request: RequestId, endpoint: DockerEndpoint, onEvent: Channel<DockerEvent>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_events", { request, endpoint, onEvent })),
/** `docker pull`, logging in first when a saved registry with a password serves the image. */
dockerPull: (request: RequestId, endpoint: DockerEndpoint, reference: string, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_pull", { request, endpoint, reference, onOutput })),
dockerPrune: (request: RequestId, endpoint: DockerEndpoint, target: PruneTarget, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_prune", { request, endpoint, target, onOutput })),
/** `docker compose` start / stop / restart / down of a project found through labels. */
dockerComposeOp: (request: RequestId, endpoint: DockerEndpoint, project: string, files: string[], workingDir: string | null, op: ComposeOp, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_compose_op", { request, endpoint, project, files, workingDir, op, onOutput })),
/** Docker connections and registries (app-wide). */
dockerSettings: () => typedError<DockerSettings, IdeError>(__TAURI_INVOKE("docker_settings")),
dockerSaveSettings: (settings: DockerSettings) => typedError<null, IdeError>(__TAURI_INVOKE("docker_save_settings", { settings })),
/** Saves (`None`: forgets) a registry's password. */
dockerSetRegistryPassword: (id: string, password: string | null) => typedError<null, IdeError>(__TAURI_INVOKE("docker_set_registry_password", { id, password })),
/** Test login to `registry` (`password`, else the saved one) through `endpoint`'s daemon. */
dockerRegistryLogin: (endpoint: DockerEndpoint, registry: DockerRegistry, password: string | null) => typedError<string, IdeError>(__TAURI_INVOKE("docker_registry_login", { endpoint, registry, password })),
/**
* Environment for a Docker run configuration's command line: selects `endpoint`'s
* daemon and puts the docker executable on `PATH`.
*/
dockerRunEnv: (endpoint: DockerEndpoint) => typedError<{ [key in string]: string }, IdeError>(__TAURI_INVOKE("docker_run_env", { endpoint })),
ghAvailability: () => typedError<GhAvailability, IdeError>(__TAURI_INVOKE("gh_availability")),
/** A GitHub GraphQL / REST call through `gh api`; returns the response body. */
ghApi: (request: GhApiRequest) => typedError<string, IdeError>(__TAURI_INVOKE("gh_api", { request })),
ghPrList: (query: PrListQuery) => typedError<PullRequestSummary[], IdeError>(__TAURI_INVOKE("gh_pr_list", { query })),
ghPrView: (number: number) => typedError<PullRequestDetails, IdeError>(__TAURI_INVOKE("gh_pr_view", { number })),
ghPrReviewComments: (number: number) => typedError<PrReviewComment[], IdeError>(__TAURI_INVOKE("gh_pr_review_comments", { number })),
ghPrCheckout: (request: RequestId, number: number, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("gh_pr_checkout", { request, number, onOutput })),
/** Creates a pull request from the current branch (pushing it first when asked); returns its URL. */
ghPrCreate: (request: RequestId, pr: CreatePullRequest, onOutput: Channel<string>) => typedError<string, IdeError>(__TAURI_INVOKE("gh_pr_create", { request, pr, onOutput })),
ghPrReview: (number: number, event: ReviewEvent, body: string) => typedError<null, IdeError>(__TAURI_INVOKE("gh_pr_review", { number, event, body })),
ghPrComment: (number: number, body: string) => typedError<null, IdeError>(__TAURI_INVOKE("gh_pr_comment", { number, body })),
/** Fetches what is missing to diff a pull request locally; returns the revisions to compare. */
ghPrPrepareDiff: (request: RequestId, number: number, headOid: string, baseOid: string, baseRef: string, nameWithOwner: string, onOutput: Channel<string>) => typedError<PrDiffRevisions, IdeError>(__TAURI_INVOKE("gh_pr_prepare_diff", { request, number, headOid, baseOid, baseRef, nameWithOwner, onOutput })),
/** The requests of an `.http` file (gutter run icons, Run All). */
httpRequests: (text: string) => __TAURI_INVOKE<HttpRequestBlock[]>("http_requests", { text }),
/** Environment names from the `http-client(.private).env.json` files that apply to `path`. */
httpEnvironments: (path: string | null) => typedError<string[], IdeError>(__TAURI_INVOKE("http_environments", { path })),
/**
* Sends request `index` of `text` (the editor buffer of `path`) and records
* the exchange in the response history. Cancel with `cancel_request(request)`.
*/
httpExecute: (request: RequestId, path: string | null, text: string, index: number, env: string | null) => typedError<HttpExchange, IdeError>(__TAURI_INVOKE("http_execute", { request, path, text, index, env })),
httpHistory: () => typedError<HttpHistoryEntry[], IdeError>(__TAURI_INVOKE("http_history")),
httpHistoryGet: (id: string) => typedError<HttpExchange, IdeError>(__TAURI_INVOKE("http_history_get", { id })),
httpHistoryClear: () => typedError<null, IdeError>(__TAURI_INVOKE("http_history_clear")),
/**
* System Settings › HTTP Proxy › Check connection: GETs `url` through `proxy` as
* edited (not yet applied); the response status, or why there was none.
*/
proxyCheckConnection: (proxy: ProxySettings, url: string) => typedError<string, IdeError>(__TAURI_INVOKE("proxy_check_connection", { proxy, url })),
dbSources: () => typedError<DataSource[], IdeError>(__TAURI_INVOKE("db_sources")),
dbSaveSources: (sources: DataSource[]) => typedError<null, IdeError>(__TAURI_INVOKE("db_save_sources", { sources })),
/**
* Remembers the password of data source `id` for the session, and in the OS
* saved passwords when `save` (`None` forgets it).
*/
dbSetPassword: (id: string, password: string | null, save: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("db_set_password", { id, password, save })),
/** Remembers the SSH password / key passphrase of a data source (see `db_set_password`). */
dbSetSshSecret: (id: string, secret: string | null, save: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("db_set_ssh_secret", { id, secret, save })),
/**
* Trusts the SSH host key that made the last connection of `id` fail with
* "Unknown SSH host key" (records it in `~/.ssh/known_hosts`).
*/
dbTrustSshHost: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("db_trust_ssh_host", { id })),
/** Test Connection: connects with `config` as edited (not necessarily saved). */
sshTest: (config: SshConfiguration, secret: string | null) => typedError<string, IdeError>(__TAURI_INVOKE("ssh_test", { config, secret })),
/** Remembers the password / passphrase of configuration `id` (`None` forgets it). */
sshSetSecret: (id: string, secret: string | null, save: boolean) => __TAURI_INVOKE<void>("ssh_set_secret", { id, secret, save }),
/** Whether connecting with configuration `id` needs a password first. */
sshNeedsSecret: (id: string) => typedError<boolean, IdeError>(__TAURI_INVOKE("ssh_needs_secret", { id })),
/** Trusts the host key that failed the last connection of configuration `id`. */
sshTrustHost: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("ssh_trust_host", { id })),
/** Ids of the configurations with an open connection. */
sshConnected: () => __TAURI_INVOKE<string[]>("ssh_connected"),
sshDisconnect: (id: string) => __TAURI_INVOKE<void>("ssh_disconnect", { id }),
/** Answers an `IdeEvent::Askpass` prompt (`None`: cancelled); every window drops it. */
sshAskpassAnswer: (id: number, answer: string | null, remember: boolean) => __TAURI_INVOKE<void>("ssh_askpass_answer", { id, answer, remember }),
/** Settings › Git › Saved credentials: `scheme://host` of every saved entry. */
gitCredentials: () => __TAURI_INVOKE<string[]>("git_credentials"),
/** Forgets the credential of `key` (a `git_credentials` entry). */
gitCredentialForget: (key: string) => __TAURI_INVOKE<void>("git_credential_forget", { key }),
/**
* Tools › Start SSH Session: the system `ssh` command line for configuration `id`
* (run in a terminal tab, so prompts and host-key questions are answered there).
*/
sshTerminalCommand: (id: string) => typedError<SshTerminalCommand, IdeError>(__TAURI_INVOKE("ssh_terminal_command", { id })),
deployCoverage: (paths: IpcPath[]) => typedError<DeploymentCoverage[], IdeError>(__TAURI_INVOKE("deploy_coverage", { paths })),
deployUpload: (paths: IpcPath[], server: string | null, request: RequestId) => typedError<TransferReport, IdeError>(__TAURI_INVOKE("deploy_upload", { paths, server, request })),
deployDownload: (paths: IpcPath[], server: string | null, request: RequestId) => typedError<TransferReport, IdeError>(__TAURI_INVOKE("deploy_download", { paths, server, request })),
deployDeleteRemote: (paths: IpcPath[], server: string | null) => typedError<TransferReport, IdeError>(__TAURI_INVOKE("deploy_delete_remote", { paths, server })),
deployCompare: (path: IpcPath, server: string | null, request: RequestId) => typedError<SyncEntry[], IdeError>(__TAURI_INVOKE("deploy_compare", { path, server, request })),
deploySync: (steps: SyncStep[], server: string | null, request: RequestId) => typedError<TransferReport, IdeError>(__TAURI_INVOKE("deploy_sync", { steps, server, request })),
deployInfo: (path: IpcPath, server: string | null) => typedError<{
server: string,
remotePath: string,
webUrl: string | null,
} | null, IdeError>(__TAURI_INVOKE("deploy_info", { path, server })),
deployServerRoot: (server: string) => typedError<string, IdeError>(__TAURI_INVOKE("deploy_server_root", { server })),
remoteList: (connection: FsConnection, path: string) => typedError<RemoteEntry[], IdeError>(__TAURI_INVOKE("remote_list", { connection, path })),
deployTestConnection: (connection: FsConnection, path: string) => typedError<null, IdeError>(__TAURI_INVOKE("deploy_test_connection", { connection, path })),
remoteOpen: (connection: FsConnection, path: string) => typedError<IpcPath, IdeError>(__TAURI_INVOKE("remote_open", { connection, path })),
remoteOf: (path: IpcPath) => __TAURI_INVOKE<[FsConnection, string] | null>("remote_of", { path }),
remoteDelete: (connection: FsConnection, path: string) => typedError<null, IdeError>(__TAURI_INVOKE("remote_delete", { connection, path })),
remoteMkdir: (connection: FsConnection, path: string) => typedError<null, IdeError>(__TAURI_INVOKE("remote_mkdir", { connection, path })),
remoteRename: (connection: FsConnection, from: string, to: string) => typedError<null, IdeError>(__TAURI_INVOKE("remote_rename", { connection, from, to })),
/** Browse before connecting, using the desktop's SSH configuration even in a remote window. */
remoteBootstrapList: (ssh: string, path: string) => typedError<RemoteEntry[], IdeError>(__TAURI_INVOKE("remote_bootstrap_list", { ssh, path })),
/**
* File › Remote Development: opens `path` on the host of SSH configuration
* `ssh_config` in this window (installs / starts the server as needed).
*/
remoteConnect: (sshConfig: string, path: string, onProgress: Channel<RemoteProgress>) => typedError<RemoteProject_Serialize, IdeError>(__TAURI_INVOKE("remote_connect", { sshConfig, path, onProgress })),
/** The remote session of this window (a settings window: its parent's), if any. */
remoteCurrent: () => __TAURI_INVOKE<{
sshConfig: string,
root: string,
host: string,
commands: string[],
} | null>("remote_current"),
remoteDisconnect: () => __TAURI_INVOKE<void>("remote_disconnect"),
/**
* Runs a command on the window's remote server; `args` and the result are JSON
* text. Streaming arguments are `{ "$channel": id }`; their values arrive on
* `on_channel` tagged with the id.
*/
remoteInvoke: (cmd: string, args: string, onChannel: Channel<ChannelFrame>) => typedError<string, IdeError>(__TAURI_INVOKE("remote_invoke", { cmd, args, onChannel })),
/** A client OS file belongs to this machine even when its destination is remote. */
remoteImportLocal: (from: string, to: string, request: RequestId) => typedError<string[], IdeError>(__TAURI_INVOKE("remote_import_local", { from, to, request })),
/**
* Reload Environment: new child processes get the login shell's current environment
* (and the project's `remoteEnv` on a remote host); running ones keep theirs.
*/
envReload: () => typedError<EnvReloaded, IdeError>(__TAURI_INVOKE("env_reload")),
/** Test Connection: connects with unsaved settings and returns the server version. */
dbTest: (source: DataSource, password: string | null, sshSecret: string | null) => typedError<string, IdeError>(__TAURI_INVOKE("db_test", { source, password, sshSecret })),
dbConnected: () => typedError<string[], IdeError>(__TAURI_INVOKE("db_connected")),
/** Connects (fails with `permissionDenied` when the password is missing or wrong). */
dbConnect: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("db_connect", { id })),
dbDisconnect: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("db_disconnect", { id })),
/** Databases of the server of data source `id` (PostgreSQL); connect to one as `<id>:<database>`. */
dbDatabases: (id: string) => typedError<DbDatabases, IdeError>(__TAURI_INVOKE("db_databases", { id })),
dbSchemas: (id: string) => typedError<string[], IdeError>(__TAURI_INVOKE("db_schemas", { id })),
dbTables: (id: string, schema: string) => typedError<DbTableInfo[], IdeError>(__TAURI_INVOKE("db_tables", { id, schema })),
dbTableDetails: (id: string, schema: string, table: string) => typedError<DbTableDetails, IdeError>(__TAURI_INVOKE("db_table_details", { id, schema, table })),
/** The DDL of table or view `table` (Go to DDL, Generate DDL). */
dbDdl: (id: string, schema: string, table: string) => typedError<string, IdeError>(__TAURI_INVOKE("db_ddl", { id, schema, table })),
/** The routines and sequences of `schema` (the tree's `routines` / `sequences`). */
dbSchemaObjects: (id: string, schema: string) => typedError<DbSchemaObjects, IdeError>(__TAURI_INVOKE("db_schema_objects", { id, schema })),
/** The definition of a routine, trigger or sequence (Go to DDL, Quick Documentation). */
dbObjectDdl: (id: string, schema: string, kind: DbObjectKind, name: string) => typedError<string, IdeError>(__TAURI_INVOKE("db_object_ddl", { id, schema, kind, name })),
/** Explain Plan: the execution plan of `statement` on `id`, without running it. */
dbExplain: (request: RequestId, id: string, statement: string) => typedError<DbPlanNode[], IdeError>(__TAURI_INVOKE("db_explain", { request, id, statement })),
/** The statements data source `id` ran, newest first (Browse Query History). */
dbHistory: (id: string) => typedError<DbHistoryEntry[], IdeError>(__TAURI_INVOKE("db_history", { id })),
/** Removes statements from the query history of `id` (`None`: all of them). */
dbRemoveHistory: (id: string, texts: string[] | null) => typedError<null, IdeError>(__TAURI_INVOKE("db_remove_history", { id, texts })),
/** Tables, columns and foreign keys for SQL completion. */
dbCompletion: (id: string) => typedError<DbCompletion, IdeError>(__TAURI_INVOKE("db_completion", { id })),
/** Writes exported result data (CSV, JSON, SQL…) to `path`. */
dbExportFile: (path: string, text: string) => typedError<null, IdeError>(__TAURI_INVOKE("db_export_file", { path, text })),
/**
* Switches a data source between auto-commit and manual commit (leaving
* manual mode rolls back what was not committed).
*/
dbSetManualCommit: (id: string, manual: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("db_set_manual_commit", { id, manual })),
/** Commits or rolls back the open transaction of a manual-commit data source. */
dbFinishTransaction: (id: string, commit: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("db_finish_transaction", { id, commit })),
/** Statements a console runs: the selection's (`from < to`) or the one at the caret (`from`). */
dbStatements: (id: string, text: string, from: number, to: number) => typedError<SqlStatement[], IdeError>(__TAURI_INVOKE("db_statements", { id, text, from, to })),
/**
* Runs `statements` in order on data source `id`, stopping at the first
* error. Cancel with `cancel_request(request)`.
*/
dbExecute: (request: RequestId, id: string, statements: SqlStatement[], maxRows: number) => typedError<DbStatementOutcome[], IdeError>(__TAURI_INVOKE("db_execute", { request, id, statements, maxRows })),
dbTablePage: (request: RequestId, id: string, schema: string, table: string, filter: string | null, sort: DbSortKey[], offset: number, limit: number) => typedError<DbTablePage, IdeError>(__TAURI_INVOKE("db_table_page", { request, id, schema, table, filter, sort, offset, limit })),
/** Submits the table editor's changes in one transaction; returns the rows changed. */
dbApplyEdits: (id: string, schema: string, table: string, edits: DbRowEdit[]) => typedError<number | null, IdeError>(__TAURI_INVOKE("db_apply_edits", { id, schema, table, edits })),
/** The query console file of data source `id` (`<appData>/consoles/db/<id>/console.sql`), created on first use. */
dbConsolePath: (id: string) => typedError<IpcPath, IdeError>(__TAURI_INVOKE("db_console_path", { id })),
};
/* Types */
/** Tools › Actions on Save (Reformat code is `editor.formatOnSave`). */
export type ActionsOnSaveSettings = {
optimizeImports?: boolean,
/** Run code cleanup (`source.fixAll`). */
cleanup?: boolean,
};
export type ActiveTheme = {
pluginId: string,
theme: ThemeDef,
};
/**
* What a task's agent can do beyond a plain conversation, as it reported when its
* session started.
*/
export type AgentCapabilities = {
/** Images in messages. */
images?: boolean,
/** The conversation can be copied into a new task (`session/fork`). */
fork?: boolean,
/** Its latest turns can be dropped. */
rollback?: boolean,
/** A message can join the running turn instead of waiting for it. */
steer?: boolean,
};
/** A file the task changed, relative to [`AgentTask::base_commit`]. */
export type AgentChange = {
path: IpcPath,
relPath: string,
kind: ChangeKind,
added: number,
removed: number,
};
export type AgentCommand = {
/** Without the leading `/`. */
name: string,
description: string,
/** What to type after the command, when it takes input. */
hint: string | null,
};
/** A setting chosen for a new task, by [`AgentConfigOption::id`]. */
export type AgentConfigChoice = {
id: string,
value: string,
};
/** A session setting: an ACP select config option, or the older `modes` / `models`. */
export type AgentConfigOption = {
id: string,
name: string,
description: string | null,
/** ACP category: `model`, `mode`, `thought_level`, or agent-specific. */
category: string | null,
current: string | null,
values: AgentConfigValue[],
via: AgentConfigVia,
};
/** One value of a select-type session setting. */
export type AgentConfigValue = {
value: string,
name: string,
description: string | null,
};
/** How a setting is changed. */
export type AgentConfigVia =
/** `session/set_config_option`. */
"option" |
/** `session/set_mode` (agents that report `modes` instead of a mode config option). */
"mode" |
/** `session/set_model` (agents that report `models` instead of a model config option). */
"model";
/** One item of a task's conversation. */
export type AgentEntry = { type: "user"; text: string;
/** Names of the files and images sent with it. */
attachments: string[];
/** The images sent with it, shown in the conversation. */
images?: AgentImage[];
/** When it was sent (ms since the epoch); `None` in tasks saved before this was kept. */
sentMs?: number | null;
/** When the turn it started ended; `None` while it runs or when it was cut off. */
doneMs?: number | null;
/** Sent into a running turn rather than starting one. */
steered?: boolean } | { type: "agent"; text: string } | { type: "thought"; text: string } | { type: "tool"; id: string; title: string;
/** ACP tool kind: `read`, `edit`, `execute`, `search`, `fetch`, `think`… */
kind: string; status: AgentToolStatus; locations: IpcPath[];
/** Text the tool reported (command output…), truncated. */
output: string | null; diffs: AgentToolDiff[] } | { type: "plan"; items: AgentPlanItem[] } |
/** A subagent the agent started: its own session, whose entries are listed separately. */
{ type: "subagent";
/** The subagent's session id. */
id: string; title: string | null; description: string | null; status: AgentSubagentStatus; error: string | null;
/** What it was asked to do, last. */
prompt: string | null;
/** Its answer. */
reply: string | null;
/** Tool calls it made. */
tools: number;
/** Title of its latest tool call. */
activity: string | null; startedMs: number | null;
/** When it last stopped working; `None` while it works. */
endedMs: number | null;
/** Whether it can be stopped on its own. */
cancellable: boolean } |
/** A message between sessions in a subagent's conversation: its task (`incoming`) or its report. */
{ type: "message"; incoming: boolean; text: string } | { type: "permission"; id: number; title: string; options: AgentPermissionOption[];
/** Name of the chosen option, or `None` while pending. Cancelled requests read "Cancelled". */
chosen: string | null } | { type: "error"; message: string };
/** Streamed to the window that subscribed (`AgentManager::subscribe`). */
export type AgentEvent =
/** A task was created or its metadata changed. */
{ type: "task"; task: AgentTask } | { type: "removed"; id: string } |
/** The task's conversation was cut to its first `length` entries (turns rolled back). */
{ type: "truncated"; task: string; length: number } |
/** Entry `index` of `task` (of its subagent `subagent`) was added or replaced. */
{ type: "entry"; task: string; subagent: string | null; index: number; entry: AgentEntry };
export type AgentImage = {
mimeType: string,
/** Base64, without a `data:` prefix. */
data: string,
name: string | null,
};
export type AgentPermissionOption = {
id: string,
name: string,
/** `allow_once`, `allow_always`, `reject_once` or `reject_always`. */
kind: string,
};
export type AgentPlanItem = {
content: string,
/** `pending`, `in_progress` or `completed`. */
status: string,
};
/**
* What an agent says about itself when it starts (`initialize` only: no session, so no
* MCP servers, hooks or sign-in run).
*/
export type AgentProbe = {
provider: string,
/** The agent's own name and version, when it reports them. */
name: string | null,
version: string | null,
/** How it is driven: `ACP v1`, `ACP v2` or `native`. */
protocol: string,
capabilities: AgentCapabilities,
/** Ways to sign in it offers. */
authMethods: string[],
/** Why it could not be started. */
error: string | null,
};
/** A message to the agent: text, plus files to look at and images. */
export type AgentPrompt = {
text: string,
files: IpcPath[],
images: AgentImage[],
};
export type AgentProvider = {
id: string,
name: string,
/** The command line that starts its ACP server. */
command: string,
/** Whether the command was found (on `PATH`). */
installed: boolean,
/** Settings (models, modes…) the agent offered last time it ran; empty before its first session. */
config: AgentConfigOption[],
/** Slash commands it offered last time. */
commands: AgentCommand[],
source: AgentSource,
};
export type AgentQueued = {
id: string,
prompt: AgentPrompt,
};
export type AgentRegistry = {
agents: RegistryAgent[],
/** Set when the registry could not be reached and the copy saved earlier is shown. */
warning: string | null,
};
/** An API request the agent is about to retry. */
export type AgentRetry = {
attempt: number,
maxRetries: number | null,
/** When the next attempt starts (ms since the epoch). */
retryAtMs: number | null,
error: string | null,
};
/** Where an agent comes from. */
export type AgentSource = { kind: "builtin" } |
/** Defined by the user in `<config>/agents/<id>.toml`. */
{ kind: "custom" } |
/** Installed from the ACP Registry. */
{ kind: "registry"; version: string;
/** A newer version the registry offers. */
update: string | null };
export type AgentStatus =
/** Creating the worktree / starting the agent. */
"starting" | "running" |
/** Waiting for a permission answer. */
"needsInput" |
/** The turn ended; the result can be reviewed or the conversation continued. */
"ready" | "failed" |
/** The account's usage limit was reached; the conversation can go on once it resets. */
"limited" | "archived";
/** What a subagent is doing, as its parent reports it. */
export type AgentSubagentStatus = "running" |
/** One of its requests (a permission) waits for an answer. */
"needsInput" | "done" | "cancelled" | "failed";
export type AgentTask = {
/** Original project folder; absent in tasks saved before per-task roots. */
projectRoot?: IpcPath | null,
id: string,
title: string,
/** [`AgentProvider::id`]. */
provider: string,
/** Model the task runs on (its `model` setting), when known. */
model: string | null,
status: AgentStatus,
isolation: Isolation,
/** Directory the agent works in (the worktree, or the project root). */
cwd: IpcPath,
/** Branch of the task's worktree. */
branch: string | null,
/** Branch (or revision) the worktree was created from. */
base: string | null,
/** Commit the task's changes are compared against (worktree tasks; local ones use `HEAD`). */
baseCommit: string | null,
/** Why the task failed, when it did. */
error: string | null,
createdMs: number | null,
updatedMs: number | null,
/**
* The session's settings (model, mode, thinking effort…) as last reported, with the
* user's choices applied.
*/
config: AgentConfigOption[],
/** Slash commands the agent offers. */
commands: AgentCommand[],
/** Context window use, when the agent reports it. */
usage: AgentUsage | null,
/** Messages waiting for the current turn to end, oldest first. */
queue: AgentQueued[],
capabilities?: AgentCapabilities,
/** When a [`AgentStatus::Limited`] task's limit resets (ms since the epoch), if the agent said. */
resetsMs?: number | null,
/**
* The agent is retrying a failed API request (connection lost, overloaded…); cleared
* by its next output or any status change.
*/
retry?: AgentRetry | null,
};
export type AgentToolDiff = {
path: IpcPath,
added: number,
removed: number,
};
export type AgentToolStatus = "pending" | "running" | "completed" | "failed";
export type AgentUsage = {
/** Tokens in the context window. */
used: number,
/** Size of the context window. */
size: number,
};
export type AppInfo = {
version: string,
platform: string,
configDir: IpcPath,
};
export type AppMetrics = {
/** Resident memory of the backend process (the WebView runs in its own processes). */
rssBytes: number | null,
/**
* Bytes allocated through malloc in the backend process (macOS only; there
* is no garbage-collected heap).
*/
heapBytes: number | null,
/** Physical memory of the machine. */
totalMemoryBytes: number | null,
uptimeMs: number | null,
startup: StartupMetrics,
/** Open projects (windows with a project). */
projects: number,
openDocuments: number,
indexFiles: number,
indexSymbols: number,
indexing: boolean,
/** Language server processes that are starting or running. */
languageServers: number,
syntax: SyntaxCacheStats,
/**
* Footprint per process group: the backend and its WebView processes,
* each language server (with its child processes), debug adapters, Run
* processes and terminals.
*/
memory: ProcessMemory[],
};
export type AppearanceSettings = {
/** `dark` | `light` | `system` | `dark-hc` (high-contrast dark) */
theme?: string,
accent?: string,
uiFontSize?: number | null,
locale?: string,
/** Follow the OS light/dark mode with the preferred themes below. */
syncWithOs?: boolean,
preferredLightTheme?: string,
preferredDarkTheme?: string,
/** IDE zoom in percent (50–300). */
zoom?: number,
/** Apply `ui_font_family` / `ui_font_size` (otherwise the theme's). */
useCustomFont?: boolean,
uiFontFamily?: string,
/** Font tried when `ui_font_family` lacks a glyph; empty = none. */
uiFontFallback?: string,
contrastScrollbars?: boolean,
/** Adjust colours for red-green vision deficiency. */
redGreenVision?: boolean,
differentToolWindowBackground?: boolean,
compactMode?: boolean,
fullPathInTitle?: boolean,
projectColorsInToolbar?: boolean,
dndWithAltOnly?: boolean,
menuIcons?: boolean,
/** `hamburger` | `merged`: main menu presentation in the frameless title bar. */
mainMenuStyle?: string,
/** `subpixel` | `greyscale` | `none` */
ideAntialiasing?: string,
editorAntialiasing?: string,
showToolWindowBars?: boolean,
showToolWindowNames?: boolean,
showToolWindowBadges?: boolean,
widescreenToolWindows?: boolean,
/**
* Status bar widgets shown (`true`) or hidden (`false`) by the user
* (status bar context menu); widgets not listed use their default.
*/
statusBarWidgets?: { [key in string]: boolean },
/** Customize Main Toolbar; `None` = the default toolbar. */
mainToolbar?: MainToolbarSettings | null,
};
export type ApplyOutcome = {
/** Repository-relative paths changed without conflicts. */
applied: string[],
/** Repository-relative paths left with conflicts (index stages for the merge UI). */
conflicts: string[],
};
/** `groupId:artifactId` of a dependency. */
export type ArtifactKey = {
groupId: string,
artifactId: string,
};
/** What an askpass prompt asks for. */
export type AskpassKind =
/** Password or passphrase: hidden input. */
"secret" |
/** User name: visible input. */
"text" |
/** Yes / no (an unknown host key); answered with `yes` or `no`. */
"confirm";
export type AttachKind = "java" | "node" | "python" | "go" | "native";
export type AttachableProcess = {
pid: number,
/** Executable name. */
name: string,
commandLine: string,
kind: AttachKind,
/** Debug adapter that attaches to it. */
adapter: string,
/** Debug port the process listens on (JDWP, `--inspect`, `debugpy --listen`). */
host: string | null,
port: number | null,
};
/** Editor › General › Auto Import (LSP code actions). */
export type AutoImportSettings = {
addUnambiguous?: boolean,
optimizeOnTheFly?: boolean,
};
/** When local changes are uploaded to the default deployment server. */
export type AutoUpload = "never" |
/** Files saved with Save / Save All (⌘S). */
"onExplicitSave" |
/** Every save, including autosave and external changes. */
"always";
/** A step run before a configuration launches; a failing step aborts the launch. */
export type BeforeLaunchTask = {
/**
* `run` (another configuration, `target` = its id) | `build` | `tool` (external tool id) |
* `command` (a shell command line) | `toolWindow` (tool window id).
*/
kind: string,
target?: string,
};
export type BlameLine = {
commit: string,
author: string,
timeMs: number | null,
summary: string,
};
export type Branch = {
name: string,
remote: boolean,
current: boolean,
upstream: string | null,
ahead: number,
behind: number,
lastCommitMs: number | null,
/** Tip commit id. */
commit?: string,
};
export type BranchInfo = {
/** `None` when HEAD is detached. */
head: string | null,
headCommit: string | null,
upstream: string | null,
ahead: number,
behind: number,
/** Merge / rebase / cherry-pick in progress. */
operation: string | null,
};
/** Editor › General › Breadcrumbs. */
export type BreadcrumbsSettings = {
show?: boolean,
/** `top` | `bottom` of the editor. */
placement?: string,
/** Language ids breadcrumbs are turned off for. */
disabledLanguages?: string[],
};
export type Breakpoint = {
line: number,
condition: string | null,
hitCondition: string | null,
/** Logpoint message; when set the breakpoint logs instead of suspending. */
logMessage: string | null,
enabled: boolean,
};
export type BreakpointState = {
line: number,
verified: boolean,
message: string | null,
};
/** An installed browser. */
export type Browser = {
/** `chrome`, `firefox`, `safari`, `edge`, `brave`, `chromium`. */
id: string,
name: string,
};
export type BuildEvent =
/** The build starts: its tree root. */
{ kind: "started"; system: BuildSystem; title: string } |
/** A command starts (echoed in the console). */
{ kind: "step"; command: string; cwd: IpcPath } |
/** Console output (one or more lines, each ending in `\n`). */
{ kind: "output"; text: string; stderr: boolean } | { kind: "message"; message: BuildMessage } |
/** Status bar progress; `fraction` 0..1 or `None` when indeterminate. */
{ kind: "progress"; message: string; fraction: number | null };
export type BuildInfo = {
version: string,
/** Build id from CI (`OPENIDEA_BUILD` at compile time), else `dev`. */
build: string,
profile: string,
os: string,
arch: string,
tauri: string,
/** An update endpoint is configured ("Check for Updates…" is offered). */
updates: boolean,
};
export type BuildKind =
/** Incremental compile of sources and tests. */
"build" |
/** Clean, then build. */
"rebuild" |
/** Package the outputs (`package`, `assemble`, `cargo build --release`, `npm run build`). */
"artifacts";
/** A compiler message in IDE coordinates (0-based line, UTF-16 column). */
export type BuildMessage = {
severity: Severity,
text: string,
/** Absolute path; `None` for messages about the build itself. */
path: IpcPath | null,
range: Range | null,
code: string | null,
};
/** The build systems of a project; `None` when the project does not use one. */
export type BuildModel = {
maven: MavenModel | null,
gradle: GradleModel | null,
};
export type BuildResult = {
system: BuildSystem,
title: string,
success: boolean,
errors: number,
warnings: number,
durationMs: number | null,
messages: BuildMessage[],
};
export type BuildSystem = "maven" | "gradle" | "cargo" | "go" | "typescript";
export type BuildTool = "maven" | "gradle";
/** A slice of a file: `data` is base64; `total` is the file size. */
export type ByteRange = {
offset: number,
data: string,
total: number,
};
export type CMakeProfile = {
name?: string,
buildType?: string,
generator?: string,
cmakeArgs?: string[],
/** Empty uses cmake-build-<lowercase build type>. */
buildDir?: string,
buildArgs?: string[],
env?: { [key in string]: string },
};
/** Absent profiles retain automatic discovery for existing projects. */
export type CMakeSettings = CMakeSettings_Serialize | CMakeSettings_Deserialize;
/** Absent profiles retain automatic discovery for existing projects. */
export type CMakeSettings_Deserialize = {
profiles?: CMakeProfile[] | null,
};
/** Absent profiles retain automatic discovery for existing projects. */
export type CMakeSettings_Serialize = {
profiles?: CMakeProfile[] | null,
};
export type CallHierarchy = {
items: HierarchyItem[],
incomplete: ReferencesIncomplete | null,
};
/**
* A plugin package available for installation from a local catalog
* directory (the samples shipped with the IDE). Not installed by listing it.
*/
export type CatalogPlugin = {
id: string,
name: string,
version: string,
description: string,
authors: string[],
homepage: string | null,
changeNotes: string | null,
/** Package directory; install with `install_from_dir(path)`. */
path: IpcPath,
hasCode: boolean,
permissions: Permission[],
commands: CommandDecl[],
languageCount: number,
themeCount: number,
/** Why the package cannot be installed as is (e.g. its WASM is not built). */
problem: string | null,
};
export type ChangeKind = "added" | "modified" | "deleted" | "renamed" | "untracked" | "ignored" | "conflicted";
/**
* Ordered, non-overlapping changes, all expressed in the coordinates of the
* original document (CodeMirror `ChangeSet` semantics).
*/
export type ChangeSet = {
changes: TextChange[],
};
export type ChangedFile = {
path: string,
kind: ChangeKind,
oldPath: string | null,
};
export type Changelist = {
id: string,
name: string,
comment?: string,
};
/** User change lists of a project and which list each changed file belongs to. */
export type ChangelistState = {
lists: Changelist[],
/** Id of the active list (receives new changes). */
active: string,
/** Project-relative path → list id. Files not listed belong to the active list. */
files?: { [key in string]: string },
};
/** A value for one streaming argument of a remote command (`data`: JSON text). */
export type ChannelFrame = {
id: number,
data: string,
};
export type CheckStatus = "pending" | "success" | "failure" | "cancelled" | "skipped" | "neutral";
/**
* How Checkout treats local changes that the switch would overwrite (IDEA's Smart
* Checkout dialog).
*/
export type CheckoutMode =
/** Fail with [`CheckoutOutcome::LocalChanges`] and change nothing. */
"normal" |
/** Stash local changes, switch, and restore them (conflicts are left to resolve). */
"smart" |
/** Discard the local changes in the way (`git switch --discard-changes`). */
"force";
export type CheckoutOptions = {
mode?: CheckoutMode,
/** Required when checking out a remote branch whose local namesake is ahead of it. */
diverged?: DivergedLocal | null,
};
/**
* Result of [`Repo::checkout_with`]; the non-`Done` variants other than `Conflicts`
* left the repository untouched.
*/
export type CheckoutOutcome = { kind: "done" } |
/** These local changes (repository-relative paths) would be overwritten. */
{ kind: "localChanges"; files: string[] } |
/** Local branch `local` has commits that remote branch `remote` does not. */
{ kind: "localBranchAhead"; local: string; remote: string } |
/**
* Switched, but restoring the local changes (Smart Checkout) or the rebase stopped
* on conflicts in these files.
*/
{ kind: "conflicts"; files: string[] };
export type ClassifiedReference = {
/** Optional for older Java extensions; missing means unclassified. */
access?: ReferenceAccess | null,
location: Location,
kind: ReferenceKind,
};
export type ClearCachesResult = {
/** Syntax trees dropped (they are rebuilt on demand). */
syntaxTrees: number,
rssBeforeBytes: number | null,
rssAfterBytes: number | null,
};
export type CloseContext = {
/** Quit is in progress (exit was already confirmed). */
quitting: boolean,
/** Number of open project windows (settings windows excluded), including the caller. */
windows: number,
};
export type CodeAction = {
title: string,
/** LSP kind, e.g. `quickfix`, `refactor.extract`, `source.organizeImports`. */
kind: string | null,
isPreferred: boolean,
disabledReason: string | null,
edit: WorkspaceEdit | null,
command: Command | null,
data: string | null,
server: ServerId,
};
/**
* Code actions at a range plus the kinds the servers advertise
* (`codeActionProvider.codeActionKinds`), so the UI can tell "not available
* here" from "not supported by the server".
*/
export type CodeActionQuery = {
actions: CodeAction[],
/** Union of the advertised kinds; `None` when a server does not list them. */
advertisedKinds: string[] | null,
};
/** Editor › Code Editing. */
export type CodeEditingSettings = {
/** Highlight usages of element at caret. */
highlightUsages?: boolean,
highlightBraces?: boolean,
/** Highlight other occurrences of the selected text. */
highlightSelection?: boolean,
quickDocOnHover?: boolean,
quickDocDelay?: number,
/** Next / previous error goes to errors only (skips warnings). */
nextErrorErrorsOnly?: boolean,
stickyLinesMax?: number,
};
export type CodeLens = {
range: Range,
command: Command | null,
};
/** Editor › Code Style (General tab + per-language overrides). */
export type CodeStyleSettings = CodeStyleSettings_Serialize | CodeStyleSettings_Deserialize;
/** Editor › Code Style (General tab + per-language overrides). */
export type CodeStyleSettings_Deserialize = {
/** Line separator for new files: `system` | `lf` | `crlf` | `cr`. */
lineSeparator?: string,
hardWrapAt?: number,
visualGuides?: number[],
/** Detect and use existing file indents for editing. */
detectIndents?: boolean,
/** Enable EditorConfig support. */
editorconfig?: boolean,
languages?: { [key in string]: LanguageCodeStyle_Deserialize },
/** Formatter › Do not format: globs (`*.min.js`, `generated/**`) Reformat Code skips. */
doNotFormat?: string[],
/** Formatter › Turn formatter on/off with markers in code comments. */
formatterTagsEnabled?: boolean,
formatterOffTag?: string,
formatterOnTag?: string,
/** The markers are regular expressions. */
formatterTagsRegexp?: boolean,
};
/** Editor › Code Style (General tab + per-language overrides). */
export type CodeStyleSettings_Serialize = {
/** Line separator for new files: `system` | `lf` | `crlf` | `cr`. */
lineSeparator: string,
hardWrapAt: number,
visualGuides: number[],
/** Detect and use existing file indents for editing. */
detectIndents: boolean,
/** Enable EditorConfig support. */
editorconfig: boolean,
languages: { [key in string]: LanguageCodeStyle_Serialize },
/** Formatter › Do not format: globs (`*.min.js`, `generated/**`) Reformat Code skips. */
doNotFormat: string[],
/** Formatter › Turn formatter on/off with markers in code comments. */
formatterTagsEnabled: boolean,
formatterOffTag: string,
formatterOnTag: string,
/** The markers are regular expressions. */
formatterTagsRegexp: boolean,
};
export type Command = {
title: string,
command: string,
arguments: string[],
};
export type CommandDecl = {
id: string,
title: string,
category?: string | null,
};
export type CommandForm = {
command: Command,
formFields: FormField[],
formAnswers: FormAnswer[],
};
export type Commit = {
id: string,
shortId: string,
parents: string[],
author: string,
email: string,
timeMs: number | null,
summary: string,
message: string,
refs: string[],
/** Committer time (Log › View Options › Commit Timestamp). */
commitTimeMs?: number | null,
};
/** Commit Options (IDEA's commit options popup). */
export type CommitOptions = {
amend: boolean,
signOff: boolean,
/** `--author`, e.g. `Name <mail@example.com>`; `None` or blank uses the configured user. */
author: string | null,
/** False skips the pre-commit and commit-msg hooks (`--no-verify`). */
runHooks: boolean,
/**
* Files committed with only some of their changes (IDEA's partial commit). They are
* committed through a temporary index, so neither the working tree nor the other
* entries of the index change; afterwards their index entries match the new commit.
*/
partial?: PartialCommitFile[],
};
/** Version Control › Commit: commit checks and commit-message inspections. */
export type CommitSettings = {
/**
* Commit from the Commit tool window; off = Local Changes in the Git tool
* window and a Commit dialog.
*/
nonModal?: boolean,
/** Start with an empty message instead of the last one / the changelist's. */
clearInitialMessage?: boolean,
analyzeCode?: boolean,
checkTodo?: boolean,
reformat?: boolean,
optimizeImports?: boolean,
cleanup?: boolean,
blankLineAfterSubject?: boolean,
limitSubject?: boolean,
subjectLimit?: number,
limitBody?: boolean,
bodyLimit?: number,
showRightMargin?: boolean,
wrapAtMargin?: boolean,
};
export type CompareResult = {
repositories: RepositoryComparison[],
skippedPaths: IpcPath[],
};
export type CompareScope = {
repositories: IpcPath[],
/** Selected content outside registered repositories; workspace parents expand to their skipped children. */
skippedPaths: IpcPath[],
singleFile: boolean,
};
export type CompletionItem = {
label: string,
/** e.g. `(req: CreateOrderRequest)` shown right after the label. */
labelDetail: string | null,
/** e.g. return type, shown right-aligned. */
detail: string | null,
kind: CompletionKind | null,
documentation: Markup | null,
sortText: string | null,
filterText: string | null,
preselect: boolean,
deprecated: boolean,
/** Text to insert; snippet syntax when `is_snippet`. */
insertText: string,
isSnippet: boolean,
/** Range replaced on accept; `None` = word at cursor. */
replaceRange: Range | null,
/** IDEA "Replace" (⇥) range when it differs from insert range. */
replaceRangeTab: Range | null,
additionalEdits: TextEdit[],
commitCharacters: string[],
command: Command | null,
/** Opaque server data for `completionItem/resolve`. */
data: string | null,
server: ServerId,
};
export type CompletionKind = "text" | "method" | "function" | "constructor" | "field" | "variable" | "class" | "interface" | "module" | "property" | "unit" | "value" | "enum" | "keyword" | "snippet" | "color" | "file" | "reference" | "folder" | "enumMember" | "constant" | "struct" | "event" | "operator" | "typeParameter";
export type CompletionList = {
isIncomplete: boolean,
items: CompletionItem[],
};
/** Editor › General › Code Completion. */
export type CompletionSettings = {
matchCase?: boolean,
/** `first` letter only | `all` letters. */
caseSensitivity?: string,
/** Show suggestions as you type. */
autoPopup?: boolean,
/** Insert the selected suggestion by pressing space, dot, or other context-dependent keys. */
insertOnSpecialKeys?: boolean,
/** Insert a sole suggestion of explicit (⌃Space) completion right away. */
autoInsertSingle?: boolean,
/** Sort suggestions by name instead of relevance. */
sortAlphabetically?: boolean,
/** Add `()` after function and method suggestions. */
insertParentheses?: boolean,
showDocumentation?: boolean,
documentationDelay?: number,
parameterInfo?: boolean,
parameterInfoDelay?: number,
};
export type ComposeOp = "start" | "stop" | "restart" |
/** Stops and removes the project's containers and networks. */
"down";
/** Build, Execution, Deployment › Console. */
export type ConsoleSettings = {
softWrap?: boolean,
overrideBuffer?: boolean,
bufferKb?: number,
/** Encoding of process output (`UTF-8`, `windows-1252`, `GBK`…). */
encoding?: string,
/** Consecutive lines containing any of these are folded. */
foldPatterns?: string[],
};
export type ContainerOp = "start" | "stop" | "restart" | "pause" | "unpause" | "kill";
export type CoveragePrepared = CoveragePrepared_Serialize | CoveragePrepared_Deserialize;
export type CoveragePrepared_Deserialize = ({ status: "ready"; runner: string;
/** What to launch instead of the configuration. */
launch: RunConfig_Deserialize; report: CoverageReportSpec }) & { install?: never; message?: never; reason?: never; tool?: never } | ({ status: "missingTool"; tool: string; message: string; install: InstallCommand | null }) & { launch?: never; reason?: never; report?: never; runner?: never } | ({ status: "unsupported"; reason: string }) & { install?: never; launch?: never; message?: never; report?: never; runner?: never; tool?: never };
export type CoveragePrepared_Serialize = ({ status: "ready"; runner: string;
/** What to launch instead of the configuration. */
launch: RunConfig_Serialize; report: CoverageReportSpec }) & { install?: never; message?: never; reason?: never; tool?: never } | ({ status: "missingTool"; tool: string; message: string; install: InstallCommand | null }) & { launch?: never; reason?: never; report?: never; runner?: never } | ({ status: "unsupported"; reason: string }) & { install?: never; launch?: never; message?: never; report?: never; runner?: never; tool?: never };
/** Where the report of a prepared run will be, and how to read it. */
export type CoverageReportSpec =
/** An lcov tracefile; relative `SF:` paths resolve against `base`. */
{ kind: "lcov"; runner: string; path: IpcPath; base: IpcPath } |
/** `go test -coverprofile`; import paths under `module` map to `module_dir`. */
{ kind: "goProfile"; path: IpcPath; module: string; moduleDir: IpcPath } |
/** Every JaCoCo XML report (Maven `target/site/jacoco`, Gradle `build/reports/jacoco`) under `dir`. */
{ kind: "jacoco"; dir: IpcPath } |
/** The tool's raw data is exported to lcov by `argv` first (coverage.py: `… -m coverage lcov -o <lcov>`). */
{ kind: "exported"; runner: string; argv: string[]; cwd: IpcPath; env: { [key in string]: string }; lcov: IpcPath };
/** One coverage run's report. */
export type CoverageSuite = {
/** Tool that produced it, e.g. `cargo-llvm-cov`, `JaCoCo`. */
runner: string,
/** Whether branch counts are meaningful (lcov `BRDA`, JaCoCo); Go profiles only have blocks. */
hasBranches: boolean,
/** Sorted by path. */
files: FileCoverage[],
};
export type CreatePullRequest = {
title: string,
body: string,
base: string,
draft: boolean,
/** Push the current branch (setting its upstream) before creating. */
push: boolean,
};
/** Imported editor colour scheme on top of a built-in base. */
export type CustomColorScheme = CustomColorScheme_Serialize | CustomColorScheme_Deserialize;
/** Imported editor colour scheme on top of a built-in base. */
export type CustomColorScheme_Deserialize = {
name: string,
parent: string,
attributes: { [key in string]: TextAttributesOverride_Deserialize },
};
/** Imported editor colour scheme on top of a built-in base. */
export type CustomColorScheme_Serialize = {
name: string,
parent: string,
attributes: { [key in string]: TextAttributesOverride_Serialize },
};
/** A named profile made with Copy. */
export type CustomInspectionProfile = {
name?: string,
overrides?: { [key in string]: InspectionOverride },
};
export type CustomKeymap = {
name?: string,
/** Bundled preset the keymap derives from, e.g. `intellij-macos`. */
parent?: string,
/** Action id → bindings on top of `parent`; an empty list unbinds. */
overrides?: { [key in string]: string[] },
};
/**
* A field watchpoint (DAP data breakpoint) on a `dataId` from [`DebugManager::data_breakpoint_info`]
* (java-debug ids, `Class#field`, stay valid across sessions).
*/
export type DataBreakpoint = {
dataId: string,
/** `read`, `write` or `readWrite` (adapter default when unset). */
accessType: string | null,
condition: string | null,
hitCondition: string | null,
enabled: boolean,
};
/** Answer of `dataBreakpointInfo`: `data_id` is `None` when the value cannot be watched. */
export type DataBreakpointInfo = {
dataId: string | null,
description: string,
accessTypes: string[],
};
export type DataSource = {
id?: string,
name?: string,
driver?: DbDriver,
host?: string,
port?: number | null,
database?: string,
user?: string,
/** SQLite database file (absolute, or relative to the project root). */
file?: IpcPath | null,
ssl?: DbSslMode,
/** Keep the password in the saved passwords. */
savePassword?: boolean,
/** Refuse statements other than queries (enforced by the database session where possible). */
readOnly?: boolean,
/** SSH tunnel settings (`None`: never configured; kept but unused when not `enabled`). */
ssh?: DbSsh | null,
/** Wire-compatible product preset (`cockroachdb`, `tidb`…; empty: the driver itself). */
vendor?: string,
color?: DbColor | null,
comment?: string,
/** Connect with [`DataSource::url`] instead of the host / port / database fields. */
urlOnly?: boolean,
url?: string,
/** PEM files; `~/` is the home directory. */
sslCaFile?: string,
sslCertFile?: string,
sslKeyFile?: string,
options?: DbOptions,
introspection?: DbIntrospection,
properties?: DbProperty[],
};
/** System Settings › Date Formats (Git log, Local History, blame). */
export type DateFormatSettings = {
/** Use `pattern` / `use24_hour` instead of the system locale's format. */
overrideSystem?: boolean,
/** `dd`, `MM`, `MMM`, `yy`, `yyyy` placeholders. */
pattern?: string,
use24Hour?: boolean,
/** "Today", "Yesterday", "5 min ago". */
pretty?: boolean,
};
export type DbCellValue = {
column: string,
/** `None` is SQL NULL. */
value: string | null,
};
/** IDEA's data source colours (tree node and console tab tint), e.g. red for production. */
export type DbColor = "red" | "orange" | "yellow" | "green" | "blue" | "violet";
export type DbColumnInfo = {
name: string,
dataType: string,
nullable: boolean,
default: string | null,
primaryKey: boolean,
};
/** The schema model SQL completion and resolution work from. */
export type DbCompletion = {
/** Schema unqualified names resolve to. */
defaultSchema: string,
tables: DbCompletionTable[],
foreignKeys: DbForeignKey[],
};
export type DbCompletionColumn = {
name: string,
dataType: string,
nullable: boolean,
primaryKey: boolean,
/** Has a default (or is generated): optional in INSERT. */
hasDefault: boolean,
};
export type DbCompletionTable = {
schema: string,
name: string,
kind: DbTableKind,
columns: DbCompletionColumn[],
};
export type DbDatabases = {
/** The database the data source connects to (its setting, or the server default). */
current: string,
names: string[],
};
export type DbDriver = "sqlite" | "postgres" |
/** MySQL and MariaDB. */
"mysql" |
/** Microsoft SQL Server. */
"sqlServer";
/** `schema.table (columns) REFERENCES ref_schema.ref_table (ref_columns)`. */
export type DbForeignKey = {
schema: string,
table: string,
columns: string[],
refSchema: string,
refTable: string,
refColumns: string[],
};
export type DbHistoryEntry = {
text: string,
/** Milliseconds since the Unix epoch. */
time: number | null,
};
export type DbIndexInfo = {
name: string,
unique: boolean,
columns: string[],
};
/** Schemas tab: the databases / schemas the tree shows. Names may use `*` and `?`. */
export type DbIntrospection = {
allDatabases?: boolean,
databases?: string[],
allSchemas?: boolean,
schemas?: string[],
/** `pg_catalog`, `information_schema`, `mysql`…, and service databases (`rdsadmin`…). */
showSystem?: boolean,
/** PostgreSQL template databases (`template0`, `template1`). */
showTemplates?: boolean,
/**
* Object filter: the tree lists only tables, views, routines and sequences matching
* one of these patterns (`*`, `?`; separated by commas or spaces). Empty: all.
*/
objectFilter?: string,
};
/** Schema objects other than tables and columns (Go to DDL, Drop). */
export type DbObjectKind = "function" | "procedure" | "trigger" | "sequence";
/** Options tab: session settings applied to every connection. */
export type DbOptions = {
transaction?: DbTxMode,
/** PostgreSQL `search_path` (unqualified names resolve there). */
defaultSchema?: string,
/** Session time zone (`TimeZone` / `time_zone`); empty keeps the default. */
timeZone?: string,
/** Statements run on every new connection. */
startupScript?: string,
/** Run `SELECT 1` this often while connected. */
keepAliveSecs?: number | null,
/** Disconnect after this long without statements (enforced by the UI, which sees the activity). */
autoDisconnectSecs?: number | null,
/** PostgreSQL: show only the configured database, its schemas right under the data source. */
singleDatabase?: boolean,
};
/** One operation of a plan; `parent` indexes the plan's node list (roots: `None`). */
export type DbPlanNode = {
parent: number | null,
/** `Full Scan`, `Index Scan`, `Hash Join`… */
operation: string,
/** The object it works on and its key details (`table: o;`). */
params: string,
properties: DbPlanProperty[],
};
export type DbPlanProperty = {
name: string,
value: string,
};
/**
* Advanced tab: a driver property. PostgreSQL: run-time parameters (and
* `application_name`); MySQL: session variables (and `charset`, `collation`);
* SQLite: pragmas. See [`crate::conn`].
*/
export type DbProperty = {
name?: string,
value?: string,
};
export type DbQueryResult = {
statement: string,
columns: DbResultColumn[],
/** Cell text; `None` is SQL NULL. Binary values are `0x…` hex. */
rows: ((string | null)[])[],
/** Rows changed by a DML statement (`None` for queries). */
affected: number | null,
/** More rows exist beyond the limit. */
hasMore: boolean,
elapsedMs: number | null,
/** Until the server's first answer; the rest of `elapsed_ms` is fetching. */
executionMs: number | null,
};
export type DbResultColumn = {
name: string,
typeName: string,
};
export type DbRoutineInfo = {
name: string,
/** `Function` or `Procedure`. */
kind: DbObjectKind,
arguments: string,
/** Result type of a function. */
returns: string | null,
};
/**
* A pending change of the table editor. `key` identifies the row: its primary
* key columns with their original values.
*/
export type DbRowEdit = { kind: "update"; key: DbCellValue[]; values: DbCellValue[] } | { kind: "insert"; values: DbCellValue[] } | { kind: "delete"; key: DbCellValue[] };
/** A schema's routines and sequences (the tree's `routines` / `sequences` folders). */
export type DbSchemaObjects = {
routines: DbRoutineInfo[],
sequences: DbSequenceInfo[],
};
export type DbSequenceInfo = {
name: string,
dataType: string,
};
export type DbSortKey = {
column: string,
descending: boolean,
};
/** Connect through an SSH tunnel: the database host and port are reached from `host`. */
export type DbSsh = {
enabled?: boolean,
/** A Settings › SSH Configurations id to connect with; empty = the fields below. */
config?: string,
/** Host name, or a `Host` alias of `~/.ssh/config` with [`DbSshAuth::OpenSsh`]. */
host?: string,
port?: number | null,
user?: string,
auth?: SshAuth,
/** Private key for [`DbSshAuth::KeyPair`]; `~/` is the home directory. */
keyFile?: string,
/** Keep the SSH password / key passphrase in the saved passwords. */
saveSecret?: boolean,
};
export type DbSslMode = "disable" | "prefer" | "require" |
/** Require, and check the server certificate against the CA file. */
"verifyCa" |
/** [`DbSslMode::VerifyCa`], and check that the certificate names the host. */
"verifyFull";
export type DbStatementOutcome = {
statement: SqlStatement,
result: DbQueryResult | null,
error: string | null,
};
export type DbTableDetails = {
columns: DbColumnInfo[],
indexes: DbIndexInfo[],
foreignKeys: DbForeignKey[],
triggers: DbTriggerInfo[],
};
export type DbTableInfo = {
name: string,
kind: DbTableKind,
};
export type DbTableKind = "table" | "view" | "materializedView";
export type DbTablePage = {
result: DbQueryResult,
details: DbTableDetails,
offset: number | null,
};
export type DbTriggerInfo = {
name: string,
/** `before`, `after`, `instead of`. */
timing: string,
/** `insert`, `update or delete`… */
events: string,
};
/** Transaction control of the data source's consoles. */
export type DbTxMode = "auto" | "manual";
/** What a session's adapter supports, for enabling actions. */
export type DebugCapabilities = {
restartFrame: boolean,
stepInTargets: boolean,
functionBreakpoints: boolean,
dataBreakpoints: boolean,
/** `setVariable` or `setExpression`. */
setValue: boolean,
conditionalBreakpoints: boolean,
hitConditionalBreakpoints: boolean,
logPoints: boolean,
/** HotSwap ("Reload Changed Classes"): java-debug's `redefineClasses` request. */
hotCodeReplace: boolean,
};
export type DebugEvent =
/**
* First event of every session (only build output of a root session's
* `cargo` step can precede it). `parent` is set for adapter-started child sessions.
*/
{ kind: "started"; name: string; adapter: string; parent: DebugSessionId | null } | { kind: "initialized" } | { kind: "stopped"; threadId: number; reason: string; description: string | null; allThreadsStopped: boolean } | { kind: "continued"; threadId: number; allThreadsContinued: boolean } | { kind: "output"; category: string; output: string } | { kind: "thread"; threadId: number; started: boolean } | { kind: "breakpointsChanged"; path: IpcPath } | { kind: "terminated" } | { kind: "exited"; code: number } |
/**
* java-debug's `hotcodereplace` event: `change_type` is `BUILD_COMPLETE` (classes
* changed and can be reloaded), `STARTING`, `END`, `WARNING` or `ERROR`.
*/
{ kind: "hotCodeReplace"; changeType: string; message: string };
/** A debug adapter session. */
export type DebugSessionId = number;
/** Build, Execution, Deployment › Debugger (+ Data Views, Stepping, Python Debugger). */
export type DebuggerSettings = {
showOnBreakpoint?: boolean,
focusAppOnBreakpoint?: boolean,
hideOnTermination?: boolean,
breakpointsAnyFile?: boolean,
/** While suspended, hovering the start of a line shows a Run to Cursor button. */
runToCursorInlay?: boolean,
inlineValues?: boolean,
/** Data Views: list variables by name instead of the adapter's order. */
sortValues?: boolean,
valueTooltip?: boolean,
/** While suspended, selecting an expression shows its value. */
valueTooltipOnSelection?: boolean,
valueTooltipDelay?: number,
/** Stepping: do not step into library code (debugpy `justMyCode`, js-debug `skipFiles`). */
skipLibraryCode?: boolean,
python?: PythonDebuggerSettings,
};
/** A deleted local branch, enough to restore it (IDEA's "Restore" notification action). */
export type DeletedBranch = {
name: string,
/** The commit the branch pointed at. */
tip: string,
/** Its upstream (`origin/x`), restored with it. */
upstream: string | null,
/** It was not fully merged: its own commits are now unreachable from any branch. */
unmerged: boolean,
};
export type DependencyUpdate = {
latest: string,
replacement: string,
};
export type DependencyVersions = {
dependency: ManifestDependency,
versions: string[],
update: DependencyUpdate | null,
};
/** Where a local file is deployed. */
export type DeployedPath = {
server: string,
remotePath: string,
webUrl: string | null,
};
/**
* Mapping eligibility uses a common synthetic server root: mapping and exclusion
* paths are both relative to that root, so checking never opens a connection.
*/
export type DeploymentCoverage = {
server: string,
paths: string[],
skipped: TransferError[],
};
export type DeploymentMapping = {
/** Project-relative folder; empty = the project root. */
local?: string,
/** Remote folder, relative to the server root (a leading `/` is the root too). */
deployment?: string,
/** Web path, relative to the server's URL. */
web?: string,
};
/** A deployment filesystem and how project folders map onto it. */
export type DeploymentServer = {
kind?: DeploymentType,
id?: string,
name?: string,
/** [`SshConfiguration::id`]. */
sshConfig?: string,
/** Absolute remote folder the mappings are relative to; empty = the login directory. */
rootPath?: string,
/** Web server URL of the root (Open in Browser on the deployed file). */
webUrl?: string,
mappings?: DeploymentMapping[],
/** Remote paths (relative to the root) never touched. */
excludedPaths?: string[],
};
/** Build, Execution, Deployment › Deployment (and its Options page). */
export type DeploymentSettings = {
servers?: DeploymentServer[],
/** Server used by Upload / Download / Sync and automatic upload; empty = none. */
defaultServer?: string,
autoUpload?: AutoUpload,
/** Delete remote files when their local file is deleted (automatic upload). */
deleteRemote?: boolean,
/** Keep local modification times on uploaded files. */
preserveTimestamps?: boolean,
/** File names never uploaded or downloaded (`*` and `?` wildcards; `;`-separated in the UI). */
exclude?: string[],
};
export type DeploymentType = "sftp" | "local";
export type Diagnostic = {
range: Range,
severity: Severity,
message: string,
/** Producer, e.g. `rust-analyzer`, `eslint`. */
source: string | null,
code: string | null,
unnecessary?: boolean,
deprecated?: boolean,
/**
* Language server (or tool) that reported it, e.g. `basedpyright`; `source`
* is what the producer calls itself. Inspection profiles key on this.
*/
server?: string | null,
};
export type DirectoryCompareEntry = {
path: string,
status: DirectoryCompareStatus,
leftKind: EntryKind | null,
rightKind: EntryKind | null,
leftLink?: string | null,
rightLink?: string | null,
};
export type DirectoryCompareProgress = {
scanned: number,
compared: number,
total: number | null,
bytesRead: number | null,
path: string,
};
export type DirectoryCompareStatus = "leftOnly" | "rightOnly" | "different" | "equal";
/** Changes under a folder (Show History on a directory). */
export type DirectoryHistory = {
/** Snapshots of files under the folder and labels, newest first. */
entries: HistoryEntry[],
/** Files with history that no longer exist on disk. */
deleted: IpcPath[],
};
/** Checking out remote `origin/x` while local `x` has commits `origin/x` lacks. */
export type DivergedLocal =
/** Rebase local `x` onto `origin/x` (IDEA "Rebase onto Remote"). */
"rebase" |
/** Reset local `x` to `origin/x` (IDEA "Drop Local Commits"). */
"reset";
/** An open document buffer. */
export type DocId = number;
/** Whether docker can be used, and why not. */
export type DockerAvailability = { kind: "ready"; clientVersion: string; serverVersion: string;
/** Active docker context (`default`, `orbstack`, `desktop-linux`…). */
context: string | null } |
/** No `docker` executable was found. */
{ kind: "notInstalled" } |
/** The CLI is there but cannot reach a daemon (not started, wrong context…). */
{ kind: "daemonDown"; message: string; context: string | null };
export type DockerConnection = {
id: string,
name: string,
endpoint: DockerEndpoint,
};
export type DockerContainer = {
id: string,
name: string,
image: string,
command: string,
/** `running`, `exited`, `paused`, `created`, `restarting`, `removing`, `dead`. */
state: string,
/** Human status, e.g. `Up 2 hours (healthy)`. */
status: string,
ports: string,
createdAt: string,
/** `com.docker.compose.project` label. */
composeProject: string | null,
composeService: string | null,
/** `com.docker.compose.project.working_dir` label. */
composeWorkingDir: string | null,
/** `com.docker.compose.project.config_files` label (comma-separated in docker). */
composeFiles: string[],
};
/** Which daemon a docker command talks to. */
export type DockerEndpoint =
/** Whatever the CLI is configured for (`DOCKER_HOST`, the current context). */
{ kind: "default" } |
/** A local daemon socket, e.g. `/var/run/docker.sock` (or a `npipe://` URL on Windows). */
{ kind: "socket"; path: string } |
/**
* A remote daemon, e.g. `tcp://build:2376` or `ssh://me@build`; with TLS when
* `tls_cert_dir` holds `ca.pem`, `cert.pem` and `key.pem`.
*/
{ kind: "tcp"; host: string; tlsCertDir: string | null } |
/** A named `docker context`. */
{ kind: "context"; name: string };
/** One relevant `docker events` entry. */
export type DockerEvent = {
/** `container`, `image`, `volume`, `network`. */
object: string,
action: string,
id: string,
name: string | null,
};
export type DockerImage = {
id: string,
/** `<none>` for dangling images. */
repository: string,
tag: string,
size: string,
createdSince: string,
};
/** A line of `docker logs` output. */
export type DockerLogLine = {
stderr: boolean,
text: string,
};
export type DockerNetwork = {
id: string,
name: string,
driver: string,
scope: string,
composeProject: string | null,
};
export type DockerObject = "container" | "image" | "volume" | "network";
/** A registry to log in to (Docker Hub, GHCR, a private one). The password is stored separately. */
export type DockerRegistry = {
id: string,
name: string,
/** `docker.io`, `ghcr.io`, `registry.example.com:5000`. */
address: string,
username?: string,
};
export type DockerSettings = {
connections?: DockerConnection[],
registries?: DockerRegistry[],
};
/** Everything the Services tree shows, fetched in one go. */
export type DockerSnapshot = {
availability: DockerAvailability,
/** The docker executable in use, e.g. for `docker exec -it` in a terminal. */
executable: string | null,
containers: DockerContainer[],
images: DockerImage[],
volumes: DockerVolume[],
networks: DockerNetwork[],
/** Lists that failed although the daemon answered (shown, not fatal). */
errors: string[],
/** Global CLI options selecting the connection's daemon (for `docker exec` in a terminal). */
globalArgs?: string[],
};
export type DockerVolume = {
name: string,
driver: string,
mountpoint: string,
composeProject: string | null,
};
/** What the UI needs to show an opened document. */
export type DocumentInfo = {
id: DocId,
path: IpcPath,
text: string,
version: number,
language: LanguageId,
encoding: string,
lineEnding: LineEnding,
readOnly: boolean,
dirty: boolean,
/**
* Larger than `ide_vfs::LARGE_FILE_THRESHOLD`: language servers, syntax
* structure and folding are disabled; the editor should drop heavy features.
*/
large?: boolean,
/** Effective `.editorconfig` properties, when any section applies. */
editorconfig?: EditorConfigProps | null,
/**
* Set for read-only virtual documents (library classes a language server
* provides, e.g. `jdt://…`); `path` then holds the same URI.
*/
uri?: string | null,
/**
* CodeMirror mode replacing the language's own one (an Angular project's
* HTML templates).
*/
uiMode?: string | null,
};
/**
* A link in a document (`textDocument/documentLink`): an HTML `href`, a
* Markdown link, an `#include`, a JSON `$schema`…
*/
export type DocumentLink = {
range: Range,
/** A `file:` target. */
path: IpcPath | null,
/** The `#fragment` of a `file:` target (`L12`, `L12,5`, a heading or element id). */
fragment: string | null,
/** Any other target (`https:`, …). */
url: string | null,
tooltip: string | null,
};
export type DuplicateGroup = {
tokens: number,
/** Lines of the first fragment. */
lines: number,
language: LanguageId,
fragments: Fragment[],
};
export type DuplicateOptions = {
/** Shortest duplicate reported, in tokens. */
minTokens: number,
/** Treat all identifiers as equal (finds copies with renamed variables). */
anonymizeIdentifiers: boolean,
/** Treat all literals as equal. */
anonymizeLiterals: boolean,
};
export type DuplicatesReport = {
groups: DuplicateGroup[],
/** Files tokenised (files without a grammar are skipped). */
files: number,
tokens: number,
/** More groups were found than reported. */
truncated: boolean,
cancelled: boolean,
elapsedMs: number,
};
/** An item of a frontend-listed menu slot. */
export type DynamicItem = {
action: string,
arg: string | null,
label: string,
};
/** Editor › General › Appearance. */
export type EditorAppearanceSettings = {
caretBlinking?: boolean,
/** Blink period in ms. */
caretBlinkPeriod?: number,
/** Fade the caret in and out instead of toggling it; rounds its corners. */
smoothCaretBlinking?: boolean,
blockCaret?: boolean,
/** Animate the caret between positions when it is moved. */
smoothCaretMovement?: boolean,
/** Smooth caret movement curve: `snappy` | `gliding`. */
caretMovementStyle?: string,
lineNumbers?: boolean,
methodSeparators?: boolean,
/** Sub-options of `editor.showWhitespace`. */
whitespaceLeading?: boolean,
whitespaceInner?: boolean,
whitespaceTrailing?: boolean,
indentGuides?: boolean,
/** Right margin and visual guides from Code Style. */
hardWrapGuides?: boolean,
intentionBulb?: boolean,
/** Distraction Free Mode: width of the centred text column, in characters. */
distractionFreeWidth?: number,
};
/**
* Effective EditorConfig properties of one file. `None` = not specified
* (or `unset`), so the IDE setting applies.
*/
export type EditorConfigProps = {
indentStyle: IndentStyle | null,
/** Columns per indentation level (`indent_size = tab` resolves to `tab_width`). */
indentSize: number | null,
tabWidth: number | null,
endOfLine: LineEnding | null,
/** `utf-8`, `utf-8-bom`, `utf-16le`, `utf-16be` or `latin1`. */
charset: string | null,
trimTrailingWhitespace: boolean | null,
insertFinalNewline: boolean | null,
maxLineLength: number | null,
};
/** Editor › General (mouse, scrolling, soft wraps, virtual space, saving). */
export type EditorGeneralSettings = {
/** Change font size with ⌘ + mouse wheel. */
wheelZoom?: boolean,
markdownImageFolder?: string,
markdownImageNamePattern?: string,
/** Drag-and-drop of selected text inside the editor. */
dragAndDrop?: boolean,
/** When the caret moves out of view: `minimize` scrolling | `center` the caret line. */
caretScroll?: string,
/** Glob patterns (`;`-separated) of files soft-wrapped when `editor.softWrap` is on. */
softWrapFiles?: string,
/** Wrapped parts keep the original line's indent. */
softWrapIndent?: boolean,
/** Show virtual space at the file bottom. */
scrollPastEnd?: boolean,
/** Remove trailing spaces on save from: `modified` lines | `all` lines. */
stripTrailingScope?: string,
/** Keep trailing spaces on the caret line when stripping. */
keepTrailingOnCaretLine?: boolean,
removeTrailingBlankLines?: boolean,
/** Copy as rich text (HTML with syntax colours) by default. */
richTextCopy?: boolean,
};
export type EditorSettings = EditorSettings_Serialize | EditorSettings_Deserialize;
export type EditorSettings_Deserialize = {
fontFamily?: string,
fontSize?: number | null,
lineHeight?: number | null,
tabSize?: number,
insertSpaces?: boolean,
softWrap?: boolean,
showWhitespace?: boolean,
inlayHints?: boolean,
stickyScroll?: boolean,
formatOnSave?: boolean,
/** Editor colour scheme id; `theme-default` follows the IDE theme. */
colorScheme?: string,
/** Imported editor schemes, stored in user settings. */
customSchemes?: { [key in string]: CustomColorScheme_Deserialize },
/** Color Scheme edits: scheme id → attribute id → override. */
colorOverrides?: { [key in string]: { [key in string]: TextAttributesOverride_Deserialize } },
/**
* Color Scheme › Language Defaults › Semantic highlighting: local variables and
* parameters get a colour derived from their name (IDEA's rainbow identifiers).
*/
semanticHighlighting?: boolean,
/** Color Scheme › Language Defaults › Rainbow brackets: `()`, `[]`, `{}` coloured by depth. */
rainbowBrackets?: boolean,
ligatures?: boolean,
/** Fallback font for glyphs the main font lacks; empty = none. */
fallbackFont?: string,
/** Typography Settings › Main font weight (CSS 100–900), as IDEA. */
fontWeight?: number,
/** Typography Settings › Bold font weight: wherever the editor renders bold. */
boldFontWeight?: number,
general?: EditorGeneralSettings,
appearance?: EditorAppearanceSettings,
breadcrumbs?: BreadcrumbsSettings,
completion?: CompletionSettings,
autoImport?: AutoImportSettings,
folding?: FoldingSettings,
tabs?: EditorTabsSettings,
smartKeys?: SmartKeysSettings,
codeEditing?: CodeEditingSettings,
inlay?: InlayHintsSettings,
inlineCompletion?: InlineCompletionSettings,
/** Gutter icon groups turned off (`run`, `breakpoints`, `bookmarks`, `vcs`, `blame`). */
gutterIconsDisabled?: string[],
showGutterIcons?: boolean,
codeStyle?: CodeStyleSettings_Deserialize,
encodings?: EncodingSettings,
};
export type EditorSettings_Serialize = {
fontFamily: string,
fontSize: number | null,
lineHeight: number | null,
tabSize: number,
insertSpaces: boolean,
softWrap: boolean,
showWhitespace: boolean,
inlayHints: boolean,
stickyScroll: boolean,
formatOnSave: boolean,
/** Editor colour scheme id; `theme-default` follows the IDE theme. */
colorScheme: string,
/** Imported editor schemes, stored in user settings. */
customSchemes: { [key in string]: CustomColorScheme_Serialize },
/** Color Scheme edits: scheme id → attribute id → override. */
colorOverrides: { [key in string]: { [key in string]: TextAttributesOverride_Serialize } },
/**
* Color Scheme › Language Defaults › Semantic highlighting: local variables and
* parameters get a colour derived from their name (IDEA's rainbow identifiers).
*/
semanticHighlighting: boolean,
/** Color Scheme › Language Defaults › Rainbow brackets: `()`, `[]`, `{}` coloured by depth. */
rainbowBrackets: boolean,
ligatures: boolean,
/** Fallback font for glyphs the main font lacks; empty = none. */
fallbackFont: string,
/** Typography Settings › Main font weight (CSS 100–900), as IDEA. */
fontWeight: number,
/** Typography Settings › Bold font weight: wherever the editor renders bold. */
boldFontWeight: number,
general: EditorGeneralSettings,
appearance: EditorAppearanceSettings,
breadcrumbs: BreadcrumbsSettings,
completion: CompletionSettings,
autoImport: AutoImportSettings,
folding: FoldingSettings,
tabs: EditorTabsSettings,
smartKeys: SmartKeysSettings,
codeEditing: CodeEditingSettings,
inlay: InlayHintsSettings,
inlineCompletion: InlineCompletionSettings,
/** Gutter icon groups turned off (`run`, `breakpoints`, `bookmarks`, `vcs`, `blame`). */
gutterIconsDisabled: string[],
showGutterIcons: boolean,
codeStyle: CodeStyleSettings_Serialize,
encodings: EncodingSettings,
};
/** Editor › General › Editor Tabs. */
export type EditorTabsSettings = {
/** `top` | `bottom` | `none`. */
placement?: string,
multipleRows?: boolean,
/** One row that doesn't fit: `scroll` the tabs panel | `squeeze` the tabs. */
oneRowOverflow?: string,
pinnedSeparateRow?: boolean,
showFileIcon?: boolean,
showExtension?: boolean,
showDirectoryForNonUnique?: boolean,
/** Mark modified tabs with an asterisk. */
markModified?: boolean,
showFullPathOnHover?: boolean,
showCloseButton?: boolean,
/** `right` | `left` (with `show_close_button`). */
closeButtonPosition?: string,
sortAlphabetically?: boolean,
previewTab?: boolean,
openAtEnd?: boolean,
tabLimit?: number,
/** When the limit is reached close `unchanged` (non-modified) tabs first, or the `lru` one. */
closingPolicy?: string,
/** When the current tab is closed activate the `left` | `right` | `mru` tab. */
activateOnClose?: string,
};
/** Editor › File Encodings. */
export type EncodingSettings = {
/** Fallback for files outside the project that are not valid UTF-8 (WHATWG label). */
global?: string,
/** Encoding of new files and fallback for project files that are not valid UTF-8. */
project?: string,
/** Fallback for `.properties` files. */
properties?: string,
/** Display properties Unicode escapes as characters and save non-ASCII as escapes. */
nativeToAscii?: boolean,
/** Create UTF-8 files: `never` (no BOM) | `always` (with BOM) | `windows` (with BOM on Windows). */
utf8Bom?: string,
};
export type EntryKind = "file" | "dir" | "symlink";
/** What Reload Environment changed. */
export type EnvReloaded = {
/** Names of the variables new child processes now get differently (added, changed or removed). */
changed: string[],
/** The `devcontainer.json` whose `remoteEnv` applies, if any. */
devcontainer: string | null,
/** Whether the login shell was read (it isn't on Windows). */
shellRead: boolean,
};
export type ErrorData = { type: "tool"; tool: string; missing: boolean };
export type ErrorKind = "notFound" | "alreadyExists" | "permissionDenied" | "invalidInput" |
/** Document version mismatch; the UI must resync the full text. */
"outOfSync" | "cancelled" | "timedOut" |
/** A required external tool (language server, git, debugger) is unavailable. */
"unavailable" | "io" | "protocol" | "internal";
/** An exception breakpoint filter offered by an adapter (`exceptionBreakpointFilters`). */
export type ExceptionFilter = {
filter: string,
label: string,
description: string | null,
/** Enabled unless the user chose otherwise. */
default: boolean,
supportsCondition: boolean,
};
/** Result of `expression_at` (Extract Variable / Introduce … fallback). */
export type ExpressionAt = {
/**
* The expression exactly matching the (whitespace-trimmed) selection, else
* the smallest expression enclosing it; for an empty selection the
* innermost expression at the caret. `None` when the selection is not
* inside an expression.
*/
expression: SyntaxNode | null,
/** `expression` spans exactly the trimmed selection. */
exact: boolean,
/**
* Expressions from `expression` outwards up to the statement, innermost
* first (IDEA's "choose expression" popup for a caret selection).
*/
candidates: SyntaxNode[],
/** The statement (direct child of a block / statement list) containing the expression. */
statement: SyntaxNode | null,
/** The block / statement list that contains `statement`. */
block: SyntaxNode | null,
/**
* Innermost lambda / nested function between the expression and the
* statement: inserting a declaration before `statement` would move the
* expression out of that function, so callers must not do it blindly.
*/
functionBoundary: SyntaxNode | null,
/** The statement (or the expression when there is none) contains syntax errors. */
hasError: boolean,
};
/** Tools › External Tools entry. */
export type ExternalTool = {
id?: string,
name?: string,
description?: string,
group?: string,
enabled?: boolean,
program?: string,
/** Arguments with macros (`$FilePath$`, `$ProjectFileDir$`…), shell-quoted. */
arguments?: string,
workingDirectory?: string,
synchronizeAfter?: boolean,
openConsole?: boolean,
};
export type FileCoverage = {
path: IpcPath,
/** Sorted by line. */
lines: LineCoverage[],
linesTotal: number,
linesCovered: number,
branchesTotal: number,
branchesCovered: number,
};
export type FileEdit = { kind: "edit"; path: IpcPath; edits: TextEdit[] } | { kind: "create"; path: IpcPath; overwrite: boolean } | { kind: "rename"; from: IpcPath; to: IpcPath } | { kind: "delete"; path: IpcPath; recursive: boolean };
export type FileEntry = {
name: string,
path: IpcPath,
kind: EntryKind,
size: number,
/** Milliseconds since the Unix epoch. */
mtimeMs: number | null,
/** Matched by .gitignore or the exclude settings. */
ignored: boolean,
/** Matched by the exclude settings (IDEA's "excluded": dimmed, excluded-folder icon). */
excluded: boolean,
hidden: boolean,
/**
* For symlinks: what the link points to (`None` when dangling); `None`
* for other entries.
*/
targetKind?: EntryKind | null,
};
/** Identifier occurrences in one file (`identifiers_in_files`). */
export type FileIdentifiers = {
path: IpcPath,
occurrences: IdentifierOccurrence[],
};
export type FileMatch = {
path: IpcPath,
/** Path relative to the project root, as displayed. */
relPath: string,
score: number,
/** Matched char indices within `rel_path`. */
indices: number[],
};
/** All matches in one file; streamed to the UI as they are found. */
export type FileMatches = {
path: IpcPath,
relPath: string,
matches: LineMatch[],
};
/** One file or folder move. */
export type FileMove = {
from: IpcPath,
to: IpcPath,
};
/** What the editor needs to know before choosing a viewer for a file. */
export type FileProbe = {
size: number,
/** Content looks binary (same heuristic as text loading). */
binary: boolean,
/** Above the read-only threshold: the text editor would open it read-only. */
tooLarge: boolean,
};
/** A path written in a document: an HTML URL attribute, a CSS `url()` / `@import`. */
export type FileReference = {
range: Range,
value: string,
};
/** Reference updates for a file / folder move (`workspace/willRenameFiles`). */
export type FileRenameEdits = {
/** Edits of every server that took part, in terms of the paths before the move. */
edit: WorkspaceEdit,
/** Servers asked (their filters matched one of the moved paths). */
servers: string[],
/** Servers that failed; their references are not updated. */
errors: string[],
};
export type FileSettings = {
/** Save on focus loss / tab switch, like IDEA. */
autoSave?: boolean,
/** Re-check open files against disk when the IDE window gains focus. */
syncOnFocus?: boolean,
exclude?: string[],
/** Ignored Files and Folders: name patterns hidden everywhere; see [`crate::ignored`]. */
ignoredNames?: string[],
trimTrailingWhitespace?: boolean,
ensureFinalNewline?: boolean,
/** Local History keeps changes from this many working days (days with changes), like IDEA. */
localHistoryDays?: number,
/** Upper bound for a project's Local History in MB; the oldest revisions go first. */
localHistoryMaxMb?: number,
/** File Types › Recognized File Types: the user's changes, by language id. */
fileTypes?: { [key in string]: FileTypeAssociation },
/** Override File Type: file (project-relative and `/`-separated, or absolute) → language id. */
fileTypeOverrides?: { [key in string]: string },
};
export type FileStamp = {
size: number,
mtime: number | null,
};
export type FileStatus = {
path: IpcPath,
relPath: string,
/** Staged change, if any. */
staged: ChangeKind | null,
/** Unstaged (working tree) change, if any. */
unstaged: ChangeKind | null,
renamedFrom: string | null,
};
/** One language's file name and hashbang patterns on top of its definition. */
export type FileTypeAssociation = {
/** Added file name patterns: `*.foo`, `Jenkinsfile`, `Dockerfile.*` (`*` and `?` wildcards). */
patterns?: string[],
/** Patterns of the definition (`*.ext`, file names) the user removed. */
removedPatterns?: string[],
/** Interpreters run by a `#!` first line, e.g. `node` for `#!/usr/bin/env node`. */
hashbangs?: string[],
};
export type FoldKind = "region" | "comment" | "imports";
export type FoldRange = {
start_line: number,
end_line: number,
kind: FoldKind,
};
/** Editor › General › Code Folding. */
export type FoldingSettings = {
showOutline?: boolean,
fileHeader?: boolean,
imports?: boolean,
docComments?: boolean,
};
/**
* One installed family. `monospaced` is the font system's own flag (fixed
* pitch; on Linux also fontconfig's dual-width CJK monospace).
*/
export type FontFamily = {
name: string,
monospaced: boolean,
};
/** The string form supported by gopls's experimental interactive command protocol. */
export type FormAnswer = {
id: string,
value: string,
};
export type FormField = {
id: string,
description: string,
required: boolean,
default?: string | null,
error?: string | null,
};
export type FormatOptions = {
tabSize: number,
insertSpaces: boolean,
onSave?: boolean,
};
/** One occurrence of a duplicated code fragment. */
export type Fragment = {
path: IpcPath,
relPath: string,
range: Range,
/** The fragment's source, from the start of its first line (capped). */
text: string,
};
export type FsConnection = { kind: "sftp"; ssh: string } | { kind: "local" };
/**
* A method breakpoint (DAP function breakpoint). `name` uses the adapter's syntax:
* `pkg.Class#method` for java-debug, `pkg.Func` / `pkg.(*T).Method` for Delve, a plain
* function name for debugpy and LLDB.
*/
export type FunctionBreakpoint = {
name: string,
condition: string | null,
hitCondition: string | null,
enabled: boolean,
};
export type GeneralSettings = {
reopenLastProject?: boolean,
confirmExit?: boolean,
/** Where Open… puts a project while one is open: `ask` | `new` | `same` | `attach`. */
openProjectIn?: string,
/** Initial folder of the Open / Clone dialogs; empty = the OS default. */
defaultProjectDirectory?: string,
/** Save all files after `idle_seconds` without input. */
saveOnIdle?: boolean,
idleSeconds?: number,
dateFormat?: DateFormatSettings,
/**
* File › Power Save Mode: no automatic popups (completion, parameter info,
* quick documentation) or background highlighting (usages, code vision).
*/
powerSaveMode?: boolean,
/** File › Rename Project… (project layer): the name shown for the project; empty = its folder name. */
projectName?: string,
};
/**
* A GitHub API call through `gh api`: GraphQL (`endpoint` `graphql`, `body`
* `{"query", "variables"}`) or REST (`repos/{owner}/{repo}/…`, gh fills in the
* placeholders from the project's remote).
*/
export type GhApiRequest = {
/** `GET`, `POST`, `PATCH`, `PUT`, `DELETE`. */
method: string,
endpoint: string,
/** JSON request body, sent on stdin. */
body: string | null,
/** Follow REST `Link` pages; the result is the array of all pages (`--slurp`). */
paginate: boolean,
};
/** Whether pull requests can be shown for the project, and why not. */
export type GhAvailability = { kind: "ready"; repo: GhRepo;
/** The signed-in user. */
login: string | null } |
/** No `gh` executable was found. */
{ kind: "notInstalled" } |
/** `gh auth login` has not been run (or the token expired). */
{ kind: "notLoggedIn"; message: string } |
/** The project has no GitHub remote (or is not a git repository). */
{ kind: "notGitHub"; message: string } | { kind: "error"; message: string };
export type GhRepo = {
/** `owner/name`. */
nameWithOwner: string,
url: string,
defaultBranch: string | null,
/** Merge methods the repository allows (all of them when gh does not say). */
mergeCommitAllowed: boolean,
squashMergeAllowed: boolean,
rebaseMergeAllowed: boolean,
/** The signed-in user's permission: `ADMIN`, `MAINTAIN`, `WRITE`, `TRIAGE`, `READ`; empty when unknown. */
viewerPermission: string,
};
export type GitExecutableInfo = {
/** `git version …` output. */
version: string,
/** The executable that was run. */
path: string,
};
export type GitOperation =
/** Continue the merge / rebase / cherry-pick / revert in progress. */
{ op: "continue" } | { op: "abort" } | { op: "skip" } |
/** Commits oldest first. */
{ op: "cherryPick"; commits: string[] } |
/** Commits newest first. */
{ op: "revert"; commits: string[] } | { op: "reset"; commit: string; mode: ResetMode } |
/** Rebases `base..HEAD` (`base: None` = from the root) following `entries`, oldest first. */
{ op: "interactiveRebase"; base: string | null; entries: RebaseEntry[] };
export type GitSettings = {
/** Path to the git executable; empty = auto-detect. */
executable?: string,
/** Default of Update Project: `merge` | `rebase`. */
updateMethod?: string,
/** Push rejected (non-fast-forward): update the branch and push again. */
autoUpdateOnPushRejected?: boolean,
warnCrlf?: boolean,
warnDetachedHead?: boolean,
/** Background check for incoming commits: `auto` | `always` | `never`. */
incomingCheck?: string,
/** Branch name globs, `;`/`,`-separated; force push to them is prohibited. */
protectedBranches?: string,
/** Initial state of Commit Options › Sign-off Commit. */
signOff?: boolean,
/** Ask before committing files larger than `large_file_mb`. */
warnLargeFiles?: boolean,
largeFileMb?: number,
/** Ask before committing names that are invalid on Windows or differ only in case. */
warnBadFileNames?: boolean,
/** Commit and Push opens the Push dialog; otherwise it pushes right away. */
showPushDialog?: boolean,
/** With `show_push_dialog`: only for commits to protected branches. */
pushDialogOnlyProtected?: boolean,
/** Stashes and shelves share one tab. */
combineStashAndShelf?: boolean,
};
export type GoBuildTags = {
/** Empty values inherit the selected toolchain's defaults. */
os?: string,
arch?: string,
version?: string,
compiler?: string,
/** Empty = automatic, "1" = enabled, "0" = disabled. */
cgo?: string,
custom?: string,
experiments?: string,
};
export type GoModules = {
env?: { [key in string]: string },
autoVendor?: boolean,
};
export type GoSettings = {
/** Empty = the `go` on `PATH`. */
goroot?: string,
/** Empty = `go env GOPATH`. */
gopath?: string,
buildTags?: GoBuildTags,
modules?: GoModules,
};
export type GotoKind = "definition" | "declaration" | "typeDefinition" | "implementation";
export type GradleDistribution = "wrapper" | "local";
export type GradleModel = {
/** Project-relative directory of the build (where `settings.gradle` is); `""` = project root. */
dir: string,
/** The root project first, then subprojects in `include` order. */
projects: GradleProject[],
javaVersion: number | null,
/** `gradlew` of the build (absolute), else `gradle`. */
command: string,
/** Environment for runs (`JAVA_HOME`); filled in by the shell. */
env: { [key in string]: string },
/** When the task list was last read from Gradle (Unix ms); `None` = static defaults. */
syncedAt: number | null,
stale: boolean,
syncError: string | null,
};
export type GradleProject = {
/** Gradle path: `:` for the root project, `:app`, `:libs:core`. */
path: string,
name: string,
/** Project-relative directory. */
dir: string,
/** Project-relative build script, if any. */
buildFile: string | null,
tasks: GradleTask[],
};
/** Build Tools › Gradle. */
export type GradleSettings = {
/** Empty = Project JDK; otherwise a JDK home. */
jvm?: string,
distribution?: GradleDistribution,
/** Used only for the local distribution. */
home?: string,
/** Empty = Gradle's default user home. */
userHome?: string,
};
export type GradleTask = {
name: string,
/** Lower-case group (`build`, `build setup`, `other`). */
group: string,
description: string | null,
};
export type HierarchyDirection =
/** Callers / supertypes. */
"incoming" |
/** Callees / subtypes. */
"outgoing";
export type HierarchyItem = {
name: string,
kind: SymbolKind,
detail: string | null,
/** File path, or the URI of a virtual document (see `uri`). */
path: IpcPath,
/** Set for non-`file:` items (library classes). */
uri?: string | null,
range: Range,
selectionRange: Range,
/** Call sites, for call hierarchy. */
fromRanges: Range[],
};
export type Highlight = {
range: Range,
kind: HighlightKind,
};
export type HighlightKind = "text" | "read" | "write";
export type HistoryEntry = {
/** Content hash (blake3 hex); identifies the stored blob. Empty for labels. */
id: string,
path: IpcPath,
timestampMs: number | null,
/** e.g. "Saved", "External change", "Deleted", "Before refactoring: Move". */
label: string,
size: number,
kind?: HistoryKind,
};
export type HistoryKind =
/** A stored revision of `path`. */
"snapshot" |
/**
* A user label ("Put Label…") or system event ("Before Git checkout")
* for everything under `path` (the project root); has no content.
*/
"label";
/** Result of [`DebugManager::redefine_classes`]. */
export type HotSwapResult = {
/** Fully qualified names of the classes reloaded (empty: nothing had changed). */
changedClasses: string[],
errorMessage: string | null,
};
export type Hover = {
contents: Markup,
range: Range | null,
};
/** One request with its outcome. */
export type HttpExchange = {
entry: HttpHistoryEntry,
request: PreparedRequest,
response: HttpResponse | null,
};
export type HttpHistoryEntry = {
id: string,
/** Unix epoch, ms. */
timeMs: number | null,
name: string | null,
method: string,
url: string,
/** `None` when the request failed. */
status: number | null,
totalMs: number | null,
/** The `.http` file the request came from. */
file: IpcPath | null,
error: string | null,
};
/** One request of a file, as shown by the gutter and the Run All list. */
export type HttpRequestBlock = {
/** 0-based index among the file's requests. */
index: number,
name: string | null,
method: string,
/** URL as written (variables not substituted). */
url: string,
/** 0-based line of the request line. */
line: number,
/** First and last line (0-based, inclusive) of the block, separator excluded. */
startLine: number,
endLine: number,
};
export type HttpResponse = {
status: number,
statusText: string,
version: string,
headers: ([string, string])[],
contentType: string | null,
/** Body as text (lossy UTF-8); `None` for binary bodies. */
body: string | null,
/** Size in bytes as received (after decompression). */
size: number | null,
truncated: boolean,
/** Request start → response headers. */
ttfbMs: number | null,
/** Request start → body fully read. */
totalMs: number | null,
};
export type HunkKind = "added" | "modified" | "deleted";
/** A hunk identified by its line ranges (0-based), see [`LineHunk`]. */
export type HunkRange = {
start: number,
lines: number,
oldStart: number,
oldLines: number,
};
/**
* The single error type that crosses the IPC boundary.
*
* Crates keep rich internal errors and convert at their public edge; the UI
* switches on `kind` and shows `message`.
*/
export type IdeError = {
kind: ErrorKind,
message: string,
/** Structured detail for errors the UI acts on; `null` for plain errors. */
data?: ErrorData | null,
};
export type IdeEvent =
/** Project window membership or selection changed. */
{ type: "windowGroupsChanged" } | { type: "projectTrustChanged"; root: IpcPath; trusted: boolean } |
/** Files or directories changed on disk (after debouncing, ignore rules applied). */
{ type: "fsChanged"; created: IpcPath[]; modified: IpcPath[]; removed: IpcPath[] } |
/** Excluded or ignored folders whose contents changed; they stay out of `FsChanged`. */
{ type: "excludedDirsChanged"; dirs: IpcPath[] } |
/**
* The backend changed a document (reload from disk, formatting, refactoring).
* The UI applies `changes` on top of `base_version`, yielding `version`.
*/
{ type: "docPatched"; doc: DocId; baseVersion: number; version: number; changes: TextChange[] } |
/** A document's dirty flag changed (saved / modified externally). */
{ type: "docDirty"; doc: DocId; dirty: boolean } |
/**
* An open document's language changed (Settings › File Types, Override File
* Type), or its UI mode (a framework's root marker appeared or went).
*/
{ type: "docLanguage"; doc: DocId; language: LanguageId;
/** See `DocumentInfo::ui_mode`. */
uiMode: string | null } |
/** Full replacement of diagnostics for one file from one producer. */
{ type: "diagnostics"; path: IpcPath; source: string; items: Diagnostic[] } |
/** Progress of a background task; `fraction` is `None` when indeterminate. */
{ type: "task"; id: TaskId; title: string; message: string | null; fraction: number | null; done: boolean;
/** The UI may stop it with `cancel_task(id)` (see [`crate::task`]). */
cancellable: boolean } |
/** Project indexing state changed (dumb mode on/off). */
{ type: "indexState"; indexing: boolean; files: number; symbols: number } |
/** Git status / branch information should be refreshed. */
{ type: "vcsChanged"; root: IpcPath } | { type: "languageServer"; server: ServerId; name: string; status: ServerStatus; message: string | null } |
/**
* A stopped language server left the project's list (disabled in settings, or a
* fallback that a preferred server took over from again).
*/
{ type: "languageServerRemoved"; server: ServerId } |
/**
* A language server asked clients to re-request one kind of data for its
* open documents (`workspace/inlayHint/refresh`, …), e.g. after indexing.
*/
{ type: "lspRefresh"; server: ServerId; kind: LspRefreshKind } | { type: "terminalExited"; terminal: TerminalId; code: number | null } | { type: "runExited"; run: RunId; code: number | null } | { type: "debug"; session: DebugSessionId; event: DebugEvent } | { type: "notify"; level: NotifyLevel; title: string; body: string | null } |
/**
* A setting was written (any window); the windows it concerns (all for a
* global value, the project's for a project value) re-read their effective settings.
*/
{ type: "settingsChanged"; key: string } |
/**
* The project's source / test / resource / excluded roots changed (build files
* changed or folders were marked); the UI re-reads them with `project_roots`.
*/
{ type: "projectRootsChanged"; root: IpcPath } |
/** A child process (`ssh`, `git`) asks for a credential; answered with `ssh_askpass_answer`. */
{ type: "askpass"; id: number; prompt: string; kind: AskpassKind;
/** The dialog offers "Remember" for the answer (git HTTPS passwords). */
remember: boolean } |
/** Prompt `id` was answered (in any window) or gave up. */
{ type: "askpassDone"; id: number } |
/**
* The kernel of an open notebook changed state (`starting`, `idle`, `busy`,
* `dead`); `message` says why it failed to start or died.
*/
{ type: "notebookKernel";
/** Backend document incarnation; stale queued events cannot target a reopen. */
id: string; path: IpcPath; state: string; message: string | null };
/** An identifier-like token whose text equals the searched name. */
export type IdentifierOccurrence = {
range: Range,
/** Node kind, e.g. `identifier`, `type_identifier`, `property_identifier`. */
kind: string,
/**
* Member / label position (`obj.name`, `name: value` labels): refers to
* a member, not to a variable in scope.
*/
qualified: boolean,
};
export type IgnoreDestination = "gitignore" | "localExclude";
export type IndentConfig = IndentConfig_Serialize | IndentConfig_Deserialize;
export type IndentConfig_Deserialize = {
"tab-size": number,
"insert-spaces": boolean,
};
export type IndentConfig_Serialize = {
tabSize: number,
insertSpaces: boolean,
};
export type IndentStyle = "space" | "tab";
export type IndexStatus = {
indexing: boolean,
files: number,
symbols: number,
};
export type InlayHint = {
position: Pos,
label: string,
kind: InlayKind,
paddingLeft: boolean,
paddingRight: boolean,
tooltip: string | null,
/**
* The label's parts when the server split it (empty for a plain label);
* their values concatenate to `label`.
*/
parts: InlayLabelPart[],
};
/** Editor › Inlay Hints. */
export type InlayHintsSettings = {
types?: boolean,
parameters?: boolean,
/** Hints of other kinds (chaining, closing labels…). */
other?: boolean,
disabledLanguages?: string[],
/** Code vision: usages above declarations. */
codeVisionUsages?: boolean,
/** Code vision: last author of a declaration (VCS blame) beside its usages. */
codeVisionAuthor?: boolean,
};
export type InlayKind = "type" | "parameter" | "other";
/** One part of an inlay hint label, e.g. a type name that navigates to its declaration. */
export type InlayLabelPart = {
value: string,
tooltip: string | null,
/** Declaration the part stands for (⌘-click navigates there). */
location: Location | null,
};
/** One `textDocument/inlineCompletion` suggestion (ghost text at the caret). */
export type InlineCompletionItem = {
/** Text that replaces `range`; snippets arrive as their plain text. */
insertText: string,
/** Replaced range; `None` inserts at the caret. */
range: Range | null,
/** What the typed text is matched against while the suggestion stays shown (default: `insert_text`). */
filterText: string | null,
/** Run after the suggestion is accepted. */
command: Command | null,
server: ServerId,
};
/**
* Editor › General › Inline Completion: ghost text from language servers that
* support `textDocument/inlineCompletion` (LSP 3.18).
*/
export type InlineCompletionSettings = {
enabled?: boolean,
/** Ask only once typing has paused for `pause_ms`, instead of right after each change. */
onlyOnPause?: boolean,
pauseMs?: number,
disabledLanguages?: string[],
};
export type InspectEvent =
/** Files about to be inspected. */
{ type: "started"; total: number } |
/** A file finished (with or without problems). */
{ type: "file"; file: InspectedFile; done: number } | { type: "done"; summary: InspectSummary };
export type InspectSummary = {
/** Files inspected by a language server. */
files: number,
problems: number,
/** Files in scope no language server serves. */
skipped: number,
/** Files whose server failed or never became ready. */
failed: number,
cancelled: boolean,
elapsedMs: number,
};
export type InspectedFile = {
path: IpcPath,
relPath: string,
diagnostics: Diagnostic[],
};
/** IDEA's highlighting levels. */
export type InspectionLevel = "error" | "warning" | "weakWarning" | "serverProblem" | "typo" |
/** Reported (Problems, Inspect Code) but not highlighted in the editor. */
"none";
/** Changes to one inspection; absent fields keep the inspection's defaults. */
export type InspectionOverride = {
enabled?: boolean | null,
severity?: InspectionLevel | null,
/**
* The inspection's own options (Typo: `processCode`, `processLiterals`,
* `processComments`); absent ones keep their defaults.
*/
options?: { [key in string]: boolean } | null,
};
export type InspectionSettings = {
/**
* Profile in effect for the project: `default`, `project`, or a copy
* as `ide:<key>` / `project:<key>`.
*/
profile?: string,
/** The `Default` profile (IDE level): inspection id → override. */
default?: { [key in string]: InspectionOverride },
/** The `Project Default` profile (stored with the project). */
project?: { [key in string]: InspectionOverride },
/** Profiles copied at IDE level (global settings), by key. */
ideProfiles?: { [key in string]: CustomInspectionProfile },
/** Profiles copied at project level (project settings), by key. */
projectProfiles?: { [key in string]: CustomInspectionProfile },
};
/** A command line that installs a missing tool (run in the Run tool window). */
export type InstallCommand = {
command: string,
args: string[],
cwd: IpcPath | null,
};
/** Streamed install progress. */
export type InstallEvent =
/** One line of installer output. */
{ type: "line"; text: string } |
/** Download progress; `fraction` is 0..1 when the size is known. */
{ type: "progress"; fraction: number | null; message: string };
/** Optional parts of the invalidation; the symbol index is always rebuilt. */
export type InvalidateCachesOptions = {
/** Local History of every project. */
localHistory?: boolean,
/** Language server workspaces (jdtls `-data`, …): servers re-import the project. */
languageServers?: boolean,
/** Build tool sync results (Maven / Gradle) and other per-project caches. */
buildCaches?: boolean,
};
/** A path field of an IPC type. */
export type IpcPath = string;
export type Isolation =
/** A new git worktree on its own branch. */
"worktree" |
/** The project's own checkout. */
"local";
export type IssueLink = {
/** Regular expression matched in commit messages. */
pattern?: string,
/** Link with `$0` (whole match) / `$1`… (groups) placeholders. */
link?: string,
};
/** Result of `java/buildWorkspace` (jdtls `BuildWorkspaceStatus`). */
export type JavaBuildStatus = "failed" | "succeeded" |
/** Compiled, but some project has compile errors. */
"withErrors" | "cancelled";
/** One error diagnostic; `line` / `column` are 1-based for display. */
export type JavaCompileError = {
path: IpcPath,
line: number,
column: number,
message: string,
};
/** Everything needed to launch a class of a module: build outcome, classpath and JDK. */
export type JavaLaunchInfo = {
/** `None` when no build was requested. */
build: JavaBuildStatus | null,
projectRoot: IpcPath | null,
classPaths: string[],
modulePaths: string[],
/** Path list separator of the host that runs the JVM. */
pathListSeparator: string,
/** JDK home jdtls compiles the project against. */
javaHome: IpcPath | null,
/** The `java` launcher to use (filled in by the caller from the installed JDKs). */
javaExec: string | null,
/**
* How a launcher that builds the command line itself must shorten it (java-debug's
* `shortenCommandLine`: `none` | `jarmanifest` | `argfile`; filled in by the caller).
*/
shortenCommandLine: string | null,
/** First compile errors of the workspace when the build had errors. */
errors: JavaCompileError[],
/** All compile errors (`errors` is capped). */
errorCount: number,
/** Likely causes of the errors worth telling the user (e.g. a missing Lombok agent). */
hints: string[],
};
export type JavaSettings = {
/**
* Project JDK home; empty = per module, the installed JDK matching the
* Java version it targets.
*/
jdk?: string,
/**
* JDK home the Java language server (jdtls) runs on, apart from the project
* JDK (IDEA's "JDK for importer"); empty = the project JDK when new enough,
* else the first installed one that is.
*/
jdtlsJdk?: string,
/**
* Extra JVM options for the Java language server (jdtls), space-separated
* (VS Code's `java.jdt.ls.vmargs`).
*/
jdtlsVmArgs?: string,
/** Build Tools › Maven. */
maven?: MavenSettings,
/** Build Tools › Gradle. */
gradle?: GradleSettings,
};
/** Java versions a vendor publishes. */
export type JdkReleases = {
/** Feature versions, newest first. */
versions: number[],
/** The long-term-support ones among them. */
lts: number[],
/** The version offered first (the newest LTS). */
recommended: number,
};
/** A JDK distribution the IDE can download. */
export type JdkVendor = {
id: string,
name: string,
};
export type JvmFilePresentation = {
path: string,
presentation: JvmPresentation,
};
export type JvmPresentation = {
kind: JvmTypeKind | null,
springBoot: boolean,
runnable: boolean,
};
export type JvmTypeKind = "class" | "abstractClass" | "interface" | "enum" | "record" | "annotation" | "exception" | "object";
/** Editor › Code Style › <Language> › Tabs and Indents (unset fields inherit). */
export type LanguageCodeStyle = LanguageCodeStyle_Serialize | LanguageCodeStyle_Deserialize;
/** Editor › Code Style › <Language> › Tabs and Indents (unset fields inherit). */
export type LanguageCodeStyle_Deserialize = {
/** Java formatter: `default` | `intellij` | `custom` (other languages ignore it). */
formatter?: string | null,
/** Eclipse formatter XML; relative paths start at the project root. */
formatterPath?: string | null,
useTab?: boolean | null,
tabSize?: number | null,
indent?: number | null,
hardWrapAt?: number | null,
/** Comment Code › Line comment at first column. */
lineCommentAtFirstColumn?: boolean | null,
/** Comment Code › Add a space at line comment start. */
lineCommentAddSpace?: boolean | null,
};
/** Editor › Code Style › <Language> › Tabs and Indents (unset fields inherit). */
export type LanguageCodeStyle_Serialize = {
/** Java formatter: `default` | `intellij` | `custom` (other languages ignore it). */
formatter?: string | null,
/** Eclipse formatter XML; relative paths start at the project root. */
formatterPath?: string | null,
useTab?: boolean | null,
tabSize?: number | null,
indent?: number | null,
hardWrapAt?: number | null,
/** Comment Code › Line comment at first column. */
lineCommentAtFirstColumn?: boolean | null,
/** Comment Code › Add a space at line comment start. */
lineCommentAddSpace?: boolean | null,
};
/** Language identifier, e.g. `rust`, `typescript`, `kotlin`. Matches LSP `languageId`. */
export type LanguageId = string;
/** The UI-facing view of a language. */
export type LanguageInfo = LanguageInfo_Serialize | LanguageInfo_Deserialize;
/** The UI-facing view of a language. */
export type LanguageInfo_Deserialize = {
id: LanguageId,
name: string,
extensions: string[],
uiMode: string | null,
lineComment: string | null,
blockComment: [string, string] | null,
indent: IndentConfig_Deserialize | null,
/** A debug adapter is configured (breakpoints make sense in these files). */
debuggable?: boolean,
/** Names of the configured language servers (Settings › Inspections). */
languageServers?: string[],
/** Exact file names and file-name patterns of the definition (Settings › File Types). */
filenames?: string[],
/** First-line regex of the definition (shebangs, `<?php`). */
firstLine?: string | null,
};
/** The UI-facing view of a language. */
export type LanguageInfo_Serialize = {
id: LanguageId,
name: string,
extensions: string[],
uiMode: string | null,
lineComment: string | null,
blockComment: [string, string] | null,
indent: IndentConfig_Serialize | null,
/** A debug adapter is configured (breakpoints make sense in these files). */
debuggable?: boolean,
/** Names of the configured language servers (Settings › Inspections). */
languageServers?: string[],
/** Exact file names and file-name patterns of the definition (Settings › File Types). */
filenames?: string[],
/** First-line regex of the definition (shebangs, `<?php`). */
firstLine?: string | null,
};
export type LanguageServerSettings = LanguageServerSettings_Serialize | LanguageServerSettings_Deserialize;
export type LanguageServerSettings_Deserialize = {
/** `false` keeps the server from starting for any language. */
enabled?: boolean,
/**
* Executable to launch instead of the definition's; required for a server
* defined here (one with `languages`).
*/
command?: string,
/** Replaces the definition's arguments. */
args?: string[] | null,
/** Added to the server's environment. */
env?: { [key in string]: string },
/** Merged over the definition's `initializationOptions` (sent once at startup). */
initializationOptions?: unknown | null,
/**
* Answers the server's `workspace/configuration` requests; changes are pushed
* with `workspace/didChangeConfiguration` without a restart.
*/
settings?: unknown | null,
/**
* Language ids a server defined here serves (`python`); empty for the servers
* of the language definitions.
*/
languages?: string[],
/** Files marking a workspace root for a server defined here (`pyproject.toml`). */
rootMarkers?: string[],
};
export type LanguageServerSettings_Serialize = {
/** `false` keeps the server from starting for any language. */
enabled: boolean,
/**
* Executable to launch instead of the definition's; required for a server
* defined here (one with `languages`).
*/
command: string,
/** Replaces the definition's arguments. */
args?: string[] | null,
/** Added to the server's environment. */
env: { [key in string]: string },
/** Merged over the definition's `initializationOptions` (sent once at startup). */
initializationOptions?: unknown | null,
/**
* Answers the server's `workspace/configuration` requests; changes are pushed
* with `workspace/didChangeConfiguration` without a restart.
*/
settings?: unknown | null,
/**
* Language ids a server defined here serves (`python`); empty for the servers
* of the language definitions.
*/
languages: string[],
/** Files marking a workspace root for a server defined here (`pyproject.toml`). */
rootMarkers: string[],
};
export type LanguagesSettings = {
python?: PythonSettings,
node?: NodeSettings,
rust?: RustSettings,
go?: GoSettings,
typescript?: TypeScriptSettings,
prettier?: PrettierSettings,
java?: JavaSettings,
};
/** What a freshly opened window should do once its frontend is up. */
export type Launch = {
/** Project folder to open. */
project: IpcPath | null,
/**
* Files to open in the editor: in `project` once it is open, else in this
* window's project or (without one) in LightEdit.
*/
files: IpcPath[],
/** Remote project to open (Remote Development). */
remote: RemoteLaunch | null,
/** Settings windows: the page to show. */
settingsPage: string | null,
/** Settings windows: edit the global layer only ("Settings for New Projects"). */
newProjects: boolean,
};
export type LaunchConfig = {
name: string,
/** DAP adapter name from `languages/*.toml` (or a built-in: codelldb, debugpy, js-debug, delve, netcoredbg). */
adapter: string,
/** `launch` or `attach`. */
request: string,
program: string | null,
args: string[],
cwd: IpcPath | null,
env: { [key in string]: string },
/**
* Adapter specific extra arguments as JSON text, merged into the launch request.
* A `"cargo": {"args": [...], "filter": {"name", "kind"}}` entry builds with cargo
* and launches the produced executable; `"debugServer": <port>` connects to an
* adapter already listening on that local port (e.g. java-debug inside jdtls)
* instead of starting one, `"debugServer": "host:port"` to one on another machine
* (`dlv --headless`, `debugpy --listen`).
*/
extraJson: string | null,
};
/** One SDK or library with its source folders (`< Python 3.12 (.venv) >`). */
export type LibraryGroup = {
/** Display name, e.g. `Python 3.12 (.venv)`. */
name: string,
/** `python` | `jdk` | `nodeModules` | `nodeCore` | `rust` | `cargo` | `go` | `goModules` | `maven` | `gradle`. */
kind: string,
roots: LibraryRoot[],
};
export type LibraryRoot = {
/**
* Folder name, e.g. `python3.12` or `site-packages`, the package (`serde 1.0.200`)
* or the archive (`src.zip`, `guava-33.0.0-jre-sources.jar`).
*/
name: string,
/** A folder, or an archive's root (`<archive>!`). */
path: IpcPath,
};
/** Coverage of one source line. */
export type LineCoverage = {
/** 0-based. */
line: number,
/** Execution count (JaCoCo: covered instructions); 0 = not covered. */
hits: number,
branchesTotal: number,
branchesCovered: number,
};
export type LineEnding = "lf" | "crLf" | "cr";
/** Line-level change against HEAD for editor gutter markers (0-based lines). */
export type LineHunk = {
kind: HunkKind,
start: number,
/** Lines in the current text (0 for pure deletions). */
lines: number,
oldStart: number,
oldLines: number,
/** Original text of the hunk, for the inline diff popup / rollback. */
oldText: string,
};
export type LineMatch = {
/** 0-based line. */
line: number,
/** Line text, truncated around the match for very long lines. */
text: string,
/** UTF-16 column ranges within `text`. */
ranges: ([number, number])[],
/** Column offset of `text` in the real line (non-zero when truncated). */
textOffset: number,
};
/** What a local definition declares (nvim-treesitter `@local.definition.<kind>`). */
export type LocalKind = "var" | "parameter" | "function" | "type" | "import" | "macro" | "label" |
/** Plain `@local.definition` or a kind without a better mapping. */
"other";
/** A variable / parameter / nested function defined in a function-level scope. */
export type LocalSymbol = {
name: string,
kind: LocalKind,
/** The declaring identifier. */
definition: Range,
/** The scope the definition belongs to (block, function, lambda, loop…). */
scope: Range,
/**
* Every other occurrence that resolves to this symbol (reads, writes and,
* in languages where assignment declares — Python, Ruby, PHP, Bash —
* re-assignments), document order, excluding `definition`.
*/
references: Range[],
/**
* The resolution is unambiguous. `false` when the scope declares the name
* more than once in a language where that is not plain shadowing (JS `var`
* re-declaration, broken Java…): references were split by position and
* callers should confirm before renaming.
*/
certain: boolean,
/** The other declarations of the same name in `scope` (empty when `certain`). */
conflicts: Range[],
};
/** Result of `locals(pos)`. */
export type Locals =
/** No identifier at the position. */
{ status: "noIdentifier" } | { status: "notLocal"; name: string; range: Range; reason: NotLocalReason } | { status: "local"; symbol: LocalSymbol };
/** One looked-up executable. */
export type LocatedTool = {
name: string,
/** Absolute path, `None` when not found. */
path: IpcPath | null,
/** `22.6.0`, `1.85.0-nightly`; only for tools whose version matters. */
version: string | null,
};
/** Executables found for "run this file", and where single files are compiled to. */
export type LocatedTools = {
tools: LocatedTool[],
compileDir: IpcPath,
};
/**
* A range inside a specific file, or inside a virtual document (library
* class contents, decompiled code…) that only a language server can provide.
*/
export type Location = {
/**
* File path; for virtual targets the URI itself (equal to `uri`), which
* the UI opens as a read-only virtual document.
*/
path: IpcPath,
range: Range,
/** Set for non-`file:` targets, e.g. `jdt://contents/…`. */
uri?: string | null,
};
export type LogLevel = "debug" | "info" | "warn" | "error";
export type LogLocation = {
dir: IpcPath,
/** Current log file, if one was written yet. */
file: IpcPath | null,
};
/** Order of the Git Log (Graph Options › Sort). */
export type LogOrder =
/** `--topo-order`: lines of history are not intermixed. */
"topo" |
/** `--date-order`: commit time, but never a parent before its children. */
"date";
export type LogQuery = {
branch: string | null,
path: IpcPath | null,
author: string | null,
text: string | null,
skip: number,
limit: number,
/**
* A revision range such as `@{u}..HEAD` (commits reachable from the right side but
* not the left). Takes precedence over `branch`.
*/
range?: string | null,
/** `text` is a regular expression (Log filter `.*`). */
textRegex?: boolean,
/** `text` matches case-sensitively (Log filter `Cc`). */
textMatchCase?: boolean,
/** More starting revisions next to `branch` (Log Branch filter with several branches). */
branches?: string[],
/** More author needles next to `author`; a commit matches any of them (Log User filter). */
authors?: string[],
order?: LogOrder,
/** Follow only the first parent of merges (`--first-parent`). */
firstParent?: boolean,
/** Leave out merge commits (`--no-merges`); their children link to their parents. */
noMerges?: boolean,
/**
* Committer time bounds (epoch ms; `since` inclusive, `until` exclusive). Parents
* outside the range are rewritten to their nearest shown ancestors (or dropped when
* older), so the graph stays connected.
*/
sinceMs?: number | null,
untilMs?: number | null,
};
export type LspRefreshKind = "inlayHints" | "semanticTokens" | "codeLens";
/**
* Main toolbar entries per side, in order: title widget ids (`project`,
* `vcs.branch`…) or `action:<id>`. Widgets in neither list nor `hidden`
* (registered later) keep their default place.
*/
export type MainToolbarSettings = {
left?: string[],
right?: string[],
/** Widgets the user removed. */
hidden?: string[],
};
export type ManifestDependency = {
package: string,
requirement: string,
/** UTF-16 offsets of the string's contents (quotes excluded). */
from: number,
to: number,
};
export type Markup = {
/** `markdown` or `plaintext`. */
kind: string,
value: string,
};
export type MavenDependency = {
groupId: string,
artifactId: string,
version: string | null,
/** `jar`, `pom`, `test-jar`… */
type: string,
classifier: string | null,
scope: string,
optional: boolean,
/** Transitive dependencies (only after a sync). */
children: MavenDependency[],
/** Why Maven left this occurrence out of the resolved graph (`dependency:tree -Dverbose`). */
omitted?: Omission | null,
/** The version that won when `omitted` is `Conflict`. */
conflictWith?: string | null,
/** The version requested before `<dependencyManagement>` replaced it. */
managedFrom?: string | null,
};
export type MavenModel = {
/** Pre-order: every aggregator comes before its modules. */
projects: MavenProject[],
/** Profiles declared by any project, first declaration wins. */
profiles: MavenProfile[],
/** When the effective build was last read (Unix ms); `None` = only the static POM parse. */
syncedAt: number | null,
/** Build files changed since that sync. */
stale: boolean,
syncError: string | null,
};
export type MavenPlugin = {
groupId: string,
artifactId: string,
version: string | null,
/** Goal prefix (`clean`, `spring-boot`): goals run as `<prefix>:<goal>`. */
prefix: string,
/** Sorted goal names. */
goals: string[],
};
export type MavenProfile = {
id: string,
activeByDefault: boolean,
};
export type MavenProject = {
/** Project-relative, `/`-separated (`pom.xml`, `core/pom.xml`). */
pom: string,
/** Project-relative directory; `""` = the project root. */
dir: string,
groupId: string,
artifactId: string,
version: string,
packaging: string,
/** `<name>` (resolved), else the artifactId. */
displayName: string,
/** `groupId:artifactId:version` of the parent POM. */
parent: string | null,
/** `pom` paths of this aggregator's modules. */
modules: string[],
/** Listed as a module of another project here. */
aggregated: boolean,
plugins: MavenPlugin[],
dependencies: MavenDependency[],
/** Profile ids declared in this POM. */
profiles: string[],
/** Java feature version the project compiles for (`maven.compiler.release`, `java.version`…). */
javaVersion: number | null,
/** Maven launcher: the nearest `mvnw` up to the project root (absolute), else `mvn`. */
command: string,
/** Options before the goals (`-s`, `-Dmaven.repo.local=`); filled in by the shell from settings. */
options: string[],
/** Environment for runs (`JAVA_HOME` of the matching JDK); filled in by the shell. */
env: { [key in string]: string },
};
/** Build Tools › Maven. */
export type MavenSettings = {
/** Project-relative root POMs removed from the Maven project model. */
unlinkedProjects?: string[],
/** Maven home (or its `mvn` executable); empty = the project's `mvnw`, else `mvn` on `PATH`. */
home?: string,
/** User `settings.xml` (`-s`); empty = `~/.m2/settings.xml`. */
userSettings?: string,
/** Local repository (`-Dmaven.repo.local`); empty = from `settings.xml`. */
localRepository?: string,
};
export type MemoryCategory =
/** The backend and its WebView processes. */
"app" | "languageServer" |
/** Debug adapters, Run processes, terminal shells and other children. */
"process";
/** Localised labels and displayed shortcuts, pushed by the frontend. */
export type MenuConfig = {
locale: string,
/** `menu.<id>` → label (ids of submenus, actions and `native.*` roles). */
labels: { [key in string]: string },
/** Action id → display shortcut from the JS keymap, e.g. `⇧⌘O`. */
shortcuts: { [key in string]: string },
/** [`Entry::Dynamic`] slot → its items, already localised. */
dynamic?: { [key in string]: DynamicItem[] },
};
/**
* A menu entry for a menu bar drawn by the frontend (Windows title bar).
* Labels are the English defaults; the frontend localises them like the native menu.
*/
export type MenuNode = { kind: "submenu"; id: string; label: string; children: MenuNode[] } |
/** Runs `id` with `arg`. Items with an `arg` (Open Recent) carry their final label. */
{ kind: "action"; id: string; label: string; hint: string | null; arg: string | null } |
/** A disabled placeholder such as "No Recent Projects". */
{ kind: "placeholder"; id: string; label: string } | { kind: "separator" };
/** Merge dialog › Modify options (shared by the Pull dialog). */
export type MergeOptions = {
noFf?: boolean,
ffOnly?: boolean,
squash?: boolean,
noCommit?: boolean,
/** `-m`: message of the merge commit (Merge dialog only). */
message?: string | null,
};
/**
* Who stands on each side of the conflicts of the operation in progress (merge editor
* titles, as IDEA labels them).
*/
export type MergeSides = {
/** `merge`, `rebase`, `cherry-pick`, `revert`…; `None` outside an operation. */
operation: string | null,
/**
* Git's "ours" is not the user's work: during a rebase stage 2 holds the commits
* rebased onto and stage 3 the user's commit being replayed. [`MergeVersions`] is
* already swapped; conflict markers in the file are not.
*/
reversed: boolean,
/** The current branch (for a rebase: the branch being rebased). */
branch: string | null,
/**
* Short id of the commit being applied (REBASE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD)
* or merged (MERGE_HEAD).
*/
commit: string | null,
/** The other branch: the one being merged, or the one rebased onto. */
otherBranch: string | null,
};
/** The versions of a conflicted file as the merge editor shows them. */
export type MergeVersions = {
base: string | null,
/** The user's side ("Accept Yours"): git's stage 2, or stage 3 when `sides.reversed`. */
ours: string | null,
theirs: string | null,
sides: MergeSides,
/**
* Three-way merge of the versions above: non-conflicting changes merged, each
* conflict left as a diff3 block (yours / base / theirs). `None` when a side is
* missing (deleted on one side).
*/
merged: string | null,
};
/** Per-function totals (a recursive function's samples count once in `total`). */
export type MethodStat = {
frame: number,
selfWeight: number | null,
total: number | null,
};
export type NewAgentTask = {
/** Validated by the host; defaults to the window project root. */
projectRoot?: IpcPath | null,
prompt: AgentPrompt,
provider: string,
/** Settings for the new session (model, mode…). */
config: AgentConfigChoice[],
isolation: Isolation,
/** Branch to start the worktree from; the current branch when `None`. */
base: string | null,
};
/** Result of `node_at`: the smallest named node covering a range, with its ancestors. */
export type NodeAt = {
node: SyntaxNode,
/** Parent first, the root last. */
ancestors: SyntaxNode[],
};
export type NodeSettings = {
/** `node` executable; empty = the one on `PATH`. */
interpreter?: string,
/** `npm` | `pnpm` | `yarn`; empty = detect from the lock file / `packageManager`. */
packageManager?: string,
};
/** Why an identifier is not treated as a local. */
export type NotLocalReason =
/** Member position (`obj.name`, `name:` labels, `foo()` method names in Java…). */
"member" |
/**
* Declared at file / class / module level (fields, methods, top-level
* functions, imports): visible beyond the local scope.
*/
"topLevel" |
/**
* No definition in an enclosing local scope: global, import, inherited
* member, or declared in a way the query does not cover.
*/
"unresolved";
export type NotebookCell = {
id: string,
cellType: string,
source: string,
metadata: unknown,
outputs: unknown[],
executionCount: number | null,
attachments: unknown,
};
export type NotebookEdit = { type: "setSource"; cell: string; source: string } | { type: "insertCell"; after: string | null; cellType: string } | { type: "deleteCell"; cell: string } | { type: "moveCell"; cell: string; before: string | null } | { type: "setCellType"; cell: string; cellType: string } | { type: "setOutputs"; cell: string; outputs: unknown[]; executionCount: number | null };
export type NotebookOutputEvent = {
id: string,
path: string,
cell: string,
msgId: string,
kind: string,
content: unknown,
version: number,
dirty: boolean,
changedCells: string[],
};
export type NotebookSnapshot = {
id: string,
path: string,
version: number,
dirty: boolean,
canUndo: boolean,
canRedo: boolean,
nbformat: number,
nbformatMinor: number,
metadata: unknown,
cells: NotebookCell[],
};
export type NotificationGroupSettings = {
/** `balloon` | `sticky` | `none` */
display?: string,
/** Also list it in the Notifications tool window. */
log?: boolean,
};
export type NotificationLevel = "info" | "warning" | "error";
/** Notifications page: global switches and the per-group display type. */
export type NotificationSettings = {
balloons?: boolean,
sound?: boolean,
/** Group id → display; groups not listed use their default. */
groups?: { [key in string]: NotificationGroupSettings },
};
export type NotifyLevel = "info" | "warning" | "error";
/** Why a dependency occurrence is not part of the resolved graph. */
export type Omission =
/** Another occurrence of the same version is nearer the root. */
"duplicate" |
/** Another version is nearer the root (or declared first) and wins. */
"conflict" |
/** The artifact depends on itself through this path. */
"cycle";
/** How `open_project_window` satisfied the request. */
export type OpenOutcome =
/** Already open in `label`; that window was focused. */
{ kind: "focused"; label: string } |
/** A new window `label` was created and opens the project itself. */
{ kind: "opened"; label: string } |
/** The caller should open the project in its own window. */
{ kind: "current" };
export type OpenProject = {
name: string,
root: string,
/** Open in the calling window. */
current: boolean,
};
/** A node of a document outline (Structure tool window, breadcrumbs). */
export type OutlineItem = {
name: string,
detail: string | null,
kind: SymbolKind,
/** Whole extent of the symbol. */
range: Range,
/** The identifier itself; where navigation lands. */
selection_range: Range,
children: OutlineItem[],
/** Unknown (`None`) for language-server symbols and languages without the notion. */
visibility?: Visibility | null,
};
export type OutputChunk = { kind: "stdout"; text: string } | { kind: "stderr"; text: string } |
/** System message from the IDE (command line echo, exit code). */
{ kind: "system"; text: string };
/** A file of a partial commit: which of its changes against HEAD to commit. */
export type PartialCommitFile = {
path: IpcPath,
/** The hunks to commit, as [`diff_hunks`] of the HEAD and on-disk texts reports them. */
hunks: HunkRange[],
};
/** One file of a patch (Apply Patch preview). */
export type PatchFile = {
/** Path relative to the repository root (after the change). */
path: string,
oldPath: string | null,
kind: ChangeKind,
added: number,
removed: number,
binary: boolean,
/** Applies cleanly to the working tree (otherwise a 3-way merge is attempted). */
applies: boolean,
};
export type PatchSource =
/** Local changes of these files (absolute paths). */
{ from: "changes"; paths: IpcPath[]; reverse: boolean } |
/** Changes made by these commits (oldest first). */
{ from: "commits"; commits: string[]; reverse: boolean };
/** An entry offered when completing a path. */
export type PathCompletion = {
name: string,
dir: boolean,
};
/** Capabilities a plugin must declare to use the gated host functions. */
export type Permission =
/** `workspace-root`, `read-file` (inside the project root only). */
"project-read" |
/** `active-file`. */
"editor-read" |
/** `insert-text`, `replace-selection`. */
"editor-write";
/** Backend → UI notifications (Tauri event `ide://plugin`). */
export type PluginEvent =
/** Plugins, their status or their commands changed: re-fetch `plugin_list`. */
{ type: "commandsChanged" } | { type: "notification"; pluginId: string; level: NotificationLevel; title: string; body: string } | { type: "insertText"; pluginId: string; text: string } | { type: "replaceSelection"; pluginId: string; text: string } | { type: "themeChanged"; theme: ActiveTheme | null };
export type PluginInfo = {
id: string,
name: string,
version: string,
description: string,
authors: string[],
homepage: string | null,
changeNotes: string | null,
source: PluginSource,
/** Package directory. */
path: IpcPath,
enabled: boolean,
status: PluginStatus,
error: string | null,
hasCode: boolean,
permissions: Permission[],
/** Commands contributed while enabled (manifest + registered at runtime). */
commands: CommandDecl[],
languages: PluginLanguage[],
themes: PluginTheme[],
};
export type PluginLanguage = {
id: string,
name: string,
extensions: string[],
};
export type PluginSource =
/** Installed under `<app-data>/plugins/<id>/`. */
"installed" |
/** Loaded from `<project>/.openidea/plugins/<dir>/` while that project is open. */
"dev";
export type PluginStatus =
/** Code loaded and activated. */
"active" |
/** No code; static contributions only. */
"static" | "disabled" |
/** Failed to load, or trapped and was disabled for this session (see `error`). */
"failed";
export type PluginTheme = {
id: string,
name: string,
kind: ThemeKind,
};
export type PluginsSnapshot = {
plugins: PluginInfo[],
activeTheme: ActiveTheme | null,
};
/** A 0-based line / UTF-16 column position. */
export type Pos = {
line: number,
col: number,
};
export type PrCheck = {
name: string,
/** Workflow of a check run (GitHub Actions), if any. */
workflow: string | null,
status: CheckStatus,
url: string | null,
};
export type PrCommit = {
oid: string,
headline: string,
body: string,
author: string,
date: string,
};
/** Revisions to diff a pull request's files with, present in the local repository. */
export type PrDiffRevisions = {
/** Merge base of base and head (what GitHub's "Files changed" compares with). */
base: string,
head: string,
/** Changed files with rename information. */
files: ChangedFile[],
/** Worktree root the file paths are relative to. */
root: IpcPath,
};
export type PrFile = {
path: string,
additions: number,
deletions: number,
/** `ADDED`, `MODIFIED`, `DELETED`, `RENAMED`, `COPIED`, `CHANGED`. */
changeType: string,
};
export type PrLabel = {
name: string,
/** Hex colour without `#`, as GitHub stores it. */
color: string,
};
export type PrListQuery = {
state: PrStateFilter,
authorMe: boolean,
reviewRequested: boolean,
assigneeMe: boolean,
/** Free text / GitHub search qualifiers. */
search: string,
limit: number,
};
/** An inline review comment on a diff line. */
export type PrReviewComment = {
id: number,
inReplyTo: number | null,
path: string,
/** 1-based line in the current diff; `None` when the comment is outdated. */
line: number | null,
originalLine: number | null,
/** `LEFT` (base) or `RIGHT` (head). */
side: string,
body: string,
author: string,
createdAt: string,
url: string,
diffHunk: string,
};
export type PrReviewer = {
login: string,
/** `APPROVED`, `CHANGES_REQUESTED`, `COMMENTED`, `DISMISSED`, or `REQUESTED` (no review yet). */
state: string,
};
export type PrState = "open" | "closed" | "merged";
export type PrStateFilter = "open" | "closed" | "merged" | "all";
/** A conversation comment or a submitted review (the timeline). */
export type PrTimelineItem = {
author: string,
body: string,
createdAt: string,
/** `None` for comments; the review state for reviews. */
reviewState: string | null,
url: string | null,
};
/** A request ready to send: variables substituted, includes read. */
export type PreparedRequest = {
name: string | null,
method: string,
url: string,
headers: ([string, string])[],
body: string | null,
};
export type PrettierSettings = {
/** Empty path: project node_modules, managed installation, then PATH. */
path?: string,
languages?: string[],
/** Prefer Prettier even when a language server offers formatting. */
prefer?: boolean,
runOnSave?: boolean,
};
/** Memory of one row of the breakdown. */
export type ProcessMemory = {
category: MemoryCategory,
label: string,
/** Project, run kind or similar. */
detail: string | null,
/** Number of processes counted in this row. */
processes: number,
bytes: number | null,
};
export type Profile = {
/** `node --cpu-prof`, `py-spy`, `async-profiler`, `perf`. */
profiler: string,
/** `ms` (time-weighted) or `samples`. */
unit: string,
total: number | null,
frames: ProfileFrame[],
/** Depth-first; `nodes[0]` is the root. */
nodes: ProfileNode[],
/** Sorted by self weight, heaviest first. */
methods: MethodStat[],
};
export type ProfileFrame = {
name: string,
file: IpcPath | null,
/** 0-based. */
line: number | null,
};
/** A call-tree node; node 0 is the synthetic root (`all`). */
export type ProfileNode = {
/** Index into [`Profile::frames`]. */
frame: number,
/** Weight of this node and everything it called. */
total: number | null,
/** Weight sampled in this node itself. */
selfWeight: number | null,
/** Indices into [`Profile::nodes`], heaviest first. */
children: number[],
};
export type ProfilePrepared = ProfilePrepared_Serialize | ProfilePrepared_Deserialize;
export type ProfilePrepared_Deserialize = ({ status: "ready"; profiler: string; launch: RunConfig_Deserialize; spec: ProfileSpec }) & { homepage?: never; install?: never; message?: never; reason?: never; tool?: never } | ({ status: "missingTool"; tool: string; message: string; install: ProfilerInstall | null; homepage: string | null }) & { launch?: never; profiler?: never; reason?: never; spec?: never } | ({ status: "unsupported"; reason: string }) & { homepage?: never; install?: never; launch?: never; message?: never; profiler?: never; spec?: never; tool?: never };
export type ProfilePrepared_Serialize = ({ status: "ready"; profiler: string; launch: RunConfig_Serialize; spec: ProfileSpec }) & { homepage?: never; install?: never; message?: never; reason?: never; tool?: never } | ({ status: "missingTool"; tool: string; message: string; install: ProfilerInstall | null; homepage: string | null }) & { launch?: never; profiler?: never; reason?: never; spec?: never } | ({ status: "unsupported"; reason: string }) & { homepage?: never; install?: never; launch?: never; message?: never; profiler?: never; spec?: never; tool?: never };
/** Where a prepared run's profile will be, and how to read it. */
export type ProfileSpec =
/**
* Every `*.cpuprofile` in `dir` (one per Node.js process). Processes that
* ran no code of `root` (the package manager of an npm script) are left
* out when another one did.
*/
{ kind: "cpuProfiles"; dir: IpcPath; root: IpcPath } |
/**
* Collapsed-stack files with extension `ext` in `dir`; relative frame files resolve
* against `base`. `jvm_root`: map JVM class frames to sources below it.
*/
{ kind: "folded"; profiler: string; dir: IpcPath; ext: string; base: IpcPath; jvmRoot: IpcPath | null } |
/** `perf script -i <data>` output. */
{ kind: "perf"; perf: string; data: IpcPath; cwd: IpcPath; env: { [key in string]: string } };
/** A command line that installs a missing profiler. */
export type ProfilerInstall = {
command: string,
args: string[],
cwd: IpcPath | null,
};
export type ProjectFileSet =
/** "Project Files": everything not excluded. */
"all" |
/** "Project Production Files": not under a test root and not a test file. */
"production" |
/** "Project Test Files". */
"test";
export type ProjectInfo = ProjectInfo_Serialize | ProjectInfo_Deserialize;
export type ProjectInfo_Deserialize = {
trusted: boolean,
root: IpcPath,
name: string,
isGit: boolean,
settings: Settings_Deserialize,
workspace?: Workspace_Deserialize | null,
};
export type ProjectInfo_Serialize = {
trusted: boolean,
root: IpcPath,
name: string,
isGit: boolean,
settings: Settings_Serialize,
workspace?: Workspace_Serialize | null,
};
export type ProjectRoots = {
/** Effective roots, sorted by path. */
roots: SourceFolder[],
/** Every auto-detected root, including ones the user overrode or unmarked. */
detected: SourceFolder[],
};
export type ProjectStructureSettings = {
/** Project-relative folders, `/`-separated. */
sourceRoots?: string[],
testRoots?: string[],
resourceRoots?: string[],
testResourceRoots?: string[],
/** Excluded from the project tree, search and indexing. */
excluded?: string[],
/** Auto-detected roots (from `pom.xml`, `build.gradle`, `Cargo.toml`, …) the user unmarked. */
unmarked?: string[],
/** Content roots besides the project folder (absolute paths), shown and searched with it. */
contentRoots?: string[],
/** "Exclude files": `;`-separated name patterns (`*.log;tmp*`) excluded at any depth. */
excludeFiles?: string,
};
export type ProxyKind = "http" | "socks";
export type ProxyMode =
/** Every connection goes direct. */
"none" |
/** The system's proxy: `HTTP_PROXY` / `HTTPS_PROXY` / `NO_PROXY` of the environment. */
"auto" |
/** The proxy configured here. */
"manual";
export type ProxySettings = {
mode?: ProxyMode,
kind?: ProxyKind,
host?: string,
port?: number,
/** Hosts reached directly, comma-separated; `*` matches any characters (`*.example.com`, `192.168.*`). */
noProxy?: string,
/** Send `login` / `password` to the proxy. */
authenticate?: boolean,
login?: string,
/** Kept in the saved passwords rather than `settings.toml`; filled in when settings are read. */
password?: string,
};
export type PruneTarget = "containers" |
/** Dangling images only. */
"images" |
/** Every image no container uses. */
"allImages" | "volumes" | "networks" |
/** Stopped containers, unused networks, dangling images and build cache. */
"system";
export type PullRequestDetails = {
summary: PullRequestSummary,
body: string,
headOid: string,
baseOid: string,
/** `MERGEABLE`, `CONFLICTING`, `UNKNOWN`. */
mergeable: string,
/** GitHub's merge box state: `CLEAN`, `UNSTABLE`, `HAS_HOOKS`, `BLOCKED`, `BEHIND`, `DIRTY`, `DRAFT`, `UNKNOWN`. */
mergeStateStatus: string,
isCrossRepository: boolean,
mergedAt: string | null,
closedAt: string | null,
checks: PrCheck[],
reviewers: PrReviewer[],
assignees: string[],
commits: PrCommit[],
files: PrFile[],
/** Comments and reviews, oldest first. */
timeline: PrTimelineItem[],
};
export type PullRequestSummary = {
number: number,
title: string,
author: string,
state: PrState,
isDraft: boolean,
headRef: string,
baseRef: string,
createdAt: string,
updatedAt: string,
labels: PrLabel[],
/** `APPROVED`, `CHANGES_REQUESTED`, `REVIEW_REQUIRED`, or `None`. */
reviewDecision: string | null,
url: string,
additions: number,
deletions: number,
};
/** Push dialog › Push tags: every tag, or only annotated tags on the pushed commits. */
export type PushTags = "all" | "currentBranch";
/** Python Debugger (debugpy launch options). */
export type PythonDebuggerSettings = {
attachSubprocess?: boolean,
gevent?: boolean,
};
export type PythonPackage = {
name: string,
version: string,
};
export type PythonSettings = {
/** Project interpreter executable; empty = auto-detect (project venv, else `python3`). */
interpreter?: string,
/** Activate the interpreter's virtualenv in new terminal sessions. */
activateVirtualenv?: boolean,
};
/** Half-open range `[start, end)`. */
export type Range = {
start: Pos,
end: Pos,
};
/** What an interactive rebase does with one commit. */
export type RebaseAction = "pick" |
/** Pick with a new message ([`RebaseEntry::message`]). */
"reword" |
/** Stop after applying, to amend it (Stop to Edit). */
"edit" |
/** Meld into the previous commit, combining the messages. */
"squash" |
/** Meld into the previous commit, keeping the previous message. */
"fixup" | "drop";
/** One line of an interactive rebase plan. */
export type RebaseEntry = {
commit: string,
action: RebaseAction,
/** New message for a reword, or for the result of a squash group (set on its last line). */
message?: string | null,
};
/** Rebase dialog options. */
export type RebaseOptions = {
/** `--onto <newbase>`: replay `upstream..HEAD` onto this revision instead. */
onto?: string | null,
rebaseMerges?: boolean,
keepEmpty?: boolean,
};
export type RecentProject = {
path: IpcPath,
name: string,
openedAtMs: number | null,
/** Current git branch when last opened, shown on the welcome screen. */
branch: string | null,
};
export type ReferenceAccess = "read" | "write" | "readWrite" | "unknown";
export type ReferenceKind = "getter" | "setter" | "field" | "unknown";
export type References = {
/** Semantic classifications supplied by a language extension. Missing entries are unknown. */
classified?: ClassifiedReference[],
locations: Location[],
incomplete: ReferencesIncomplete | null,
};
/** Why a references search may have missed usages. */
export type ReferencesIncomplete =
/** A language server was still indexing. */
"indexing" |
/** More project files mention the name than were checked. */
"tooManyFiles" |
/** Files that mention the name were too large or unreadable to check. */
"filesSkipped";
/** A registry agent this machine can run (or has installed). */
export type RegistryAgent = {
id: string,
name: string,
/** The registry's current version. */
version: string,
description: string,
repository: string | null,
website: string | null,
authors: string[],
license: string | null,
/**
* How it installs here; `None` when it no longer can (an installed agent whose
* runtime went away).
*/
distribution: RegistryDistribution | null,
/**
* The release archive comes without a SHA-256, so the download cannot be checked.
* npm and uv packages are checked by those tools.
*/
noChecksum: boolean,
/** The installed version. */
installed: string | null,
/** Whether [`Self::version`] is newer than the installed one. */
update: boolean,
};
export type RegistryDistribution =
/** A release archive for this OS and architecture. */
"binary" |
/** An npm package (needs Node.js). */
"npx" |
/** A Python package run by uv. */
"uvx";
export type Remote = {
name: string,
/** Fetch URL. */
url: string,
};
/** Manage Remotes edits. */
export type RemoteEdit = { op: "add"; name: string; url: string } | { op: "remove"; name: string } |
/** Renames `name` to `new_name` (when different) and sets its URL. */
{ op: "edit"; name: string; new_name: string; url: string };
/** A remote directory entry. */
export type RemoteEntry = {
name: string,
/** Absolute remote path. */
path: string,
isDir: boolean,
isSymlink: boolean,
size: number,
/** Seconds since the Unix epoch. */
mtime: number | null,
/** `rwxr-xr-x`. */
permissions: string,
};
/** A project folder on the host of an SSH configuration. */
export type RemoteLaunch = {
sshConfig: string,
path: string,
};
export type RemoteOp = { op: "fetch" } | { op: "pull"; rebase: boolean } | { op: "push"; force_with_lease: boolean; set_upstream: boolean;
/** Push dialog › Push tags. */
tags?: PushTags | null } |
/** Deletes a remote branch; `branch` is the remote-tracking name (`origin/feature`). */
{ op: "deleteBranch"; branch: string } |
/**
* Pushes local `branch` (only up to `revision` when set) to its upstream, or to
* remote branch `target`; `remote` overrides the upstream's remote (Push dialog's
* remote picker).
*/
{ op: "pushBranch"; branch: string; revision: string | null; force_with_lease: boolean; target?: string | null; remote?: string | null } |
/** Fast-forwards local `branch` (not checked out) to its upstream. */
{ op: "updateBranch"; branch: string } |
/** Pull dialog: `branches` of `remote` (none = the configured merge branch). */
{ op: "pullFrom"; remote: string; branches: string[]; rebase: boolean; options: MergeOptions };
export type RemoteProgress = {
stage: RemoteStage,
fraction: number | null,
};
export type RemoteProject = RemoteProject_Serialize | RemoteProject_Deserialize;
export type RemoteProject_Deserialize = {
sshConfig: string,
root: string,
/** `user@host:port` of the SSH configuration. */
host: string,
serverVersion: string,
os: string,
/** Commands the server answers (the rest run locally). */
commands: string[],
project: ProjectInfo_Deserialize,
};
export type RemoteProject_Serialize = {
sshConfig: string,
root: string,
/** `user@host:port` of the SSH configuration. */
host: string,
serverVersion: string,
os: string,
/** Commands the server answers (the rest run locally). */
commands: string[],
project: ProjectInfo_Serialize,
};
export type RemoteSession = {
sshConfig: string,
root: string,
host: string,
commands: string[],
};
/** Where [`remote_connect`] is (`fraction`: 0..1 of a download / upload). */
export type RemoteStage = "connecting" | "checking" | "downloading" | "uploading" | "starting" | "opening";
export type Renamed = {
edit: WorkspaceEdit,
incomplete: ReferencesIncomplete | null,
};
export type ReplaceEvent =
/** A file was changed (`replacements` > 0) or had nothing left to replace. */
{ type: "file"; path: IpcPath; replacements: number; done: number; total: number } | { type: "failed"; path: IpcPath; message: string; done: number; total: number } | { type: "done"; summary: ReplaceSummary };
/** Before / after text of one file for the Replace preview. */
export type ReplacePreview = {
before: string,
after: string,
edits: TextEdit[],
};
export type ReplaceSummary = {
/** Files actually changed. */
files: number,
replacements: number,
failed: number,
cancelled: boolean,
elapsedMs: number,
};
/** One file to replace in. */
export type ReplaceTarget = {
path: IpcPath,
/**
* Start positions (0-based line, UTF-16 column) of the matches to replace,
* as reported by the search; `None` replaces every match in the file.
* Positions where no match starts any more are skipped.
*/
only?: Pos[] | null,
};
export type RepositoryComparison = {
root: IpcPath,
/** Resolved commit, so opening a diff later uses the same left side as the listing. */
revision: string | null,
files: WorkingTreeChange[],
error: string | null,
/** The requested revision does not resolve to a commit in this repository. */
missingRevision?: boolean,
};
/** A cancellable, streaming backend request issued by the UI. */
export type RequestId = number;
/** `git reset` modes offered by Reset Current Branch to Here. */
export type ResetMode = "soft" | "mixed" | "hard" | "keep";
export type ReviewEvent = "approve" | "requestChanges" | "comment";
/** A file changed across several commits: its content at `before` ↔ at `after`. */
export type RevisionChange = {
/** Repository-relative path after the change (before it, for a deletion). */
path: string,
kind: ChangeKind,
/** Path at `before`, for a rename. */
oldPath: string | null,
/** Commit holding the old content; `None` when the file was added. */
before: string | null,
/** Commit holding the new content; `None` when the file was deleted. */
after: string | null,
};
export type RootKind = "source" | "test" | "resources" | "testResources" | "excluded";
export type RunConfig = RunConfig_Serialize | RunConfig_Deserialize;
export type RunConfig_Deserialize = {
/** Stable id, e.g. `npm:dev`, `cargo:run:app`, or a uuid for user-defined. */
id: string,
name: string,
/** `npm` | `cargo` | `gradle` | `maven` | `go` | `python` | `pytest` | `make` | `shell` … */
kind: string,
command: string,
args: string[],
cwd: IpcPath | null,
env: { [key in string]: string },
/** Detected configs are regenerated; user configs persist in `.openidea/run.toml`. */
detected: boolean,
/** Test runner configs render results in the test tree. */
isTest: boolean,
/** DAP adapter that can debug this config, if any. */
debugAdapter: string | null,
/** "Allow multiple instances": Run on a running config starts another one instead of restarting it. */
allowParallel?: boolean,
} & RunExtras_Deserialize;
export type RunConfig_Serialize = {
/** Stable id, e.g. `npm:dev`, `cargo:run:app`, or a uuid for user-defined. */
id: string,
name: string,
/** `npm` | `cargo` | `gradle` | `maven` | `go` | `python` | `pytest` | `make` | `shell` … */
kind: string,
command: string,
args: string[],
cwd: IpcPath | null,
env: { [key in string]: string },
/** Detected configs are regenerated; user configs persist in `.openidea/run.toml`. */
detected: boolean,
/** Test runner configs render results in the test tree. */
isTest: boolean,
/** DAP adapter that can debug this config, if any. */
debugAdapter: string | null,
/** "Allow multiple instances": Run on a running config starts another one instead of restarting it. */
allowParallel?: boolean,
} & RunExtras_Serialize;
export type RunExtras = RunExtras_Serialize | RunExtras_Deserialize;
export type RunExtras_Deserialize = {
/** Module supplying a JVM application's classpath; empty means the project root. */
module?: string | null,
/** Values of the configuration type's own form fields (the command line derives from them). */
params?: { [key in string]: string },
/** Folder in the Run/Debug Configurations tree. */
folder?: string | null,
/** Stored in the workspace (`.openidea/run.local.toml`, not shared) instead of `run.toml`. */
local?: boolean,
/** Off: the process gets only the configured variables. */
includeSystemEnv?: boolean,
/** `.env` files (relative to the project root) loaded before `env`, in order. */
envFiles?: string[],
/** "Redirect input from": the process reads this file as stdin. */
stdinFile?: string | null,
/** "Save console output to file" (overwritten on each run). */
outputFile?: string | null,
beforeLaunch?: BeforeLaunchTask[],
/** Compound configurations: ids of the configurations started together. */
compound?: string[],
showOnStdout?: boolean,
showOnStderr?: boolean,
/** Overrides Settings › Run › "Show the Run tool window when a process starts". */
openToolWindow?: boolean | null,
focusToolWindow?: boolean,
/**
* "Emulate terminal in output console": the process runs on a pseudo-terminal
* (colours, line editing, full-screen programs); the console renders it as a terminal.
*/
emulateTerminal?: boolean,
/**
* Shell command line run on Stop before the process is signalled (e.g. `docker stop <name>`),
* with the run's working directory and environment.
*/
stopCommand?: string | null,
/** Settings › Run Targets id the process runs on (over SSH); `None` = this machine. */
target?: string | null,
};
export type RunExtras_Serialize = {
/** Module supplying a JVM application's classpath; empty means the project root. */
module?: string | null,
/** Values of the configuration type's own form fields (the command line derives from them). */
params?: { [key in string]: string },
/** Folder in the Run/Debug Configurations tree. */
folder?: string | null,
/** Stored in the workspace (`.openidea/run.local.toml`, not shared) instead of `run.toml`. */
local?: boolean,
/** Off: the process gets only the configured variables. */
includeSystemEnv?: boolean,
/** `.env` files (relative to the project root) loaded before `env`, in order. */
envFiles?: string[],
/** "Redirect input from": the process reads this file as stdin. */
stdinFile?: string | null,
/** "Save console output to file" (overwritten on each run). */
outputFile?: string | null,
beforeLaunch?: BeforeLaunchTask[],
/** Compound configurations: ids of the configurations started together. */
compound?: string[],
showOnStdout?: boolean,
showOnStderr?: boolean,
/** Overrides Settings › Run › "Show the Run tool window when a process starts". */
openToolWindow?: boolean | null,
focusToolWindow?: boolean,
/**
* "Emulate terminal in output console": the process runs on a pseudo-terminal
* (colours, line editing, full-screen programs); the console renders it as a terminal.
*/
emulateTerminal?: boolean,
/**
* Shell command line run on Stop before the process is signalled (e.g. `docker stop <name>`),
* with the run's working directory and environment.
*/
stopCommand?: string | null,
/** Settings › Run Targets id the process runs on (over SSH); `None` = this machine. */
target?: string | null,
};
/** A process started from a run configuration. */
export type RunId = number;
export type RunInfo = {
id: RunId,
configId: string,
name: string,
pid: number | null,
running: boolean,
/** Runs on a pseudo-terminal: output is raw terminal data, input goes in keystroke by keystroke. */
pty: boolean,
};
/** Run/Debug configuration behaviour. */
export type RunSettings = {
confirmRerun?: boolean,
/** Ask before closing a Run tab whose process is still running. */
confirmTerminate?: boolean,
showOnStart?: boolean,
/** Grace period between interrupt and kill when stopping a process. */
terminationTimeoutMs?: number,
};
/** Build, Execution, Deployment › Run Targets: run configurations on another machine. */
export type RunTarget = {
id?: string,
name?: string,
/** [`SshConfiguration::id`]. */
sshConfig?: string,
/** Remote folder the project is synchronised to and run from. */
projectRoot?: string,
/** Upload changed project files before each run. */
syncBeforeRun?: boolean,
/** Interpreters on the target; empty = the one on the remote `PATH`. */
python?: string,
node?: string,
java?: string,
};
export type RustSettings = {
/** Directory holding `cargo` / `rustc`; empty = `PATH` / rustup default. */
toolchain?: string,
/** Standard library sources (`RUST_SRC_PATH`); empty = from the toolchain. */
stdlib?: string,
/** Run the external linter on save (rust-analyzer `checkOnSave`). */
checkOnSave?: boolean,
/** `check` | `clippy` (rust-analyzer `check.command`). */
checkCommand?: string,
/** Extra arguments for rustfmt (rust-analyzer `rustfmt.extraArgs`), space-separated. */
rustfmtArgs?: string,
};
export type Scope = {
name: string,
variablesReference: number,
expensive: boolean,
};
/** One installed interpreter / toolchain. */
export type Sdk = {
/**
* Executable (`python`, `node`, `pnpm`) or directory (Rust toolchain bin
* dir, GOROOT, TypeScript `lib` dir) that the setting stores.
*/
path: IpcPath,
/** Display name, e.g. `Python 3.12 (.venv)` or `stable-aarch64-apple-darwin`. */
name: string,
version: string | null,
/**
* Where it was found: `venv` | `system` | `pyenv` | `conda` | `uv` | `nvm` |
* `rustup` | `bundled` | `workspace` | `path` …
*/
source: string,
/** Environment / toolchain root (virtualenv dir, rustup toolchain dir, GOROOT). */
home: IpcPath | null,
/** Rust standard library sources, Go default GOPATH. */
extra: IpcPath | null,
};
/** What [`detect`] looks for. */
export type SdkKind = "python" | "node" |
/** npm / pnpm / yarn executables. */
"packageManager" | "rust" | "go" | "typeScript" |
/** JDK homes. */
"jdk" |
/** Maven homes. */
"maven";
/**
* IDEA's search context: matches anywhere, only in, or outside comments and
* string literals. Files whose language has no syntax tree contain neither.
*/
export type SearchContext = "any" | "inComments" | "inStringLiterals" | "exceptComments" | "exceptStringLiterals" | "exceptCommentsAndStringLiterals";
export type SearchEvent = { type: "file"; file: FileMatches } | { type: "done"; summary: SearchSummary };
export type SearchQuery = {
pattern: string,
isRegex: boolean,
caseSensitive: boolean,
wholeWord: boolean,
/**
* File masks, e.g. `*.kt`, `src/**\/*.ts`; an entry may also be a
* comma-separated list where `!mask` excludes. Empty = all files.
*/
include: string[],
exclude: string[],
scope: SearchScope,
/** Stop after this many matches overall (0 = 10 000). */
maxMatches: number,
/** Where in the code a match may lie (IDEA's search context filter). */
context?: SearchContext,
};
export type SearchScope = { kind: "project" } | { kind: "directory"; path: IpcPath } | { kind: "files"; paths: IpcPath[] } |
/**
* IDEA's named scopes over the project's roots ("Project Production Files" …).
* Walks the project like `Project`; the caller passes the matching [`PathFilter`].
*/
{ kind: "fileSet"; set: ProjectFileSet } |
/**
* A custom scope: the project's files matching a [`ScopePattern`]
* (`file:src//*.ts&&!file:*test*`).
*/
{ kind: "pattern"; pattern: string };
export type SearchSummary = {
files: number,
matches: number,
limitHit: boolean,
cancelled: boolean,
elapsedMs: number,
};
/** Decoded semantic tokens (absolute positions) with the server legend applied. */
export type SemanticTokens = {
/** Flattened `[line, col, len, typeIdx, modifierBits]` quintuples (absolute). */
data: number[],
tokenTypes: string[],
tokenModifiers: string[],
};
/** A running language server instance. */
export type ServerId = number;
export type ServerInfo = {
id: ServerId,
name: string,
root: IpcPath,
languages: LanguageId[],
status: ServerStatus,
/** OS process of the running instance (for memory attribution). */
pid: number | null,
};
export type ServerStatus = "starting" | "ready" | "busy" | "crashed" | "stopped" | "missing" |
/**
* Not started: its configuration can't launch it (e.g. no JDK new enough);
* the message says what to change, and a settings change retries.
*/
"misconfigured";
/** Exception filters of one session (see [`DebugManager::exception_filters`]). */
export type SessionExceptionFilters = {
session: DebugSessionId,
adapter: string,
filters: ExceptionFilter[],
};
/** A live session, as listed by [`DebugManager::sessions`]. */
export type SessionInfo = {
id: DebugSessionId,
name: string,
adapter: string,
/** Set for child sessions started by the adapter (`startDebugging`). */
parent: DebugSessionId | null,
};
export type Settings = Settings_Serialize | Settings_Deserialize;
export type SettingsImport = SettingsImport_Serialize | SettingsImport_Deserialize;
export type SettingsImport_Deserialize = {
/** Effective settings of the calling window after the import. */
settings: Settings_Deserialize,
/** IDE state the frontend keeps (written back to its storage). */
storage: { [key in string]: string },
};
export type SettingsImport_Serialize = {
/** Effective settings of the calling window after the import. */
settings: Settings_Serialize,
/** IDE state the frontend keeps (written back to its storage). */
storage: { [key in string]: string },
};
export type SettingsScope = "global" | "project";
export type Settings_Deserialize = {
general?: GeneralSettings,
appearance?: AppearanceSettings,
editor?: EditorSettings_Deserialize,
keymap?: string,
files?: FileSettings,
/**
* Per-action keybinding overrides on top of the `keymap` preset: action id →
* bindings (`Meta+Shift+O`, chords space-separated). An empty list unbinds.
*/
keymapOverrides?: { [key in string]: string[] },
/**
* User keymaps (Keymap › Duplicate…): id → name, parent preset and the
* keymap's own overrides. `keymap` may name one of these ids.
*/
customKeymaps?: { [key in string]: CustomKeymap },
notifications?: NotificationSettings,
/** System Settings › HTTP Proxy (global only). */
proxy?: ProxySettings,
/** Interpreters / toolchains per language (Python, Node.js, Rust, Go, TypeScript). */
languages?: LanguagesSettings,
/** Project Structure: source / test / resource / excluded folders (project-relative). */
projectStructure?: ProjectStructureSettings,
/** Version Control (Git, Commit, Confirmation, Issue Navigation). */
vcs?: VcsSettings,
/** Build, Execution, Deployment › Console. */
console?: ConsoleSettings,
debugger?: DebuggerSettings,
run?: RunSettings,
/** Tools › Terminal. */
terminal?: TerminalSettings,
actionsOnSave?: ActionsOnSaveSettings,
externalTools?: ExternalTool[],
/**
* Language servers / debug adapters at a user-chosen location, by the
* command the language definition launches (`elixir-ls`, `codelldb`).
*/
tools?: { [key in string]: ToolSettings },
/**
* Per language server, by name (`rust-analyzer`): launch and protocol
* options on top of the language definition, or a server defined here.
*/
languageServers?: { [key in string]: LanguageServerSettings_Deserialize },
/** Editor › Inspections profiles. */
inspections?: InspectionSettings,
/** Editor › Natural Languages › Spelling. */
spelling?: SpellingSettings,
/** Tools › SSH Configurations. */
ssh?: SshSettings,
/** Build, Execution, Deployment › Deployment. */
deployment?: DeploymentSettings,
/** Build, Execution, Deployment › Run Targets. */
runTargets?: RunTarget[],
cmake?: CMakeSettings_Deserialize,
};
export type Settings_Serialize = {
general: GeneralSettings,
appearance: AppearanceSettings,
editor: EditorSettings_Serialize,
keymap: string,
files: FileSettings,
/**
* Per-action keybinding overrides on top of the `keymap` preset: action id →
* bindings (`Meta+Shift+O`, chords space-separated). An empty list unbinds.
*/
keymapOverrides: { [key in string]: string[] },
/**
* User keymaps (Keymap › Duplicate…): id → name, parent preset and the
* keymap's own overrides. `keymap` may name one of these ids.
*/
customKeymaps: { [key in string]: CustomKeymap },
notifications: NotificationSettings,
/** System Settings › HTTP Proxy (global only). */
proxy: ProxySettings,
/** Interpreters / toolchains per language (Python, Node.js, Rust, Go, TypeScript). */
languages: LanguagesSettings,
/** Project Structure: source / test / resource / excluded folders (project-relative). */
projectStructure: ProjectStructureSettings,
/** Version Control (Git, Commit, Confirmation, Issue Navigation). */
vcs: VcsSettings,
/** Build, Execution, Deployment › Console. */
console: ConsoleSettings,
debugger: DebuggerSettings,
run: RunSettings,
/** Tools › Terminal. */
terminal: TerminalSettings,
actionsOnSave: ActionsOnSaveSettings,
externalTools: ExternalTool[],
/**
* Language servers / debug adapters at a user-chosen location, by the
* command the language definition launches (`elixir-ls`, `codelldb`).
*/
tools: { [key in string]: ToolSettings },
/**
* Per language server, by name (`rust-analyzer`): launch and protocol
* options on top of the language definition, or a server defined here.
*/
languageServers: { [key in string]: LanguageServerSettings_Serialize },
/** Editor › Inspections profiles. */
inspections: InspectionSettings,
/** Editor › Natural Languages › Spelling. */
spelling: SpellingSettings,
/** Tools › SSH Configurations. */
ssh: SshSettings,
/** Build, Execution, Deployment › Deployment. */
deployment: DeploymentSettings,
/** Build, Execution, Deployment › Run Targets. */
runTargets: RunTarget[],
cmake: CMakeSettings_Serialize,
};
export type Severity = "error" | "warning" | "info" | "hint";
export type ShelfDiffFile = {
path: string,
patch: string,
before: string | null,
after: string | null,
};
/** Version Control › Shelf. */
export type ShelfSettings = {
/** Initial state of Unshelve's "Remove successfully applied files from the shelf". */
removeApplied?: boolean,
};
/** A change list on the shelf. */
export type ShelvedChangeList = {
/** Folder name under the shelf directory. */
id: string,
name: string,
timeMs: number | null,
/** Branch checked out when the changes were shelved. */
branch: string | null,
/** Repository-relative paths. */
files: ChangedFile[],
};
export type Signature = {
label: string,
documentation: Markup | null,
/** UTF-16 ranges of each parameter within `label`. */
parameters: ([number, number])[],
};
export type SignatureHelp = {
signatures: Signature[],
activeSignature: number,
activeParameter: number,
};
/** Editor › General › Smart Keys. */
export type SmartKeysSettings = {
/** Home moves caret to first non-whitespace character. */
smartHome?: boolean,
/** Use "CamelHumps" words. */
camelHumps?: boolean,
pairBrackets?: boolean,
pairQuotes?: boolean,
surroundSelection?: boolean,
tabOutOfPair?: boolean,
/** Reformat on paste: `none` | `indentBlock` | `indentEachLine`. */
reformatOnPaste?: string,
smartIndent?: boolean,
/** Backspace › Unindent: `autoindent` (proper indent position) | `nearest` indent position | `none`. */
backspaceUnindent?: string,
};
export type SourceFolder = {
/** Project-relative, `/`-separated; `""` = the project root. */
path: string,
kind: RootKind,
/**
* Build file the root was detected from (`"pom.xml"`, `"app/build.gradle.kts"`);
* `None` for a folder the user marked.
*/
detectedFrom: string | null,
};
/**
* The Typo inspection's options (IDEA's "Process code / literals / comments");
* plain text and Markdown are always checked.
*/
export type SpellScope = {
code?: boolean,
literals?: boolean,
comments?: boolean,
};
/** Editor › Natural Languages › Spelling. */
export type SpellingSettings = {
/** Application-level dictionary: accepted words (IDE settings). */
ideWords?: string[],
/** Project-level dictionary: accepted words (project settings). */
projectWords?: string[],
/** Custom dictionaries: plain word lists or Hunspell `.dic` files. */
customDictionaries?: string[],
};
export type SqlStatement = {
/** UTF-16 offsets of the statement text (whitespace trimmed, `;` excluded). */
from: number,
to: number,
text: string,
};
/** How an SSH connection authenticates. */
export type SshAuth = "password" |
/** A private key file, optionally protected by a passphrase. */
"keyPair" |
/** `~/.ssh/config` (HostName, User, Port, IdentityFile, ProxyJump) and the SSH agent. */
"openSsh";
/** A named SSH host, shared by terminals, deployment, run targets and data sources. */
export type SshConfiguration = {
id?: string,
name?: string,
/** Host name, or a `Host` alias of `~/.ssh/config` with [`SshAuth::OpenSsh`]. */
host?: string,
port?: number | null,
user?: string,
auth?: SshAuth,
/** Private key for [`SshAuth::KeyPair`]; `~/` is the home directory. */
keyFile?: string,
/** Keep the password / key passphrase in the saved passwords. */
saveSecret?: boolean,
};
/** Tools › SSH Configurations. */
export type SshSettings = {
configs?: SshConfiguration[],
};
export type SshTerminalCommand = {
shell: string,
args: string[],
title: string,
};
export type StackFrame = {
id: number,
name: string,
path: IpcPath | null,
line: number,
column: number,
/** `subtle` frames (library/generated) are collapsed in the UI. */
presentationHint: string | null,
};
export type StartupMetrics = {
/**
* Process start → `main`: exec, code-signature scan (seconds for a freshly
* linked debug binary on macOS) and dynamic loading; `null` when unknown.
*/
processToMainMs: number | null,
/** Process start → backend set-up (Tauri / WebView boot); `null` when unknown. */
processToSetupMs: number | null,
/** Backend set-up (`AppState::new`). */
setupMs: number | null,
/** Process start → first IPC call from the UI. */
firstIpcMs: number | null,
};
export type Stash = {
index: number,
message: string,
timeMs: number | null,
};
/** A call on the current line that Smart Step Into can enter (`stepInTargets`). */
export type StepInTarget = {
id: number,
label: string,
/** 0-based, when the adapter reports where the call is. */
line: number | null,
column: number | null,
endColumn: number | null,
};
export type StepKind = "over" | "into" | "out";
export type StructuralEvent = { type: "file"; file: StructuralFile } | { type: "done"; summary: StructuralSummary };
/** All matches in one file; streamed as files complete. */
export type StructuralFile = {
path: IpcPath,
relPath: string,
matches: StructuralMatch[],
};
export type StructuralLanguage = {
id: LanguageId,
name: string,
};
export type StructuralMatch = {
range: Range,
/** The matched code (capped). */
text: string,
/** The first line of the match, for result rows. */
lineText: string,
replacement: string | null,
};
export type StructuralQuery = {
pattern: string,
/** Only files of this language are searched. */
language: LanguageId,
/** Replacement template; matches then carry their replacement text. */
replacement: string | null,
/** Stop after this many matches (0 = 5 000). */
maxMatches: number,
};
/** Structural ranges around a position (selection, move / complete statement). */
export type StructuralRanges = {
/** Extend Selection chain, innermost first (shrink = walk it backwards). */
selection: Range[],
/** Innermost statement (child of a block / statement list) at the position. */
statement: SyntaxNode | null,
prevStatement: SyntaxNode | null,
nextStatement: SyntaxNode | null,
/** The block / statement list containing `statement`. */
block: SyntaxNode | null,
/** Innermost declaration that is a direct member of a class body or of the file. */
declaration: SyntaxNode | null,
prevDeclaration: SyntaxNode | null,
nextDeclaration: SyntaxNode | null,
};
export type StructuralSummary = {
files: number,
matches: number,
limitHit: boolean,
cancelled: boolean,
elapsedMs: number,
};
/** What the structure service can do for a language. */
export type StructureSupport = {
/** A tree-sitter grammar is bundled: every query but `locals` works. */
tree: boolean,
/** A `locals.scm` query is bundled. */
locals: boolean,
};
export type SymbolFilter = "all" |
/** Go to Class (⌘O): classes, interfaces, structs, enums, traits, type aliases. */
"types";
/** Symbol kinds, a stable subset of LSP `SymbolKind`. */
export type SymbolKind = "file" | "module" | "namespace" | "package" | "class" | "interface" | "struct" | "enum" | "enumMember" | "trait" | "function" | "method" | "constructor" | "field" | "property" | "variable" | "constant" | "typeParameter" | "typeAlias" | "macro" | "event" | "operator" | "key" | "unknown";
export type SymbolMatch = {
name: string,
kind: SymbolKind,
container: string | null,
path: IpcPath,
relPath: string,
range: Range,
score: number,
/** Matched char indices within `name`. */
indices: number[],
};
export type SyncAction = "upload" | "download" | "deleteRemote" | "deleteLocal";
/** One file of Sync with Deployed. */
export type SyncEntry = {
/** Project-relative, `/`-separated. */
path: string,
remotePath: string,
local: FileStamp | null,
remote: FileStamp | null,
status: SyncStatus,
};
export type SyncProgress = {
message: string,
/** 0..1, or `None` when indeterminate. */
fraction: number | null,
};
export type SyncStatus = "localOnly" | "remoteOnly" | "localNewer" | "remoteNewer" |
/** Same time, different size. */
"different" | "same";
export type SyncStep = {
/** Project-relative, `/`-separated. */
path: string,
action: SyncAction,
};
/** Counters for diagnostics (`app_metrics`). */
export type SyntaxCacheStats = {
/** Documents tracked (open and observed). */
documents: number,
/** Documents with a cached tree. */
trees: number,
/** Total text size of the documents with a cached tree. */
treeTextBytes: number,
/** Queries answered from an up-to-date tree. */
hits: number,
/** Queries that re-parsed incrementally from an edited tree. */
incrementalParses: number,
/** Queries that parsed from scratch. */
fullParses: number,
};
export type SyntaxError = {
kind: SyntaxErrorKind,
range: Range,
/** For `missing`: the expected node kind or token text, e.g. `;`, `)`, `identifier`. */
expected: string | null,
/** Short human message: ``missing `;` ``, ``unexpected `foo` ``. */
message: string,
};
export type SyntaxErrorKind =
/** Text the parser could not fit into the grammar (`ERROR` node). */
"unexpected" |
/** A token / node the parser had to assume (e.g. a missing `;`); empty range. */
"missing";
export type SyntaxErrors = {
/** In document order. */
errors: SyntaxError[],
/** More errors exist than were returned (see `MAX_SYNTAX_ERRORS`). */
truncated: boolean,
};
/** Highlight classes sent to the UI, which maps each onto a Lezer tag. */
export type SyntaxHighlightKind = "keyword" | "string" | "stringSpecial" | "escape" | "regexp" | "atom" | "number" | "constant" | "comment" | "docComment" | "function" | "functionCall" | "builtin" | "type" | "namespace" | "variable" | "selfVariable" | "property" | "attribute" | "macro" | "label" | "tag" | "operator" | "punctuation";
/** Highlighted ranges of a whole document, packed like LSP semantic tokens. */
export type SyntaxHighlights = {
/** Legend: `data` kind `i` is `kinds[i]`. */
kinds: SyntaxHighlightKind[],
/** `[from, to, kind]` triples: sorted, non-overlapping UTF-16 offsets. */
data: number[],
};
/** One tree-sitter node. */
export type SyntaxNode = {
/** Grammar node kind, e.g. `method_invocation`, `identifier`, `;`. */
kind: string,
range: Range,
/** Field name of this node in its parent (`name`, `body`, `condition`…). */
field: string | null,
/** Named node (anonymous tokens such as `;` or `(` are not named). */
named: boolean,
/** The node is an `ERROR` node. */
error: boolean,
/** The parser inserted the node to recover (e.g. a missing `;`); its range is empty. */
missing: boolean,
/** The node or a descendant is an error / missing node. */
hasError: boolean,
};
/** A long-running background task shown in the status bar. */
export type TaskId = number;
/** An integrated terminal session. */
export type TerminalId = number;
export type TerminalInfo = {
id: TerminalId,
title: string,
pid: number | null,
};
export type TerminalOptions = {
cwd: IpcPath,
/** Defaults to the user's login shell (passwd entry, then `$SHELL`; PowerShell or `COMSPEC` on Windows). */
shell: string | null,
args: string[],
env: { [key in string]: string },
cols: number,
rows: number,
/** Make zsh / bash / fish report their working directory (OSC 7) at every prompt. */
shellIntegration?: boolean,
};
/** Tools › Terminal. */
export type TerminalSettings = {
/** Empty = project root; relative paths resolve against it. */
startDirectory?: string,
env?: { [key in string]: string },
/** Shell command line; empty = the login shell. */
shellPath?: string,
tabName?: string,
audibleBell?: boolean,
closeOnExit?: boolean,
mouseReporting?: boolean,
copyOnSelection?: boolean,
pasteOnMiddleClick?: boolean,
overrideIdeShortcuts?: boolean,
shellIntegration?: boolean,
highlightHyperlinks?: boolean,
optionAsMeta?: boolean,
/** Escape moves focus to the editor instead of reaching the shell. */
escapeToEditor?: boolean,
/** `block` | `underline` | `bar`. */
cursorShape?: string,
cursorBlink?: boolean,
useEditorFont?: boolean,
fontFamily?: string,
fontSize?: number | null,
/** Multiple of the cell height. */
lineHeight?: number | null,
/** Font tried for glyphs the main font lacks; empty = none. */
fallbackFontFamily?: string,
/** Multiple of the cell width. */
columnWidth?: number | null,
};
export type TestCaseReport = {
/** Fully qualified class (`com.acme.OrderTest`, nested: `com.acme.OrderTest$Nested`). */
className: string,
/** Method name without `()`. */
name: string,
status: TestCaseStatus,
durationMs: number | null,
/** Failure / error / skip message. */
message: string | null,
/** Failure stack trace and captured output. */
output: string | null,
};
export type TestCaseStatus = "passed" | "failed" | "skipped";
/** Editor › Color Scheme override of one text attribute. */
export type TextAttributesOverride = TextAttributesOverride_Serialize | TextAttributesOverride_Deserialize;
/** Editor › Color Scheme override of one text attribute. */
export type TextAttributesOverride_Deserialize = {
foreground?: string | null,
background?: string | null,
bold?: boolean | null,
italic?: boolean | null,
/** `underline` | `wave` | `strikeout` | `none`. */
effect?: string | null,
effectColor?: string | null,
};
/** Editor › Color Scheme override of one text attribute. */
export type TextAttributesOverride_Serialize = {
foreground?: string | null,
background?: string | null,
bold?: boolean | null,
italic?: boolean | null,
/** `underline` | `wave` | `strikeout` | `none`. */
effect?: string | null,
effectColor?: string | null,
};
/**
* Replace the text in `[from, to)` (UTF-16 offsets into the document *before*
* the change set is applied) with `insert`.
*/
export type TextChange = {
from: number,
to: number,
insert: string,
};
/** An edit expressed in line/column coordinates (LSP `TextEdit`). */
export type TextEdit = {
range: Range,
new_text: string,
};
/** `{"id", "name", "kind", "tokens": {"--bg-app": "#002b36", ...}}`. */
export type ThemeDef = {
id: string,
name: string,
kind: ThemeKind,
tokens: { [key in string]: string },
};
export type ThemeKind = "dark" | "light";
export type ThreadInfo = {
id: number,
name: string,
};
export type TomcatHome = {
version: string,
};
/** UI-facing state of one tool. */
export type ToolInfo = {
/** Server / adapter name from `languages/*.toml`. */
name: string,
displayName: string,
kind: ToolKind,
/** The executable the IDE launches. */
command: string,
/** Names of the languages using this tool. */
languages: string[],
status: ToolStatus,
path: IpcPath | null,
version: string | null,
/** How it gets installed, e.g. `npm`, `GitHub release`; `None` when not installable. */
installMethod: string | null,
canInstall: boolean,
/** Why install is impossible right now (missing npm, no build for this platform, …). */
unavailableReason: string | null,
canUninstall: boolean,
/** Manual install instructions from the language definition. */
installHint: string | null,
homepage: string | null,
/** Why the executable chosen in settings cannot be used (status is then `Missing`). */
customError: string | null,
/** A language server's arguments from its language definition. */
defaultArgs: string[],
/** A language server's `initializationOptions` from its language definition, as JSON text. */
defaultInitializationOptions: string | null,
/**
* The interchangeable servers this one belongs to, in preference order: a
* server and the `fallback` ones after it. Empty when it has none.
*/
alternatives: string[],
};
export type ToolKind = "languageServer" | "debugger" |
/** Loaded into another tool's process, e.g. a jdtls agent. */
"plugin" | "formatter";
export type ToolSettings = {
/** Executable to launch instead of the managed / `PATH` one; empty = auto-detect. */
path?: string,
};
export type ToolStatus =
/** Installed by the IDE (managed tools dir or a toolchain component it manages). */
"installed" |
/** Found on the system `PATH`. */
"onPath" |
/** The executable chosen in settings. */
"custom" | "missing";
export type TransferError = {
path: string,
message: string,
};
export type TransferReport = {
files: number,
/** Files left alone: excluded, or outside every mapping. */
skipped: number,
errors: TransferError[],
};
export type TrustDecisions = {
projects: string[],
locations: string[],
restricted: string[],
};
export type TrustStatus = {
root: IpcPath,
trusted: boolean,
decided: boolean,
};
export type TypeScriptSettings = {
/**
* `bundled` (the server's own TypeScript), `workspace` (`node_modules/typescript`),
* or a path to a TypeScript `lib` directory.
*/
version?: string,
};
/** A misspelt word. */
export type Typo = {
/** UTF-16 range of the word. */
range: Range,
word: string,
context: TypoContext,
};
/**
* What a typo is part of: correcting one in `Code` (a declared name) must
* rename the symbol; the others may replace the word in place.
*/
export type TypoContext = "code" | "literal" | "comment" | "prose";
/** What [`FileMoves::undo`] did. */
export type UndoOutcome = {
/** Moves reverted (each `from` is the original location again). */
moves: FileMove[],
/** Edited files changed since the refactoring, so their edits were kept. */
conflicts: IpcPath[],
};
export type UpdateCheck = {
/** False when no update endpoint is configured (no request was made). */
enabled: boolean,
update: UpdateInfo | null,
};
export type UpdateInfo = {
version: string,
currentVersion: string,
notes: string | null,
date: string | null,
};
/** Progress of [`app_install_update`], streamed to the UI's background task. */
export type UpdateProgress =
/** Bytes received so far; `total` when the server sends a length. */
{ type: "downloading"; downloaded: number | null; total: number | null } |
/** Download done; the new version is being written over this one. */
{ type: "installing" };
export type Variable = {
name: string,
value: string,
typeName: string | null,
/** > 0 when expandable. */
variablesReference: number,
evaluateName: string | null,
};
/** Version Control › Confirmation. */
export type VcsConfirmationSettings = {
/** `ask` | `silently` | `never`. */
onCreate?: string,
onDelete?: string,
/** Update Project opens its options dialog first. */
showUpdateOptions?: boolean,
confirmDropCommits?: boolean,
/** After a patch is saved: `ask` | `no` | `reveal` (show it in the file manager). */
onPatchCreated?: string,
};
/** A repository of the project (IDEA's VCS root). */
export type VcsRoot = {
/** Worktree root. */
root: IpcPath,
/** Merge / rebase / cherry-pick / revert in progress. */
operation: string | null,
/** Current branch; `None` when HEAD is detached (or unreadable). */
head: string | null,
/** HEAD commit; `None` before the first commit. */
headCommit: string | null,
};
/** Version Control (main page) and its sub-pages. */
export type VcsSettings = {
/** Colour folders that contain changed files (project tree, tabs). */
showDirtyDirectories?: boolean,
/** Stop file history (Show History) after `history_limit` commits. */
limitHistory?: boolean,
historyLimit?: number,
git?: GitSettings,
commit?: CommitSettings,
confirmation?: VcsConfirmationSettings,
shelf?: ShelfSettings,
/** Issue Navigation: commit-message patterns turned into links. */
issueNavigation?: IssueLink[],
};
/**
* Read-only contents a language server provides for a non-`file:` URI
* (library class source or decompiled code from `jdt://`, …).
*/
export type VirtualDocument = {
uri: string,
text: string,
languageId: LanguageId,
/** Tab title, e.g. `SpringApplication.class` (decompiled) or `SpringApplication.java`. */
title: string,
/** Origin shown in the tooltip / banner, e.g. the jar path. */
description: string | null,
/** Generated Java from a decompiler, rather than real source or a disassembler stub. */
decompiled: boolean,
};
/** Declared (or conventional) visibility of an outline symbol. */
export type Visibility = "public" | "protected" |
/** Package / module / assembly scope (Java default, `internal`, `pub(crate)`, Go unexported). */
"package" | "private";
export type WebArtifact = {
id: string,
name: string,
module: string,
tool: string,
};
/**
* A web reference no language server resolves and where it points: `class="card"` →
* `.card` selectors, `id` → `#id` selectors, `href="#top"` → the element, `var(--x)` →
* `--x:` declarations.
*/
export type WebGoto = {
reference: WebReference,
targets: Location[],
};
export type WebReference = {
kind: WebReferenceKind,
/** Without sigil: `card`, `main`, `--accent`. */
name: string,
range: Range,
};
export type WebReferenceKind =
/** A class in a `class` / `className` attribute: `.name` selectors. */
"class" |
/** An `id` attribute value: `#name` selectors. */
"id" |
/** `href="#name"`: the element with that id in the same document. */
"anchor" |
/** `var(--name)`: the custom property's declarations. */
"cssVariable";
export type WindowTab = {
label: string,
name: string,
root: IpcPath | null,
current: boolean,
};
export type WorkingTreeChange = {
path: string,
kind: ChangeKind,
oldPath: string | null,
added: number,
removed: number,
};
export type Workspace = Workspace_Serialize | Workspace_Deserialize;
/** Edits to many files, applied atomically from the user's point of view. */
export type WorkspaceEdit = {
files: FileEdit[],
};
export type WorkspaceSymbol = {
name: string,
kind: SymbolKind,
container: string | null,
location: Location,
};
export type Workspace_Deserialize = {
version: number,
name: string,
projects: string[],
};
export type Workspace_Serialize = {
version: number,
name: string,
projects: string[],
};
export type Worktree = {
path: IpcPath,
/** Checked-out commit; `None` for a bare main repository. */
head: string | null,
/** Short branch name; `None` when HEAD is detached. */
branch: string | null,
/** The main working tree (cannot be removed). */
main: boolean,
locked: boolean,
prunable: boolean,
};
/* Tauri Specta runtime */
async function typedError<T, E>(result: Promise<T>): Promise<{ status: "ok"; data: T } | { status: "error"; error: E }> {
try {
return { status: "ok", data: await result };
} catch (e) {
if (e instanceof Error) throw e;
return { status: "error", error: e as any };
}
}