alm
Version:
The best IDE for TypeScript
43 lines (42 loc) • 1.78 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var socketClient_1 = require("../../../socket/socketClient");
var ui = require("../../ui");
var CommonEditorRegistry = monaco.CommonEditorRegistry;
var EditorAction = monaco.EditorAction;
var KeyMod = monaco.KeyMod;
var KeyCode = monaco.KeyCode;
var EditorContextKeys = monaco.EditorContextKeys;
var GitResetAction = /** @class */ (function (_super) {
__extends(GitResetAction, _super);
function GitResetAction() {
return _super.call(this, {
id: 'editor.action.gitReset',
label: 'Git Soft Reset',
alias: 'Git Soft Reset',
precondition: EditorContextKeys.Writable,
kbOpts: {
kbExpr: EditorContextKeys.TextFocus,
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_Z
}
}) || this;
}
GitResetAction.prototype.run = function (accessor, editor) {
socketClient_1.server.gitReset({ filePath: editor.filePath }).then(function (res) {
// console.log(res); // DEBUG
ui.notifySuccessNormalDisappear('Git soft reset successful');
});
};
return GitResetAction;
}(EditorAction));
CommonEditorRegistry.registerEditorAction(new GitResetAction());