package com.intellij.ide.customize.transferSettings.providers.vscode.mappings

object KeyBindingsMappings {
  fun commandIdMap(commandId: String) = when (commandId) {
    "editor.action.clipboardPasteAction" -> "\$Paste"
    "editor.action.deleteLines" -> "EditorDeleteLine"
    "editor.action.insertLineAfter" -> "EditorStartNewLine"
    "editor.action.insertLineBefore" -> "EditorStartNewLineBefore"
    "editor.action.moveLinesDownAction" -> "MoveLineDown"
    "editor.action.moveLinesUpAction" -> "MoveLineUp"
    "editor.action.copyLinesDownAction" -> "EditorDuplicate"
    "undo" -> "\$Undo"
    "redo" -> "\$Redo"
    "editor.action.clipboardCutAction" -> "\$Cut"
    "editor.action.addSelectionToNextFindMatch" -> "SelectNextOccurrence"
    "editor.action.insertCursorAtEndOfEachLineSelected" -> "EditorToggleColumnMode"
    "editor.action.selectHighlights" -> "SelectAllOccurrences"
    "editor.action.changeAll" -> "SelectAllOccurrences"
    "editor.action.insertCursorBelow" -> "EditorCloneCaretBelow"
    "editor.action.insertCursorAbove" -> "EditorCloneCaretAbove"
    "editor.action.jumpToBracket" -> "EditorMatchBrace"
    "editor.action.indentLines" -> "EditorIndentLineOrSelection"
    "editor.action.outdentLines" -> "EditorUnindentSelection"
    "cursorHome" -> "EditorLineStart"
    "cursorEnd" -> "EditorLineEnd"
    "cursorBottom" -> "EditorTextEnd"
    "cursorTop" -> "EditorTextStart"
    "scrollLineDown" -> "EditorScrollDown"
    "scrollLineUp" -> "EditorScrollUp"
    "scrollPageDown" -> "ScrollPane-scrollDown"
    "scrollPageUp" -> "ScrollPane-scrollUp"
    "editor.fold" -> "CollapseRegion"
    "editor.unfold" -> "ExpandRegion"
    "editor.foldRecursively" -> "CollapseRegionRecursively"
    "editor.unfoldRecursively" -> "ExpandRegionRecursively"
    "editor.foldAll" -> "CollapseAllRegions"
    "editor.unfoldAll" -> "ExpandAllRegions"
    "editor.action.addCommentLine" -> "CommentByLineComment"
    "editor.action.removeCommentLine" -> "CommentByLineComment"
    "editor.action.commentLine" -> "CommentByLineComment"
    "editor.action.blockComment" -> "CommentByBlockComment"
    "actions.find" -> "Find"
    "editor.action.startFindReplaceAction" -> "Replace"
    "editor.action.triggerParameterHints" -> "ParameterInfo"
    "editor.action.formatDocument" -> "ReformatCode"
    "editor.action.revealDefinition" -> "GotoDeclaration"
    "editor.action.peekDefinition" -> "QuickImplementations"
    "editor.action.quickFix" -> "ShowIntentionActions"
    "editor.action.goToReferences" -> "ShowUsages"
    "editor.action.rename" -> "RenameElement"
    "workbench.action.showAllSymbols" -> "GotoSymbol"
    "workbench.action.gotoLine" -> "GotoLine"
    "workbench.action.quickOpen" -> "GotoFile"
    "editor.action.marker.nextInFiles" -> "GotoNextError"
    "editor.action.marker.prevInFiles" -> "GotoPreviousError"
    "workbench.action.navigateBack" -> "Back"
    "workbench.action.navigateForward" -> "Forward"
    "workbench.action.closeActiveEditor" -> "CloseContent"
    "workbench.action.closeAllEditors" -> "CloseAllEditors"
    "workbench.action.closeFolder" -> "CloseProject"
    "workbench.action.splitEditor" -> "SplitVertically"
    "workbench.action.files.newUntitledFile" -> "FileChooser.NewFile"
    "workbench.action.files.openFileFolder" -> "OpenFile"
    "workbench.action.files.save" -> "SaveAll"
    "workbench.action.files.saveAll" -> "SaveAll"
    "workbench.action.reopenClosedEditor" -> "ReopenClosedTab"
    "workbench.action.files.revealActiveFileInWindows" -> "RevealIn"
    "workbench.action.files.showOpenedFileInNewWindow" -> "EditSourceInNewWindow"
    "workbench.action.toggleZenMode" -> "ToggleDistractionFreeMode"
    "workbench.action.zoomIn" -> "EditorIncreaseFontSize"
    "workbench.action.zoomOut" -> "EditorDecreaseFontSize"
    "workbench.action.zoomReset" -> "EditorResetFontSize"
    "workbench.action.toggleSidebarVisibility" -> "HideSideWindows"
    "workbench.view.explorer" -> "ActivateProjectToolWindow"
    "workbench.view.scm" -> "ActivateVersionControlToolWindow"
    "workbench.view.debug" -> "ActivateDebugToolWindow"
    "workbench.view.extensions" -> "WelcomeScreen.Plugins"
    "workbench.action.output.toggleOutput" -> "ActivateRunToolWindow"
    "markdown.showPreview" -> "org.intellij.plugins.markdown.ui.actions.editorLayout.PreviewOnlyLayoutChangeAction"
    "markdown.showPreviewToSide" -> "org.intellij.plugins.markdown.ui.actions.editorLayout.EditorAndPreviewLayoutChangeAction"
    "workbench.action.terminal.toggleTerminal" -> "ActivateTerminalToolWindow"
    "workbench.action.replaceInFiles" -> "ReplaceInPath"
    "workbench.action.openSettings" -> "ShowSettings"
    "workbench.action.selectTheme" -> "QuickChangeScheme"
    "editor.debug.action.toggleBreakpoint" -> "ToggleLineBreakpoint"
    "workbench.action.debug.start" -> "Debug"
    "workbench.action.debug.run" -> "Run"
    "workbench.action.debug.stepOver" -> "StepOver"
    "workbench.action.debug.stepOut" -> "StepOut"
    "workbench.action.debug.stepInto" -> "StepInto"
    "workbench.action.tasks.build" -> "CompileDirty"
    else -> null
  }

  fun shortcutMap(shortcut: String) = when (shortcut) {
    "SHIFT" -> "shift"
    "ALT" -> "alt"
    "CMD" -> "meta"
    "CTRL" -> "ctrl"
    "-" -> "MINUS"
    "=" -> "EQUALS"
    "BACKSPACE" -> "BACK_SPACE"
    "," -> "COMMA"
    ";" -> "SEMICOLON"
    "." -> "PERIOD"
    "/" -> "SLASH"
    "\\" -> "BACK_SLASH"
    "PAGEDOWN" -> "PAGE_DOWN"
    "PAGEUP" -> "PAGE_UP"
    "[" -> "OPEN_BRACKET"
    "]" -> "CLOSE_BRACKET"
    "'" -> "AMPERSAND"
    else -> shortcut
  }
}