Файли
openidea/src/bindings.ts
T
l0ng-ai 7f59e00ad7 feat(lsp): Show configuration errors as "Not started", not "Crashed"
A `launch_error` (e.g. the chosen jdtls JDK is too old) never starts the
server, so reporting it as a crash was misleading. It is now its own
status, `Misconfigured` ("Not started"), with the reason as the message;
changing the settings retries as before. Run/Debug report the reason
instead of "jdtls is not ready (Misconfigured)".

Claude-Session: https://claude.ai/code/session_01SaPPsVPuk6ZTNsoUCNCbMv
2026-10-24 18:16:06 +08:00

4038 рядки
156 KiB
TypeScript
Неформатований Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
// @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 })),
/** The project open in this window (a settings window: its parent's), if any. */
projectCurrent: () => __TAURI_INVOKE<{
root: IpcPath,
name: string,
isGit: boolean,
settings: Settings_Serialize,
} | 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 })),
/**
* 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 }),
/** Routes frontend logs into the backend `tracing` pipeline. */
logFrontend: (level: LogLevel, message: string) => __TAURI_INVOKE<void>("log_frontend", { level, message }),
fsReadDir: (path: string) => typedError<FileEntry[], IdeError>(__TAURI_INVOKE("fs_read_dir", { 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 })),
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 })),
/**
* 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 })),
/**
* 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")),
docSnapshot: (doc: DocId) => typedError<DocumentInfo, IdeError>(__TAURI_INVOKE("doc_snapshot", { doc })),
/** "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, 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 })),
/**
* 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")),
/**
* 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 })),
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 })),
/**
* Contents of a virtual document (library class, decompiled code) that a
* language server returned a non-`file:` URI for. Cached per project.
*/
lspVirtualDocument: (uri: string) => typedError<VirtualDocument, IdeError>(__TAURI_INVOKE("lsp_virtual_document", { uri })),
lspReferences: (doc: DocId, pos: Pos, includeDeclaration: boolean) => typedError<Location[], IdeError>(__TAURI_INVOKE("lsp_references", { doc, pos, includeDeclaration })),
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 (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: (doc: DocId, pos: Pos, newName: string) => typedError<WorkspaceEdit, IdeError>(__TAURI_INVOKE("lsp_rename", { 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 })),
lspCallHierarchy: (doc: DocId, pos: Pos, direction: HierarchyDirection) => typedError<HierarchyItem[], IdeError>(__TAURI_INVOKE("lsp_call_hierarchy", { 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")),
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 })),
/** 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) => typedError<BlameLine[], IdeError>(__TAURI_INVOKE("vcs_blame", { path })),
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 })),
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 })),
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) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_checkout", { repo, branch, create })),
vcsDeleteBranch: (repo: string | null, branch: string, force: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_delete_branch", { repo, branch, force })),
/** 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) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_stash_push", { repo, message, includeUntracked })),
vcsStashApply: (repo: string | null, index: number, pop: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_stash_apply", { repo, index, pop })),
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 })),
vcsConflictVersions: (path: string) => typedError<ConflictVersions, 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 })),
/**
* 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 })),
/** 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 })),
vcsCreatePatch: (source: PatchSource) => typedError<string, IdeError>(__TAURI_INVOKE("vcs_create_patch", { source })),
vcsPatchPreview: (patch: string) => typedError<PatchFile[], IdeError>(__TAURI_INVOKE("vcs_patch_preview", { patch })),
vcsApplyPatch: (patch: string) => typedError<ApplyOutcome, IdeError>(__TAURI_INVOKE("vcs_apply_patch", { 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) => typedError<ApplyOutcome, IdeError>(__TAURI_INVOKE("vcs_unshelve", { id, remove })),
vcsShelfDelete: (id: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_shelf_delete", { id })),
vcsShelfRename: (id: string, name: string) => typedError<null, IdeError>(__TAURI_INVOKE("vcs_shelf_rename", { id, name })),
vcsShelfPatch: (id: string) => typedError<string, IdeError>(__TAURI_INVOKE("vcs_shelf_patch", { id })),
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 })),
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 })),
/** 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[], IdeError>(__TAURI_INVOKE("run_configs")),
runSaveConfigs: (configs: RunConfig[]) => typedError<null, IdeError>(__TAURI_INVOKE("run_save_configs", { configs })),
runStart: (config: RunConfig, 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 })),
/**
* 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 })),
/**
* 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 })),
/**
* 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) => typedError<JavaLaunchInfo, IdeError>(__TAURI_INVOKE("java_resolve_launch", { module, test, build })),
/** 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 })),
/** 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")),
/** 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.
*/
windowOpenProject: (path: string, newWindow: boolean) => typedError<OpenOutcome, IdeError>(__TAURI_INVOKE("window_open_project", { 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")),
/** What this window was opened for (taken once). */
windowTakeLaunch: () => __TAURI_INVOKE<{
/** Project folder to open. */
project: IpcPath | 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"),
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, then quits through every
* window's unsaved-changes check and relaunches. If a window cancels the quit,
* the update applies on the next start.
*/
appInstallUpdate: () => typedError<null, IdeError>(__TAURI_INVOKE("app_install_update")),
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")),
/** 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) => typedError<CoveragePrepared, 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 })),
/** How to run `config` under a sampling profiler, or which profiler is missing. */
profilerPrepare: (config: RunConfig) => typedError<ProfilePrepared, 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 })),
/**
* 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: () => typedError<DockerSnapshot, IdeError>(__TAURI_INVOKE("docker_snapshot")),
dockerContainerOp: (ids: string[], op: ContainerOp) => typedError<null, IdeError>(__TAURI_INVOKE("docker_container_op", { ids, op })),
dockerRemove: (object: DockerObject, ids: string[], force: boolean) => typedError<null, IdeError>(__TAURI_INVOKE("docker_remove", { object, ids, force })),
/** Pretty-printed `docker inspect` JSON. */
dockerInspect: (object: DockerObject, id: string) => typedError<string, IdeError>(__TAURI_INVOKE("docker_inspect", { object, id })),
/** Streams a container's log lines until it stops or the request is cancelled. */
dockerLogs: (request: RequestId, id: string, tail: number, follow: boolean, timestamps: boolean, onLine: Channel<DockerLogLine>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_logs", { request, id, tail, follow, timestamps, onLine })),
/** Follows `docker events` until the daemon goes away or the request is cancelled. */
dockerEvents: (request: RequestId, onEvent: Channel<DockerEvent>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_events", { request, onEvent })),
dockerPull: (request: RequestId, reference: string, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_pull", { request, reference, onOutput })),
dockerPrune: (request: RequestId, target: PruneTarget, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_prune", { request, target, onOutput })),
/** `docker compose` start / stop / restart / down of a project found through labels. */
dockerComposeOp: (request: RequestId, project: string, files: string[], workingDir: string | null, op: ComposeOp, onOutput: Channel<string>) => typedError<null, IdeError>(__TAURI_INVOKE("docker_compose_op", { request, project, files, workingDir, op, onOutput })),
ghAvailability: () => typedError<GhAvailability, IdeError>(__TAURI_INVOKE("gh_availability")),
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")),
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 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 })),
/** 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,
};
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,
contrastScrollbars?: boolean,
/** Adjust colours for red-green vision deficiency. */
redGreenVision?: boolean,
differentToolWindowBackground?: boolean,
compactMode?: boolean,
fullPathInTitle?: boolean,
projectColorsInToolbar?: boolean,
dndWithAltOnly?: boolean,
menuIcons?: boolean,
/** `subpixel` | `greyscale` | `none` */
ideAntialiasing?: string,
editorAntialiasing?: string,
showToolWindowBars?: boolean,
showToolWindowNames?: 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 },
};
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[],
};
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,
};
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,
};
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,
};
/**
* 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 },
};
export type CheckStatus = "pending" | "success" | "failure" | "cancelled" | "skipped" | "neutral";
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 },
};
/** 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 },
};
export type Command = {
title: string,
command: string,
arguments: string[],
};
export type CommandDecl = {
id: string,
title: string,
category?: string | null,
};
export type Commit = {
id: string,
shortId: string,
parents: string[],
author: string,
email: string,
timeMs: number | null,
summary: string,
message: string,
refs: string[],
};
/** Commit Options (IDEA's commit options popup). */
export type CommitOptions = {
amend: boolean,
signOff: boolean,
/** `--author`, e.g. `Name <[email protected]>`; `None` or blank uses the configured user. */
author: string | null,
/** False skips the pre-commit and commit-msg hooks (`--no-verify`). */
runHooks: boolean,
};
/** Version Control › Commit: commit checks and commit-message inspections. */
export type CommitSettings = {
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 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,
showDocumentation?: boolean,
documentationDelay?: number,
parameterInfo?: boolean,
parameterInfoDelay?: number,
};
export type ComposeOp = "start" | "stop" | "restart" |
/** Stops and removes the project's containers and networks. */
"down";
export type ConflictVersions = {
base: string | null,
ours: string | null,
theirs: string | null,
};
/** 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 = { status: "ready"; runner: string;
/** What to launch instead of the configuration. */
launch: RunConfig; report: CoverageReportSpec } | { status: "missingTool"; tool: string; message: string; install: InstallCommand | null } | { status: "unsupported"; reason: string };
/** 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,
};
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,
};
/** 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,
};
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";
/** `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 DbIndexInfo = {
name: string,
unique: boolean,
columns: 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,
};
export type DbResultColumn = {
name: string,
typeName: string,
};
/**
* 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[] };
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,
/** Host name, or a `Host` alias of `~/.ssh/config` with [`DbSshAuth::OpenSsh`]. */
host?: string,
port?: number | null,
user?: string,
auth?: DbSshAuth,
/** Private key for [`DbSshAuth::KeyPair`]; `~/` is the home directory. */
keyFile?: string,
/** Keep the SSH password / key passphrase in the saved passwords. */
saveSecret?: boolean,
};
/** How the SSH tunnel authenticates (IDEA's SSH configuration "Authentication type"). */
export type DbSshAuth = "password" |
/** A private key file, optionally protected by a passphrase. */
"keyPair" |
/** `~/.ssh/config` (HostName, User, Port, IdentityFile, ProxyJump) and the SSH agent. */
"openSsh";
export type DbSslMode = "disable" | "prefer" | "require";
export type DbStatementOutcome = {
statement: SqlStatement,
result: DbQueryResult | null,
error: string | null,
};
export type DbTableDetails = {
columns: DbColumnInfo[],
indexes: DbIndexInfo[],
foreignKeys: DbForeignKey[],
};
export type DbTableInfo = {
name: string,
kind: DbTableKind,
};
export type DbTableKind = "table" | "view";
export type DbTablePage = {
result: DbQueryResult,
details: DbTableDetails,
offset: number | null,
};
/** 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,
inlineValues?: boolean,
valueTooltip?: boolean,
valueTooltipDelay?: number,
/** Stepping: do not step into library code (debugpy `justMyCode`, js-debug `skipFiles`). */
skipLibraryCode?: boolean,
python?: PythonDebuggerSettings,
};
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,
};
/** 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[],
};
/** 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 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[],
};
/** 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";
/** 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[],
};
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,
};
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,
};
/** Editor › General › Appearance. */
export type EditorAppearanceSettings = {
caretBlinking?: boolean,
/** Blink period in ms. */
caretBlinkPeriod?: number,
blockCaret?: boolean,
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,
/** 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,
/** Color Scheme edits: scheme id → attribute id → override. */
colorOverrides?: { [key in string]: { [key in string]: TextAttributesOverride_Deserialize } },
ligatures?: boolean,
/** Fallback font for glyphs the main font lacks; empty = none. */
fallbackFont?: string,
general?: EditorGeneralSettings,
appearance?: EditorAppearanceSettings,
breadcrumbs?: BreadcrumbsSettings,
completion?: CompletionSettings,
autoImport?: AutoImportSettings,
folding?: FoldingSettings,
tabs?: EditorTabsSettings,
smartKeys?: SmartKeysSettings,
codeEditing?: CodeEditingSettings,
inlay?: InlayHintsSettings,
/** 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,
/** Color Scheme edits: scheme id → attribute id → override. */
colorOverrides: { [key in string]: { [key in string]: TextAttributesOverride_Serialize } },
ligatures: boolean,
/** Fallback font for glyphs the main font lacks; empty = none. */
fallbackFont: string,
general: EditorGeneralSettings,
appearance: EditorAppearanceSettings,
breadcrumbs: BreadcrumbsSettings,
completion: CompletionSettings,
autoImport: AutoImportSettings,
folding: FoldingSettings,
tabs: EditorTabsSettings,
smartKeys: SmartKeysSettings,
codeEditing: CodeEditingSettings,
inlay: InlayHintsSettings,
/** 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` | `none`. */
placement?: string,
multipleRows?: boolean,
showExtension?: boolean,
/** Mark modified tabs with an asterisk. */
markModified?: boolean,
showCloseButton?: 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,
/** Create UTF-8 files: `never` (no BOM) | `always` (with BOM) | `windows` (with BOM on Windows). */
utf8Bom?: string,
};
export type EntryKind = "file" | "dir" | "symlink";
export type ErrorKind = "notFound" | "alreadyExists" | "permissionDenied" | "invalidInput" |
/** Document version mismatch; the UI must resync the full text. */
"outOfSync" | "cancelled" |
/** 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 / exclude settings (shown dimmed, like IDEA "excluded"). */
ignored: 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,
};
/** 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,
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,
};
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,
};
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,
};
export type FormatOptions = {
tabSize: number,
insertSpaces: 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,
};
/**
* 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`. */
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,
};
/** 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,
};
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,
};
export type GoSettings = {
/** Empty = the `go` on `PATH`. */
goroot?: string,
/** Empty = `go env GOPATH`. */
gopath?: string,
};
export type GotoKind = "definition" | "declaration" | "typeDefinition" | "implementation";
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[],
};
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";
/**
* 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,
};
export type IdeEvent =
/** Files or directories changed on disk (after debouncing, ignore rules applied). */
{ type: "fsChanged"; created: IpcPath[]; modified: IpcPath[]; removed: 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 } |
/** 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 } |
/** 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 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 };
/** 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 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,
};
/** 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,
};
export type InlayKind = "type" | "parameter" | "other";
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[],
};
/** 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 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[],
/** 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,
/** 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,
};
/** 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 = {
useTab?: boolean | null,
tabSize?: number | null,
indent?: number | null,
hardWrapAt?: number | null,
};
/** Editor › Code Style › <Language> › Tabs and Indents (unset fields inherit). */
export type LanguageCodeStyle_Serialize = {
useTab?: boolean | null,
tabSize?: number | null,
indent?: number | null,
hardWrapAt?: number | 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,
};
/** 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,
};
export type LanguagesSettings = {
python?: PythonSettings,
node?: NodeSettings,
rust?: RustSettings,
go?: GoSettings,
typescript?: TypeScriptSettings,
java?: JavaSettings,
};
/** What a freshly opened window should do once its frontend is up. */
export type Launch = {
/** Project folder to open. */
project: IpcPath | 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.
*/
extraJson: string | null,
};
/** 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,
};
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,
};
export type LspRefreshKind = "inlayHints" | "semanticTokens" | "codeLens";
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[],
};
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 = {
/** 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 },
};
/**
* 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" };
/** Per-function totals (a recursive function's samples count once in `total`). */
export type MethodStat = {
frame: number,
selfWeight: number | null,
total: number | 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 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";
/** 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[],
};
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 };
/** 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 };
/** 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,
};
/** 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 = { status: "ready"; profiler: string; launch: RunConfig; spec: ProfileSpec } | { status: "missingTool"; tool: string; message: string; install: ProfilerInstall | null; homepage: string | null } | { status: "unsupported"; reason: string };
/** 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 = {
root: IpcPath,
name: string,
isGit: boolean,
settings: Settings_Deserialize,
};
export type ProjectInfo_Serialize = {
root: IpcPath,
name: string,
isGit: boolean,
settings: Settings_Serialize,
};
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[],
};
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,
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,
};
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 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. */
{ op: "pushBranch"; branch: string; revision: string | null; force_with_lease: boolean } |
/** Fast-forwards local `branch` (not checked out) to its upstream. */
{ op: "updateBranch"; branch: string };
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,
};
/** 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";
export type RootKind = "source" | "test" | "resources" | "testResources" | "excluded";
export type RunConfig = {
/** 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,
};
/** 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,
};
/** Run/Debug configuration behaviour. */
export type RunSettings = {
confirmRerun?: boolean,
showOnStart?: boolean,
/** Grace period between interrupt and kill when stopping a process. */
terminationTimeoutMs?: number,
};
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";
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,
};
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 };
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 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,
/** 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 },
};
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,
/** 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 },
};
export type Severity = "error" | "warning" | "info" | "hint";
/** 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: `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,
};
export type SqlStatement = {
/** UTF-16 offsets of the statement text (whitespace trimmed, `;` excluded). */
from: number,
to: number,
text: 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 SyncProgress = {
message: string,
/** 0..1, or `None` when indeterminate. */
fraction: number | null,
};
/** 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,
};
/** 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,
};
export type ToolKind = "languageServer" | "debugger" |
/** Loaded into another tool's process, e.g. a jdtls agent. */
"plugin";
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 TypeScriptSettings = {
/**
* `bundled` (the server's own TypeScript), `workspace` (`node_modules/typescript`),
* or a path to a TypeScript `lib` directory.
*/
version?: string,
};
/** 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,
};
export type Variable = {
name: string,
value: string,
typeName: string | null,
/** > 0 when expandable. */
variablesReference: number,
evaluateName: string | null,
};
/** Version Control › Confirmation. Values: `ask` | `silently` | `never`. */
export type VcsConfirmationSettings = {
onCreate?: string,
onDelete?: 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,
};
/** 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,
/** 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 by a decompiler / disassembler rather than real sources. */
decompiled: boolean,
};
/** 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,
};
/* 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 };
}
}