Файли
openidea/src/platform/keymaps/vscode-macos.ts
T
l0ng-ai 357b728f1d Editor: quick fixes, completion, navigation while typing, and split-pane drag (#109)
* feat(editor): Drag tabs and files between split panes

HTML5 drag and drop never reaches the webview while native file drop is
enabled, so tab, project-file and changelist drags did nothing. They now
run on pointer events:

- Drag an editor tab onto another pane, or onto a pane's edge to split it.
- Drag files from the Project view into an editor pane (center opens them
  there, an edge opens them in a new split).
- Drag files between changelists in the Commit view.
- "Drag-and-drop with Alt pressed only" applies to tabs and stripe buttons.

* fix(lsp): Deliver server settings and start servers on a supported JDK

- workspace/configuration answers a server's own section (basedpyright)
  from its settings block; basedpyright runs in "standard" mode and keeps
  auto search paths on, so `src/` layouts resolve from `tests/`.
- jdtls: formatting follows the editor indent, calls complete without
  guessed arguments, and JDK internals stay out of completion.
- `max-java` in a language server config picks an installed JDK no newer
  than that (kotlin-language-server fails on JDK 25).
- Server initialization may take up to 5 minutes (first Gradle import).
- `lsp_resend_diagnostics` re-emits stored diagnostics after a reload.
- Spelling only checks declared names (not called methods like
  `substring`) and accepts plurals of known software terms.

* feat(editor): Quick fixes, completion and navigation while typing

Quick fixes
- Errors get a red quick-fix bulb; Apply Quick Fix (⌥⇧↵) fixes the most
  severe problem at the caret, and the error hover offers the fix directly.
- Code generated by a code action is re-indented to the file's style.
- Python: Implement abstract methods (⌃I or the bulb) from the bases.
- Duplicate code actions are listed once.

Completion
- Overloads sharing a name, and a name importable from several modules,
  are no longer merged into one entry.
- Auto-import entries show the module they import from.
- Call snippets without a stop (`new ArrayList<>()`) leave the caret inside
  the parentheses with parameter info, or past them when nothing takes
  arguments; parameter info also opens after server call snippets.
- The selected item is resolved ahead of acceptance, so its auto-import
  is applied (rust-analyzer).

Navigation and diagnostics
- Language server requests wait for pending edits, so Go to Declaration
  right after typing answers for the current text; an empty answer right
  after an edit is retried while the server catches up.
- Diagnostics come back after a window reload; error underlines stay
  visible under typo / unused highlighting.
- Implementation gutter markers no longer refresh in a loop while the
  server reports progress.
- A missing alternative server no longer shows as a server error.

* chore(lint): Skip agent worktrees under .claude

* fix(editor): Skip cancelled LSP requests and limit generated-code reformat

- Requests cancelled while waiting for pending edits are not sent.
- Code generated by an action is reformatted per changed hunk, so an added
  import doesn't reformat the code between it and the generated lines.
- A long busy spell caused by a settle refresh re-runs it only once.
- Files dropped on a file row of another changelist move to that changelist.
- Python Implement methods: a nested class without bases ends the lookup,
  class bodies continue through unindented string lines, and
  `@abstractproperty` stubs become `@property`.
- Resend diagnostics goes through the host ops, and custom servers get
  `max_java`.

* fix(editor): Rank the exact type first in Java constructor completion

jdtls appends the call or body to filterText (`String(${0})`); matching
on the label instead lets typing `String` rank `String` above
`StringBuilder` and the other types sharing its sort text.

* fix(editor): List identical completion items once

kotlin-language-server repeats a class once per classpath entry declaring
it, so `String()` and `String` were listed three times each.

* fix(editor): Keep the internal cancellation message out of the UI text catalog
2026-10-28 09:07:50 +08:00

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

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
/**
* "VS Code (macOS)" keymap: our action ids mapped to the closest Visual Studio
* Code default shortcuts. Actions without a VS Code equivalent are listed with
* no binding so switching presets doesn't leak IntelliJ shortcuts.
*/
export const vscodeMacos: Record<string, string[]> = {
// Navigate
"navigate.searchEverywhere": ["Shift Shift"],
"navigate.gotoClass": [],
"navigate.gotoFile": ["Meta+P"],
"navigate.gotoSymbol": ["Meta+T"],
"navigate.findAction": ["Meta+Shift+P", "F1"],
"navigate.navigationBar": ["Meta+Shift+."],
"navigate.switcher": ["Ctrl+Tab"],
"navigate.switcherBack": ["Ctrl+Shift+Tab"],
"navigate.recentFiles": [],
"navigate.recentLocations": [],
"navigate.back": ["Ctrl+-", "Button4"],
"navigate.forward": ["Ctrl+Shift+-", "Button5"],
"navigate.gotoLine": ["Ctrl+G"],
"navigate.declaration": ["F12"],
"navigate.implementation": ["Meta+F12"],
"navigate.typeDeclaration": [],
"navigate.fileStructure": ["Meta+Shift+O"],
"navigate.relatedSymbol": [],
"navigate.nextError": ["F8"],
"navigate.prevError": ["Shift+F8"],
"navigate.callHierarchy": ["Alt+Shift+H"],
"navigate.typeHierarchy": [],
"navigate.toggleBookmark": [],
"navigate.showBookmarks": [],
"navigate.toggleBookmarkWithMnemonic": [],
"navigate.toggleBookmark0": [],
"navigate.toggleBookmark1": [],
"navigate.toggleBookmark2": [],
"navigate.toggleBookmark3": [],
"navigate.toggleBookmark4": [],
"navigate.toggleBookmark5": [],
"navigate.toggleBookmark6": [],
"navigate.toggleBookmark7": [],
"navigate.toggleBookmark8": [],
"navigate.toggleBookmark9": [],
"navigate.gotoBookmark0": [],
"navigate.gotoBookmark1": [],
"navigate.gotoBookmark2": [],
"navigate.gotoBookmark3": [],
"navigate.gotoBookmark4": [],
"navigate.gotoBookmark5": [],
"navigate.gotoBookmark6": [],
"navigate.gotoBookmark7": [],
"navigate.gotoBookmark8": [],
"navigate.gotoBookmark9": [],
"navigate.selectIn": [],
"navigate.lastEditLocation": [],
"navigate.nextEditLocation": [],
"navigate.gotoTest": [],
"navigate.superMethod": [],
"navigate.nextMethod": [],
"navigate.previousMethod": [],
"navigate.nextOccurrence": [],
"navigate.prevOccurrence": [],
// Find
"find.inFile": ["Meta+F"],
"find.replaceInFile": ["Meta+Alt+F"],
"find.next": ["Meta+G"],
"find.previous": ["Meta+Shift+G"],
"find.inPath": ["Meta+Shift+F"],
"find.replaceInPath": ["Meta+Shift+H"],
"find.usages": ["Alt+Shift+F12"],
"find.showUsages": ["Shift+F12"],
"find.highlightUsages": [],
// Code
"code.completion": ["Ctrl+Space"],
"editor.inlineCompletion.trigger": ["Alt+\\"],
"editor.inlineCompletion.accept": ["Tab"],
"editor.inlineCompletion.acceptWord": ["Meta+Right"],
"editor.inlineCompletion.dismiss": ["Escape"],
"editor.inlineCompletion.next": ["Alt+]"],
"editor.inlineCompletion.previous": ["Alt+["],
"code.parameterInfo": ["Meta+Shift+Space"],
"code.quickDocumentation": ["Meta+K Meta+I"],
"code.quickDefinition": ["Alt+F12"],
"code.showIntentions": ["Meta+."],
"code.applyQuickFix": [],
"code.generate": [],
"code.reformat": ["Alt+Shift+F"],
"code.reformatDialog": [],
"code.optimizeImports": ["Alt+Shift+O"],
"code.commentLine": ["Meta+/"],
"code.commentBlock": ["Alt+Shift+A"],
"code.extendSelection": ["Ctrl+Shift+Meta+Right"],
"code.shrinkSelection": ["Ctrl+Shift+Meta+Left"],
"code.duplicateLine": ["Alt+Shift+Down"],
"code.deleteLine": ["Meta+Shift+K"],
"code.moveLineUp": ["Alt+Up"],
"code.moveLineDown": ["Alt+Down"],
"code.moveStatementUp": [],
"code.moveStatementDown": [],
"code.completeStatement": [],
"code.surroundWith": [],
"code.insertLiveTemplate": [],
"code.fold": ["Meta+Alt+["],
"code.unfold": ["Meta+Alt+]"],
"code.foldAll": ["Meta+K Meta+0"],
"code.collapseRecursively": ["Meta+K Meta+["],
"code.expandRecursively": ["Meta+K Meta+]"],
"code.unfoldAll": ["Meta+K Meta+J"],
"code.addCaretNextOccurrence": ["Meta+D"],
"code.selectAllOccurrences": ["Meta+Shift+L"],
"code.unselectOccurrence": ["Meta+U"],
"code.addCaretsToLineEnds": ["Alt+Shift+I"],
"code.startNewLine": ["Meta+Enter"],
"code.startNewLineBefore": ["Meta+Shift+Enter"],
"code.joinLines": ["Ctrl+J"],
"code.toggleCase": [],
"code.pasteFromHistory": [],
"code.sortLines": [],
"code.reverseLines": [],
"code.unwrap": [],
"code.foldSelection": [],
"editor.toggleColumnSelection": [],
// Refactor
"refactor.thisMenu": ["Ctrl+Shift+R"],
"refactor.rename": ["F2"],
"refactor.changeSignature": [],
"refactor.extractVariable": [],
"refactor.extractMethod": [],
"refactor.extractConstant": [],
"refactor.extractField": [],
"refactor.extractParameter": [],
"refactor.inline": [],
"refactor.move": [],
"refactor.safeDelete": [],
// File / editor tabs
"file.save": ["Meta+S"],
"file.new": ["Meta+N"],
"file.settings": ["Meta+,"],
"file.openProject": ["Meta+O"],
"file.newScratchFile": [],
"editor.closeTab": ["Meta+W"],
"toolwindow.closeContent": ["Meta+W"],
"editor.reopenClosedTab": ["Meta+Shift+T"],
"file.toggleReadOnly": [],
"editor.nextTab": ["Meta+Alt+Right", "Meta+Shift+]"],
"editor.prevTab": ["Meta+Alt+Left", "Meta+Shift+["],
"editor.splitRight": ["Meta+\\"],
"editor.toggleZen": ["Meta+K Z"],
"window.toggleFullScreen": ["Meta+Ctrl+F"],
"window.next": [],
"window.previous": [],
"file.reloadFromDisk": [],
"editor.copyPath": ["Meta+K P"],
"navigate.searchText": [],
"code.splitLine": [],
"editor.scrollToCenter": [],
"editor.codeBlockStart": [],
"editor.codeBlockEnd": [],
"editor.cloneCaretAbove": ["Meta+Alt+Up"],
"editor.cloneCaretBelow": ["Meta+Alt+Down"],
"editor.matchBrace": ["Meta+Shift+\\"],
"editor.toggleInsertState": [],
// Explorer (when: projectViewFocus)
"project.newFile": [],
"project.newInThisDirectory": [],
"project.rename": ["Enter"],
"project.move": [],
"project.delete": ["Meta+Backspace"],
"project.copy": ["Meta+C"],
"project.cut": ["Meta+X"],
"project.paste": ["Meta+V"],
"project.copyAbsolutePath": ["Meta+Alt+C"],
"project.open": ["Meta+Down"],
"project.reloadFromDisk": [],
"project.expandAll": [],
"project.collapseAll": [],
"project.findUsages": ["Alt+Shift+F12"],
"project.reformatCode": ["Alt+Shift+F"],
"project.optimizeImports": ["Alt+Shift+O"],
"project.compareWith": [],
// Views / panels
"toolwindow.project": ["Meta+Shift+E"],
"toolwindow.bookmarks": [],
"toolwindow.find": [],
"toolwindow.run": [],
"toolwindow.debug": ["Meta+Shift+D"],
"toolwindow.problems": ["Meta+Shift+M"],
"toolwindow.structure": [],
"toolwindow.services": [],
"toolwindow.git": ["Ctrl+Shift+G"],
"toolwindow.commit": [],
"toolwindow.terminal": ["Ctrl+`"],
"terminal.new": [],
"toolwindow.hideAll": ["Meta+B"],
"toolwindow.maximize": [],
"toolwindow.jumpToLast": [],
"toolwindow.hideActive": ["Meta+J"],
"toolwindow.focusEditor": ["Escape"],
// Build (Terminal › Run Build Task)
"build.buildProject": ["Meta+Shift+B"],
"build.buildModule": [],
"build.rebuildProject": [],
"build.buildArtifacts": [],
// Run / debug
"run.run": ["Ctrl+F5"],
"run.debug": ["F5"],
"run.runContext": [],
"run.debugContext": [],
"run.stop": ["Shift+F5"],
"run.chooseConfig": [],
"run.editConfigs": [],
"run.rerun": [],
"coverage.manageReports": [],
"web.openInBrowser": [],
"debug.toggleBreakpoint": ["F9"],
"debug.viewBreakpoints": [],
"debug.resume": ["F5"],
"debug.stepOver": ["F10"],
"debug.stepInto": ["F11"],
"debug.stepOut": ["Shift+F11"],
"debug.runToCursor": [],
"debug.forceRunToCursor": [],
"debug.forceStepOver": [],
"debug.forceStepInto": [],
"debug.smartStepInto": [],
"debug.showExecutionPoint": [],
"debug.toggleTemporaryBreakpoint": [],
"debug.attachToProcess": [],
"debug.setValue": ["F2"],
"debug.jumpToSource": [],
"debug.evaluate": [],
"debug.rerun": [],
"find.rerun": [],
"usages.rerun": [],
// VCS
"vcs.operations": [],
"vcs.commit": [],
"vcs.push": [],
"vcs.commitAndPush": [],
"vcs.toggleAmend": [],
"vcs.showMessageHistory": [],
"vcs.update": [],
"vcs.rollback": [],
"vcs.showDiff": [],
"vcs.nextChange": ["Alt+F5"],
"vcs.prevChange": ["Alt+Shift+F5"],
"vcs.branches": [],
"vcs.annotate": [],
"vcs.localHistory": [],
"localHistory.recentChanges": [],
"runAnything.show": [],
"view.quickSwitchScheme": [],
// Commit tool window (change lists) and Git log; keyWhen limits them to those tool windows.
"vcs.changelist.move": [],
"vcs.changelist.edit": [],
"vcs.log.copyRevision": [],
"vcs.log.goToRef": [],
// View › Appearance (VS Code: workbench.action.zoomIn / zoomOut / zoomReset)
"view.zoomIn": ["Meta+="],
"view.zoomOut": ["Meta+-"],
"view.resetZoom": [],
"editor.increaseFontSize": [],
"editor.decreaseFontSize": [],
// Editing extras, image viewer (keyWhen: image focused) and Markdown editor layouts
"code.cyclicExpandWord": [],
"code.cyclicExpandWordBackward": [],
"editor.copyReference": [],
"code.pasteAsPlainText": [],
"code.expressionTypeInfo": [],
"code.implementMethods": [],
"code.overrideMethods": [],
"image.zoomIn": [],
"image.zoomOut": [],
"image.actualSize": [],
"image.fitToWindow": [],
"image.toggleChessboard": [],
"markdown.editorOnly": [],
"markdown.editorAndPreview": ["Meta+K V"],
"markdown.previewOnly": ["Meta+Shift+V"],
// Diff editor (VS Code: workbench.action.compareEditor.nextChange / previousChange)
"diff.nextDifference": ["F7"],
"diff.prevDifference": ["Shift+F7"],
"diff.jumpToSource": [],
// HTTP Client / Database console: run the request or statement at the caret.
"http.runRequest": ["Meta+Enter"],
"http.runAll": [],
"db.execute": ["Meta+Enter"],
"db.showToolWindow": [],
// Database tool window (when the tree has focus).
"db.openConsole": [],
"db.newDataSource": [],
"db.new": [],
"services.addService": [],
"db.properties": [],
"db.refresh": [],
"db.disconnect": [],
"db.jumpToConsole": [],
"db.editData": ["F4"],
"db.goToDdl": ["F12"],
"db.quickDoc": ["Meta+K Meta+I"],
"db.rename": ["F2"],
"db.drop": ["Meta+Backspace"],
"db.truncate": [],
"db.modifyTable": [],
"db.newTable": [],
"db.newColumn": [],
"db.copyReference": ["Meta+Alt+Shift+C"],
"db.duplicateSource": [],
"db.ddlToClipboard": [],
"db.ddlToConsole": [],
"db.runSqlScript": [],
"db.sqlScript": [],
"db.goToReferencedTable": [],
"db.collapseAll": [],
// Find in Files popup (findPopupOpen): after the editor's keys, so these win while it is open.
"find.popup.nextResult": ["Meta+G"],
"find.popup.previousResult": ["Meta+Shift+G"],
"find.popup.openResult": [],
"find.popup.recentSearches": ["Alt+Down"],
// Agents (VS Code's chat: ⇧⌘I)
"agents.newTask": ["Meta+Shift+I"],
"agents.showToolWindow": [],
"agents.sendToAgent": [],
// Search fields (find bar, Find in Files): last, so they win over editor keys while one is focused.
"find.field.newLine": ["Meta+Shift+Enter"],
"find.field.recentSearches": ["Alt+Down"],
};