|
|
@@ -3,26 +3,74 @@ import { KeyCode, KeyMod } from "@dtinsight/molecule/esm/monaco";
|
|
|
import { Action2 } from '@dtinsight/molecule/esm/monaco/action';
|
|
|
//@ts-ignore
|
|
|
import { KeyChord } from 'monaco-editor/esm/vs/base/common/keyCodes';
|
|
|
+import {DRAWER_MENU_ENUM} from "@/constant";
|
|
|
+import {history} from "@@/core/history";
|
|
|
+import {submitQuestion} from "@/utils";
|
|
|
+import {jumpToCoder} from "@/services/exam";
|
|
|
|
|
|
-export class KeybindingAction extends Action2 {
|
|
|
+export class ResultKeybindingAction extends Action2 {
|
|
|
|
|
|
- static readonly ID = 'AutoSave';
|
|
|
+ constructor() {
|
|
|
+ super({
|
|
|
+ id: DRAWER_MENU_ENUM.RESULT,
|
|
|
+ precondition: undefined,
|
|
|
+ f1: false, // Not show in the Command Palette
|
|
|
+ keybinding: {
|
|
|
+ weight: KeybindingWeight.WorkbenchContrib,
|
|
|
+ when: undefined,
|
|
|
+ primary: KeyChord(KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyK)
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ run(accessor: any, ...args: any[]) {
|
|
|
+ history.push({
|
|
|
+ query: {
|
|
|
+ drawer: DRAWER_MENU_ENUM.RESULT,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ // do something
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class SubmitKeybindingAction extends Action2 {
|
|
|
+
|
|
|
+ constructor() {
|
|
|
+ super({
|
|
|
+ id: DRAWER_MENU_ENUM.SUBMIT,
|
|
|
+ precondition: undefined,
|
|
|
+ f1: false, // Not show in the Command Palette
|
|
|
+ keybinding: {
|
|
|
+ weight: KeybindingWeight.WorkbenchContrib,
|
|
|
+ when: undefined,
|
|
|
+ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK)
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ run(accessor: any, ...args: any[]) {
|
|
|
+ submitQuestion();
|
|
|
+ // do something
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export class OpenKeybindingAction extends Action2 {
|
|
|
|
|
|
constructor() {
|
|
|
super({
|
|
|
- id: KeybindingAction.ID,
|
|
|
+ id: 'openFile',
|
|
|
precondition: undefined,
|
|
|
f1: false, // Not show in the Command Palette
|
|
|
keybinding: {
|
|
|
weight: KeybindingWeight.WorkbenchContrib,
|
|
|
when: undefined,
|
|
|
- primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyS)
|
|
|
+ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyO)
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
|
|
|
run(accessor: any, ...args: any[]) {
|
|
|
- alert('Save success!');
|
|
|
+ jumpToCoder();
|
|
|
// do something
|
|
|
}
|
|
|
}
|