дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 18:17:15 +02:00
Improve OpenIDEA's Git workflows across commit and staging, branch and remote operations, merge and rebase, Git Log and signing, worktrees, stash and shelf, patch application, and clone settings. Adds a one-click stash for tracked changes across Git roots and lets users open a worktree branch's associated GitHub review from its context menu. Cloning now includes submodules by default (Settings › Version Control › Git, can be turned off). Repository entry points added here run in each repository's execution scope, so they use the project's own git executable.
143 рядки
4.4 KiB
TypeScript
143 рядки
4.4 KiB
TypeScript
/** Settings model ownership: these UI preferences belong to the client, including their descendants.
|
|
* Mixed sections deliberately list individual keys so project/tooling settings stay on the host.
|
|
* Keep this module dependency-free: the transport also consumes this metadata.
|
|
*/
|
|
export const CLIENT_SETTINGS_KEYS = [
|
|
"keymap",
|
|
"keymapOverrides",
|
|
"customKeymaps",
|
|
"appearance",
|
|
"notifications",
|
|
"general.reopenLastProject",
|
|
"general.confirmExit",
|
|
"general.closeWithoutWelcome",
|
|
"general.closeTabsWithWindow",
|
|
"general.openProjectIn",
|
|
"general.updateSource",
|
|
"general.autoCheckUpdates",
|
|
"general.showWhatsNewAfterUpdate",
|
|
"general.lastRunVersion",
|
|
"general.dateFormat",
|
|
"editor.fontFamily",
|
|
"editor.fontSize",
|
|
"editor.lineHeight",
|
|
"editor.ligatures",
|
|
"editor.onlyMonospacedFonts",
|
|
"editor.fallbackFont",
|
|
"editor.fontWeight",
|
|
"editor.boldFontWeight",
|
|
"editor.colorScheme",
|
|
"editor.colorOverrides",
|
|
"editor.customSchemes",
|
|
"editor.semanticHighlighting",
|
|
"editor.docstringFormat",
|
|
"editor.rainbowBrackets",
|
|
"editor.rainbowBracketKinds",
|
|
"editor.rainbowBracketColors",
|
|
"editor.softWrap",
|
|
"editor.showWhitespace",
|
|
"editor.inlayHints",
|
|
"editor.stickyScroll",
|
|
"editor.appearance",
|
|
"editor.breadcrumbs",
|
|
"editor.folding",
|
|
"editor.tabs",
|
|
"editor.codeEditing",
|
|
"editor.inlay",
|
|
"editor.gutterIconsDisabled",
|
|
"editor.showGutterIcons",
|
|
"editor.general.wheelZoom",
|
|
"editor.general.wheelZoomScope",
|
|
"editor.general.dragAndDrop",
|
|
"editor.general.caretScroll",
|
|
"editor.general.softWrapFiles",
|
|
"editor.general.softWrapIndent",
|
|
"editor.general.scrollPastEnd",
|
|
"editor.general.richTextCopy",
|
|
"editor.codeStyle.visualGuides",
|
|
"terminal.tabName",
|
|
"terminal.appTitleAsTabName",
|
|
"terminal.audibleBell",
|
|
"terminal.closeOnExit",
|
|
"terminal.mouseReporting",
|
|
"terminal.copyOnSelection",
|
|
"terminal.pasteOnMiddleClick",
|
|
"terminal.overrideIdeShortcuts",
|
|
"terminal.highlightHyperlinks",
|
|
"terminal.optionAsMeta",
|
|
"terminal.escapeToEditor",
|
|
"terminal.cursorShape",
|
|
"terminal.cursorBlink",
|
|
"terminal.useEditorFont",
|
|
"terminal.fontFamily",
|
|
"terminal.fontSize",
|
|
"terminal.lineHeight",
|
|
"terminal.fallbackFontFamily",
|
|
"terminal.columnWidth",
|
|
"console.softWrap",
|
|
"console.foldPatterns",
|
|
"console.logColors",
|
|
"debugger.showOnBreakpoint",
|
|
"debugger.focusAppOnBreakpoint",
|
|
"debugger.hideOnTermination",
|
|
"debugger.variablesOnBreakpoint",
|
|
"debugger.runToCursorInlay",
|
|
"debugger.flutterHotReloadOnSave",
|
|
"debugger.inlineValues",
|
|
"debugger.sortValues",
|
|
"debugger.valueTooltip",
|
|
"debugger.valueTooltipOnSelection",
|
|
"debugger.valueTooltipDelay",
|
|
"run.confirmRerun",
|
|
"run.confirmTerminate",
|
|
"run.showOnStart",
|
|
"run.pinTabs",
|
|
"externalDiff",
|
|
"vcs.showDirtyDirectories",
|
|
"vcs.createChangelistsAutomatically",
|
|
"vcs.diffAsEditorTab",
|
|
"vcs.git.inlineBlame",
|
|
"vcs.git.inlineBlameClickable",
|
|
"vcs.git.showBranchInProjectView",
|
|
"vcs.git.showPushDialog",
|
|
"vcs.git.pushDialogOnlyProtected",
|
|
"vcs.git.combineStashAndShelf",
|
|
"vcs.git.stashDiffTarget",
|
|
"vcs.git.stagingArea",
|
|
"vcs.commit.nonModal",
|
|
"vcs.commit.includeChangesByDefault",
|
|
"vcs.commit.commitAllWhenNothingStaged",
|
|
"vcs.commit.doubleClickOpensDiff",
|
|
"vcs.commit.showRightMargin",
|
|
"agents.showContextUsage",
|
|
"agents.showWorkTime",
|
|
"agents.showUsageLimits",
|
|
"agents.showCost",
|
|
"agents.foldTurns",
|
|
"agents.smoothText",
|
|
"agents.fitWindowWidth",
|
|
"agents.thinking",
|
|
"agents.toolCalls",
|
|
"agents.expandToolOutput",
|
|
"agents.sendWith",
|
|
"agents.whileRunning",
|
|
] as const;
|
|
|
|
export function isClientSetting(key: string): boolean {
|
|
return CLIENT_SETTINGS_KEYS.some((root) => key === root || key.startsWith(`${root}.`));
|
|
}
|
|
|
|
/** Overlay from local globals, never from the local window's project layer. Missing client keys
|
|
* also replace remote values, so older local settings fall back to client defaults.
|
|
*/
|
|
export function overlayClientSettings<T>(remote: T, local: unknown): T {
|
|
const object = (value: unknown): Record<string, unknown> =>
|
|
value && typeof value === "object" ? (value as Record<string, unknown>) : {};
|
|
const copy = (target: unknown, source: unknown, path: string[]): unknown => {
|
|
const [head, ...tail] = path;
|
|
const value = object(source)[head!];
|
|
return { ...object(target), [head!]: tail.length ? copy(object(target)[head!], value, tail) : value };
|
|
};
|
|
return CLIENT_SETTINGS_KEYS.reduce((settings, key) => copy(settings, local, key.split(".")) as T, remote);
|
|
}
|