@hydranium/glsp-server 1.0.0-next.318 → 1.0.0-next.319
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/command/hydranium-glsp-command-stack.d.ts +13 -2
- package/lib/command/hydranium-glsp-command-stack.d.ts.map +1 -1
- package/lib/command/hydranium-glsp-command-stack.js +49 -2
- package/lib/command/hydranium-glsp-command-stack.js.map +1 -1
- package/lib/command/hydranium-glsp-operation-command.d.ts +21 -2
- package/lib/command/hydranium-glsp-operation-command.d.ts.map +1 -1
- package/lib/command/hydranium-glsp-operation-command.js +29 -3
- package/lib/command/hydranium-glsp-operation-command.js.map +1 -1
- package/lib/command/hydranium-glsp-recording-command.d.ts +7 -0
- package/lib/command/hydranium-glsp-recording-command.d.ts.map +1 -1
- package/lib/command/hydranium-glsp-recording-command.js +12 -1
- package/lib/command/hydranium-glsp-recording-command.js.map +1 -1
- package/lib/command/hydranium-glsp-undo-redo-action-handler.d.ts +58 -1
- package/lib/command/hydranium-glsp-undo-redo-action-handler.d.ts.map +1 -1
- package/lib/command/hydranium-glsp-undo-redo-action-handler.js +116 -1
- package/lib/command/hydranium-glsp-undo-redo-action-handler.js.map +1 -1
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts +11 -1
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.d.ts.map +1 -1
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js +22 -3
- package/lib/computed-bounds/hydranium-glsp-computed-bounds-action-handler.js.map +1 -1
- package/lib/messages/index.d.ts +3 -0
- package/lib/messages/index.d.ts.map +1 -1
- package/lib/messages/index.js +3 -0
- package/lib/messages/index.js.map +1 -1
- package/lib/state/abstract-hydranium-glsp-state.d.ts +12 -1
- package/lib/state/abstract-hydranium-glsp-state.d.ts.map +1 -1
- package/lib/state/abstract-hydranium-glsp-state.js +17 -1
- package/lib/state/abstract-hydranium-glsp-state.js.map +1 -1
- package/lib/status/diagram-status-reporter.d.ts +23 -3
- package/lib/status/diagram-status-reporter.d.ts.map +1 -1
- package/lib/status/diagram-status-reporter.js +28 -2
- package/lib/status/diagram-status-reporter.js.map +1 -1
- package/package.json +7 -7
- package/src/command/hydranium-glsp-command-stack.ts +52 -2
- package/src/command/hydranium-glsp-operation-command.ts +42 -3
- package/src/command/hydranium-glsp-recording-command.ts +14 -1
- package/src/command/hydranium-glsp-undo-redo-action-handler.ts +146 -1
- package/src/computed-bounds/hydranium-glsp-computed-bounds-action-handler.ts +21 -3
- package/src/messages/index.ts +12 -0
- package/src/state/abstract-hydranium-glsp-state.ts +19 -1
- package/src/status/diagram-status-reporter.ts +37 -4
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import { DefaultCommandStack, ModelState } from '@eclipse-glsp/server';
|
|
9
|
+
import { type Command, DefaultCommandStack, ModelState } from '@eclipse-glsp/server';
|
|
10
10
|
import { type ServerSharedServices } from '@hydranium/core';
|
|
11
11
|
/**
|
|
12
12
|
* GLSP's command stack with the diagram's dirty state read from the text store:
|
|
13
13
|
* dirty while any document the diagram's client session has open differs from
|
|
14
|
-
* its file, as the store last knew the file. Undo and redo are GLSP's
|
|
14
|
+
* its file, as the store last knew the file. Undo and redo are GLSP's; a
|
|
15
|
+
* command whose every write was dropped is not pushed.
|
|
15
16
|
*
|
|
16
17
|
* GLSP's own answer counts the diagram's commands since its last save, so it
|
|
17
18
|
* misses every change the diagram did not make: another client's unsaved edit
|
|
@@ -23,6 +24,16 @@ export declare class HydraniumGlspCommandStack extends DefaultCommandStack {
|
|
|
23
24
|
protected readonly modelState: ModelState;
|
|
24
25
|
protected readonly sharedServices: ServerSharedServices;
|
|
25
26
|
get isDirty(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Lifted from `@eclipse-glsp/server` 2.7.0's `DefaultCommandStack.execute`,
|
|
29
|
+
* pushing no entry for a recording command executed outside an operation
|
|
30
|
+
* whose write was dropped, or a `CompoundCommand` of only such commands at
|
|
31
|
+
* any depth: its undo would do nothing, and the user's next undo would be
|
|
32
|
+
* spent on it. A compound that also changed something is pushed, warning
|
|
33
|
+
* that its undo step leaves out what was dropped. The accompanying test
|
|
34
|
+
* pins upstream's source.
|
|
35
|
+
*/
|
|
36
|
+
execute(command: Command): Promise<void>;
|
|
26
37
|
/**
|
|
27
38
|
* Lifted from `@eclipse-glsp/server` 2.7.0's `DefaultCommandStack.handleError`
|
|
28
39
|
* without its `error` line: the failure is rethrown, and whoever ends it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-command-stack.d.ts","sourceRoot":"","sources":["../../src/command/hydranium-glsp-command-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-command-stack.d.ts","sourceRoot":"","sources":["../../src/command/hydranium-glsp-command-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,OAAO,EAAmB,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtG,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAM5D;;;;;;;;;;;GAWG;AACH,qBACa,yBAA0B,SAAQ,mBAAmB;IAC3C,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAG,UAAU,CAAC;IACpB,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAG,oBAAoB,CAAC;IAEpG,IAAa,OAAO,IAAI,OAAO,CAI9B;IAED;;;;;;;;OAQG;IACY,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BtD;IAED;;;;OAIG;IACH,UAAmB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAIpD;CACH"}
|
|
@@ -15,13 +15,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
15
15
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
16
16
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17
17
|
};
|
|
18
|
-
import { DefaultCommandStack, ModelState } from '@eclipse-glsp/server';
|
|
18
|
+
import { CompoundCommand, DefaultCommandStack, ModelState } from '@eclipse-glsp/server';
|
|
19
19
|
import { inject, injectable } from 'inversify';
|
|
20
20
|
import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
|
|
21
|
+
import { isCommandArray } from './hydranium-glsp-operation-command.js';
|
|
22
|
+
import { HydraniumGlspRecordingCommand } from './hydranium-glsp-recording-command.js';
|
|
21
23
|
/**
|
|
22
24
|
* GLSP's command stack with the diagram's dirty state read from the text store:
|
|
23
25
|
* dirty while any document the diagram's client session has open differs from
|
|
24
|
-
* its file, as the store last knew the file. Undo and redo are GLSP's
|
|
26
|
+
* its file, as the store last knew the file. Undo and redo are GLSP's; a
|
|
27
|
+
* command whose every write was dropped is not pushed.
|
|
25
28
|
*
|
|
26
29
|
* GLSP's own answer counts the diagram's commands since its last save, so it
|
|
27
30
|
* misses every change the diagram did not make: another client's unsaved edit
|
|
@@ -37,6 +40,41 @@ let HydraniumGlspCommandStack = class HydraniumGlspCommandStack extends DefaultC
|
|
|
37
40
|
const clientId = this.modelState.clientId;
|
|
38
41
|
return textDocuments.openDocuments().some(open => open.clients.includes(clientId) && textDocuments.isDirty(open.uri));
|
|
39
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Lifted from `@eclipse-glsp/server` 2.7.0's `DefaultCommandStack.execute`,
|
|
45
|
+
* pushing no entry for a recording command executed outside an operation
|
|
46
|
+
* whose write was dropped, or a `CompoundCommand` of only such commands at
|
|
47
|
+
* any depth: its undo would do nothing, and the user's next undo would be
|
|
48
|
+
* spent on it. A compound that also changed something is pushed, warning
|
|
49
|
+
* that its undo step leaves out what was dropped. The accompanying test
|
|
50
|
+
* pins upstream's source.
|
|
51
|
+
*/
|
|
52
|
+
async execute(command) {
|
|
53
|
+
try {
|
|
54
|
+
await command.execute();
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
this.handleError(error);
|
|
58
|
+
}
|
|
59
|
+
const leaves = leavesOf(command);
|
|
60
|
+
const dropped = leaves.filter(leaf => leaf instanceof HydraniumGlspRecordingCommand && leaf.dropped).length;
|
|
61
|
+
if (dropped > 0 && dropped === leaves.length) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (dropped > 0) {
|
|
65
|
+
this.logger.warn(`${dropped} of ${leaves.length} commands of a compound executed outside an operation had their write dropped, ` +
|
|
66
|
+
'so its undo step leaves them out; execute them in one operation to write and undo them as one');
|
|
67
|
+
}
|
|
68
|
+
// Clear the command list past the top (i.e. the old redo list)
|
|
69
|
+
this.commands = this.commands.slice(0, this.top + 1);
|
|
70
|
+
this.commands.push(command);
|
|
71
|
+
++this.top;
|
|
72
|
+
// if the saveIndex points to the old redo list we can never reach a state again
|
|
73
|
+
// where save is not necessary. => ensure that `isDirty` always returns true
|
|
74
|
+
if (this.saveIndex >= this.top) {
|
|
75
|
+
this.saveIndex = -2;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
40
78
|
/**
|
|
41
79
|
* Lifted from `@eclipse-glsp/server` 2.7.0's `DefaultCommandStack.handleError`
|
|
42
80
|
* without its `error` line: the failure is rethrown, and whoever ends it
|
|
@@ -60,4 +98,13 @@ HydraniumGlspCommandStack = __decorate([
|
|
|
60
98
|
injectable()
|
|
61
99
|
], HydraniumGlspCommandStack);
|
|
62
100
|
export { HydraniumGlspCommandStack };
|
|
101
|
+
/**
|
|
102
|
+
* The commands `command` executes: itself, or a `CompoundCommand`'s children
|
|
103
|
+
* at any depth, read from GLSP's protected `CompoundCommand.commands`, as the
|
|
104
|
+
* operation reads them.
|
|
105
|
+
*/
|
|
106
|
+
function leavesOf(command) {
|
|
107
|
+
const children = command instanceof CompoundCommand ? Reflect.get(command, 'commands') : undefined;
|
|
108
|
+
return isCommandArray(children) ? children.flatMap(leavesOf) : [command];
|
|
109
|
+
}
|
|
63
110
|
//# sourceMappingURL=hydranium-glsp-command-stack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-command-stack.js","sourceRoot":"","sources":["../../src/command/hydranium-glsp-command-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-command-stack.js","sourceRoot":"","sources":["../../src/command/hydranium-glsp-command-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,OAAO,EAAgB,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEtG,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAEtF;;;;;;;;;;;GAWG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,mBAAmB;IACxB,UAAU,CAAc;IACD,cAAc,CAAwB;IAEpG,IAAa,OAAO;QACjB,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,aAAa,CAAC;QAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;QAC1C,OAAO,aAAa,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,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E,CAAC;QACb,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,MAAM,KAAK,CAAC;IACf,CAAC;CACH,CAAA;AAxDyC;IAAtC,MAAM,CAAC,UAAU,CAAC;;6DAA4C;AACD;IAA7D,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC;;iEAA0D;AAF1F,yBAAyB;IADrC,UAAU,EAAE;GACA,yBAAyB,CAyDrC;;AAED;;;;GAIG;AACH,SAAS,QAAQ,CAAC,OAAgB;IAC/B,MAAM,QAAQ,GAAY,OAAO,YAAY,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5G,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -44,6 +44,7 @@ export interface OperationInternals {
|
|
|
44
44
|
recordWrittenRoot(root: AstNode): void;
|
|
45
45
|
recordDropped(current: AstNode | undefined): void;
|
|
46
46
|
recordExecuted(step: OperationSideEffect): void;
|
|
47
|
+
isUndoingOrRedoing(): boolean;
|
|
47
48
|
assertNotDuringUndoRedo(label: string): void;
|
|
48
49
|
amendBefore(update: (before: AnyObject) => AnyObject): void;
|
|
49
50
|
}
|
|
@@ -55,6 +56,21 @@ export interface OperationInternals {
|
|
|
55
56
|
export declare function workingUriOfCopy(node: AstNode): string | undefined;
|
|
56
57
|
/** The operation open on `state`, executing, undoing or redoing its side effects; `undefined` between operations. */
|
|
57
58
|
export declare function openOperationOf(state: object): OperationInternals | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* How many operations an undo or redo skipped and applied, as one command-stack
|
|
61
|
+
* entry, a compound executed outside an operation, can undo several.
|
|
62
|
+
*/
|
|
63
|
+
export interface UndoRedoTally {
|
|
64
|
+
skipped: number;
|
|
65
|
+
applied: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The operations undone or redone on `state` since the last call, skipped and
|
|
69
|
+
* applied, for the handler that ran the undo or redo to tell the client: GLSP's
|
|
70
|
+
* command stack takes no answer from an undo, and moves past a skipped one as
|
|
71
|
+
* past any other.
|
|
72
|
+
*/
|
|
73
|
+
export declare function takeUndoRedoTally(state: object): UndoRedoTally;
|
|
58
74
|
/** Run `operation` as {@link HydraniumGlspOperationCommand} describes. */
|
|
59
75
|
export declare function runOperation<TSourceModel extends AnyObject>(operation: HydraniumGlspOperationCommand<TSourceModel>, create: () => MaybePromise<Command | undefined>): Promise<OperationOutcome>;
|
|
60
76
|
/**
|
|
@@ -187,8 +203,9 @@ export declare class HydraniumGlspOperationCommand<TSourceModel extends AnyObjec
|
|
|
187
203
|
/**
|
|
188
204
|
* Resolve the transition onto the current model, run the commands' side
|
|
189
205
|
* effects, then write once, gated on the versions the model was read at. A
|
|
190
|
-
* collision does nothing but warn; a transition with nothing left to
|
|
191
|
-
* or one the model already holds, still runs the side effects.
|
|
206
|
+
* collision does nothing but warn; a transition with nothing left to
|
|
207
|
+
* apply, or one the model already holds, still runs the side effects. Either
|
|
208
|
+
* way the outcome is counted for {@link takeUndoRedoTally}.
|
|
192
209
|
*
|
|
193
210
|
* The caller holds `runExclusive`, which nothing here takes again.
|
|
194
211
|
*/
|
|
@@ -247,4 +264,6 @@ export declare class HydraniumGlspOperationCommand<TSourceModel extends AnyObjec
|
|
|
247
264
|
*/
|
|
248
265
|
protected rebuildWorkingMultiReferences(working: AstNode): void;
|
|
249
266
|
}
|
|
267
|
+
/** Whether `value` is a list of commands, as a `CompoundCommand` holds its children. */
|
|
268
|
+
export declare function isCommandArray(value: unknown): value is Command[];
|
|
250
269
|
//# sourceMappingURL=hydranium-glsp-operation-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-operation-command.d.ts","sourceRo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AAK,IAAI,OAAO,EAAE,CAEjE"}
|
|
@@ -26,6 +26,27 @@ const openOperations = new WeakMap();
|
|
|
26
26
|
export function openOperationOf(state) {
|
|
27
27
|
return openOperations.get(state);
|
|
28
28
|
}
|
|
29
|
+
/** The tally of each state's undo or redo, until {@link takeUndoRedoTally} reads it. */
|
|
30
|
+
const undoRedoTallies = new WeakMap();
|
|
31
|
+
function tallyOf(state) {
|
|
32
|
+
let tally = undoRedoTallies.get(state);
|
|
33
|
+
if (!tally) {
|
|
34
|
+
tally = { skipped: 0, applied: 0 };
|
|
35
|
+
undoRedoTallies.set(state, tally);
|
|
36
|
+
}
|
|
37
|
+
return tally;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The operations undone or redone on `state` since the last call, skipped and
|
|
41
|
+
* applied, for the handler that ran the undo or redo to tell the client: GLSP's
|
|
42
|
+
* command stack takes no answer from an undo, and moves past a skipped one as
|
|
43
|
+
* past any other.
|
|
44
|
+
*/
|
|
45
|
+
export function takeUndoRedoTally(state) {
|
|
46
|
+
const tally = undoRedoTallies.get(state) ?? { skipped: 0, applied: 0 };
|
|
47
|
+
undoRedoTallies.delete(state);
|
|
48
|
+
return tally;
|
|
49
|
+
}
|
|
29
50
|
/** Run `operation` as {@link HydraniumGlspOperationCommand} describes. */
|
|
30
51
|
export function runOperation(operation, create) {
|
|
31
52
|
return membersOf(operation).run(create);
|
|
@@ -110,6 +131,7 @@ export class HydraniumGlspOperationCommand {
|
|
|
110
131
|
this.before = update(this.before);
|
|
111
132
|
}
|
|
112
133
|
},
|
|
134
|
+
isUndoingOrRedoing: () => this.undoingOrRedoing,
|
|
113
135
|
assertNotDuringUndoRedo: label => {
|
|
114
136
|
if (this.undoingOrRedoing) {
|
|
115
137
|
throw new Error(`Recording command '${label}' executed during an undo or redo, which writes only the recorded transition, ` +
|
|
@@ -319,8 +341,9 @@ export class HydraniumGlspOperationCommand {
|
|
|
319
341
|
/**
|
|
320
342
|
* Resolve the transition onto the current model, run the commands' side
|
|
321
343
|
* effects, then write once, gated on the versions the model was read at. A
|
|
322
|
-
* collision does nothing but warn; a transition with nothing left to
|
|
323
|
-
* or one the model already holds, still runs the side effects.
|
|
344
|
+
* collision does nothing but warn; a transition with nothing left to
|
|
345
|
+
* apply, or one the model already holds, still runs the side effects. Either
|
|
346
|
+
* way the outcome is counted for {@link takeUndoRedoTally}.
|
|
324
347
|
*
|
|
325
348
|
* The caller holds `runExclusive`, which nothing here takes again.
|
|
326
349
|
*/
|
|
@@ -341,10 +364,12 @@ export class HydraniumGlspOperationCommand {
|
|
|
341
364
|
}
|
|
342
365
|
else if (outcome.status !== 'no-op' && outcome.status !== 'already-applied') {
|
|
343
366
|
this.modelState.logger.warn(`${direction === 'undo' ? 'Undo' : 'Redo'} of an operation skipped (${outcome.status}); a foreign edit changed a shared field`);
|
|
367
|
+
tallyOf(this.modelState).skipped++;
|
|
344
368
|
return;
|
|
345
369
|
}
|
|
346
370
|
}
|
|
347
371
|
await this.undoOrRedoSideEffects(direction, merged);
|
|
372
|
+
tallyOf(this.modelState).applied++;
|
|
348
373
|
}
|
|
349
374
|
/**
|
|
350
375
|
* Write `model` once through the state's write path, gated on the versions
|
|
@@ -485,7 +510,8 @@ export class HydraniumGlspOperationCommand {
|
|
|
485
510
|
}
|
|
486
511
|
}
|
|
487
512
|
}
|
|
488
|
-
|
|
513
|
+
/** Whether `value` is a list of commands, as a `CompoundCommand` holds its children. */
|
|
514
|
+
export function isCommandArray(value) {
|
|
489
515
|
return Array.isArray(value) && value.every(element => typeof element === 'object' && element !== null && 'execute' in element);
|
|
490
516
|
}
|
|
491
517
|
//# sourceMappingURL=hydranium-glsp-operation-command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-operation-command.js","sourceRoot":"","sources":["../../src/command/hydranium-glsp-operation-command.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAkB,OAAO,EAAE,eAAe,EAAqB,MA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AAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;oBACnF,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,OAAgB,EAAE,EAAE,CAC/C,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAChF,CAAC;gBACL,CAAC;YACJ,CAAC;QACJ,CAAC;IACJ,CAAC;CACH;AAED,wFAAwF;AACxF,MAAM,UAAU,cAAc,CAAC,KAAc;IAC1C,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,SAAS,IAAI,OAAO,CAAC,CAAC;AAClI,CAAC"}
|
|
@@ -49,6 +49,13 @@ export declare class HydraniumGlspRecordingCommand<TSourceModel extends AnyObjec
|
|
|
49
49
|
protected modelState: HydraniumGlspRecordingState<TSourceModel>;
|
|
50
50
|
/** The operation this command opened, when it executed outside one. */
|
|
51
51
|
protected ownOperation?: HydraniumGlspOperationCommand<TSourceModel>;
|
|
52
|
+
/** Backing field for {@link dropped}. */
|
|
53
|
+
protected _dropped: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the operation this command opened, executing outside one, had its
|
|
56
|
+
* write dropped: the command changed nothing, and its undo does nothing.
|
|
57
|
+
*/
|
|
58
|
+
get dropped(): boolean;
|
|
52
59
|
constructor(modelState: HydraniumGlspRecordingState<TSourceModel>,
|
|
53
60
|
/** Human-readable label for the operation; appears in the timing-pair log line. */
|
|
54
61
|
label: string, doExecute: () => MaybePromise<void>,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-recording-command.d.ts","sourceRoot":"","sources":["../../src/command/hydranium-glsp-recording-command.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAiC,MAAM,uCAAuC,CAAC;AAErH;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B,CAAC,YAAY,SAAS,SAAS,IAAI,0BAA0B,CAAC,OAAO,EAAE,YAAY,CAAC,GACxH,cAAc,CAAC,YAAY,CAAC,CAAC;AAEhC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,6BAA6B,CAAC,YAAY,SAAS,SAAS,CAAE,SAAQ,oBAAoB,CAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-recording-command.d.ts","sourceRoot":"","sources":["../../src/command/hydranium-glsp-recording-command.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAiC,MAAM,uCAAuC,CAAC;AAErH;;;;;;;;;GASG;AACH,MAAM,MAAM,2BAA2B,CAAC,YAAY,SAAS,SAAS,IAAI,0BAA0B,CAAC,OAAO,EAAE,YAAY,CAAC,GACxH,cAAc,CAAC,YAAY,CAAC,CAAC;AAEhC;;;;;;;;;;;;;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** The operation this command opened, when it executed outside one. */
|
|
33
33
|
ownOperation;
|
|
34
|
+
/** Backing field for {@link dropped}. */
|
|
35
|
+
_dropped = false;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the operation this command opened, executing outside one, had its
|
|
38
|
+
* write dropped: the command changed nothing, and its undo does nothing.
|
|
39
|
+
*/
|
|
40
|
+
get dropped() {
|
|
41
|
+
return this._dropped;
|
|
42
|
+
}
|
|
34
43
|
constructor(modelState,
|
|
35
44
|
/** Human-readable label for the operation; appears in the timing-pair log line. */
|
|
36
45
|
label, doExecute,
|
|
@@ -48,7 +57,9 @@ export class HydraniumGlspRecordingCommand extends JsonRecordingCommand {
|
|
|
48
57
|
const open = openOperationOf(this.modelState);
|
|
49
58
|
if (!open) {
|
|
50
59
|
const operation = new HydraniumGlspOperationCommand(this.modelState);
|
|
51
|
-
|
|
60
|
+
const outcome = await this.modelState.runExclusive(() => runOperation(operation, () => this));
|
|
61
|
+
this._dropped = outcome === 'dropped';
|
|
62
|
+
if (outcome === 'executed') {
|
|
52
63
|
this.ownOperation = operation;
|
|
53
64
|
}
|
|
54
65
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-recording-command.js","sourceRoot":"","sources":["../../src/command/hydranium-glsp-recording-command.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAuC,oBAAoB,EAAqB,MAAM,sBAAsB,CAAC;AAGpH,OAAO,EAAE,6BAA6B,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAerH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,6BAA8D,SAAQ,oBAAkC;
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-recording-command.js","sourceRoot":"","sources":["../../src/command/hydranium-glsp-recording-command.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAuC,oBAAoB,EAAqB,MAAM,sBAAsB,CAAC;AAGpH,O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,CAAC;QAC3E,MAAM,CAAC,KAAK,CAAC,cAAc,IAAI,CAAC,KAAK,oBAAoB,IAAI,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;QACrF,MAAM,MAAM,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5E,IAAI,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED,sFAAsF;IACnE,UAAU,CAAC,SAAuB;QAClD,4BAA4B;IAC/B,CAAC;IAED;;;OAGG;IACM,KAAK,CAAC,IAAI;QAChB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC;QACnC,CAAC;IACJ,CAAC;IAED,8DAA8D;IACrD,KAAK,CAAC,IAAI;QAChB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC;QACnC,CAAC;IACJ,CAAC;CACH"}
|
|
@@ -6,18 +6,75 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import { type Action, UndoRedoActionHandler } from '@eclipse-glsp/server';
|
|
9
|
+
import { type Action, Logger, MessageAction, UndoRedoActionHandler } from '@eclipse-glsp/server';
|
|
10
|
+
import { type ServerSharedServices } from '@hydranium/core';
|
|
10
11
|
import { type AstNode } from '@hydranium/langium';
|
|
12
|
+
import { type MessageDefinition } from '@hydranium/protocol';
|
|
11
13
|
import { type AbstractHydraniumGlspState } from '../state/abstract-hydranium-glsp-state.js';
|
|
14
|
+
import { type UndoRedoDirection } from './hydranium-glsp-operation-command.js';
|
|
15
|
+
/** An undo did nothing: another editor has since changed a field it would restore. */
|
|
16
|
+
export declare const DIAGRAM_UNDO_SKIPPED: MessageDefinition<"Nothing was undone: another editor has since changed what this undo would restore.">;
|
|
17
|
+
/** A redo did nothing: another editor has since changed a field it would reapply. */
|
|
18
|
+
export declare const DIAGRAM_REDO_SKIPPED: MessageDefinition<"Nothing was redone: another editor has since changed what this redo would reapply.">;
|
|
19
|
+
/**
|
|
20
|
+
* Part of an undo did nothing: of the operations one undo step undoes, as a
|
|
21
|
+
* compound executed outside an operation does, another editor has since
|
|
22
|
+
* changed a field some would restore, and the rest were undone.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DIAGRAM_UNDO_PARTLY_SKIPPED: MessageDefinition<"Part of this undo was not applied: another editor has since changed some of what it would restore.">;
|
|
25
|
+
/** Part of a redo did nothing, as {@link DIAGRAM_UNDO_PARTLY_SKIPPED} describes for an undo. */
|
|
26
|
+
export declare const DIAGRAM_REDO_PARTLY_SKIPPED: MessageDefinition<"Part of this redo was not applied: another editor has since changed some of what it would reapply.">;
|
|
27
|
+
/**
|
|
28
|
+
* An undo failed because another editor changed a field it writes while it
|
|
29
|
+
* ran. GLSP clears the undo history on every failed undo or redo, so the
|
|
30
|
+
* message says so: the next undo otherwise does nothing, unexplained.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DIAGRAM_UNDO_FAILED: MessageDefinition<"Could not undo: another editor changed the same element meanwhile. The undo and redo history of this diagram was cleared.">;
|
|
33
|
+
/** A redo failed as {@link DIAGRAM_UNDO_FAILED} describes for an undo. */
|
|
34
|
+
export declare const DIAGRAM_REDO_FAILED: MessageDefinition<"Could not redo: another editor changed the same element meanwhile. The undo and redo history of this diagram was cleared.">;
|
|
35
|
+
/**
|
|
36
|
+
* An undo failed for a reason of its own, a side effect that threw, say, and
|
|
37
|
+
* GLSP cleared the history as it does on every failed undo or redo. The
|
|
38
|
+
* reason goes in the message's details; the log has it in full.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DIAGRAM_UNDO_ERROR: MessageDefinition<"Could not undo: an error occurred. The undo and redo history of this diagram was cleared.">;
|
|
41
|
+
/** A redo failed as {@link DIAGRAM_UNDO_ERROR} describes for an undo. */
|
|
42
|
+
export declare const DIAGRAM_REDO_ERROR: MessageDefinition<"Could not redo: an error occurred. The undo and redo history of this diagram was cleared.">;
|
|
12
43
|
/**
|
|
13
44
|
* GLSP's undo and redo handler inside the state's `runExclusive`. GLSP's
|
|
14
45
|
* command stack moves its position before it undoes or redoes the entry, so
|
|
15
46
|
* the boundary covers the whole action: taken around the undo or redo alone,
|
|
16
47
|
* an undo arriving while an operation runs would move the position past an
|
|
17
48
|
* entry it then cannot undo.
|
|
49
|
+
*
|
|
50
|
+
* An undo or redo a foreign edit skipped, whole or in part, tells the client,
|
|
51
|
+
* which otherwise sees nothing happen. One that fails ends here, as a message saying the
|
|
52
|
+
* history was cleared in place of GLSP's generic notice for a failed action:
|
|
53
|
+
* a dropped or conflicting one says another editor changed the element, and
|
|
54
|
+
* any but a dropped one, which its reconcile has logged, is logged here.
|
|
18
55
|
*/
|
|
19
56
|
export declare class HydraniumGlspUndoRedoActionHandler extends UndoRedoActionHandler {
|
|
20
57
|
protected readonly modelState: AbstractHydraniumGlspState<AstNode, unknown>;
|
|
58
|
+
protected readonly sharedServices: ServerSharedServices;
|
|
59
|
+
protected readonly logger: Logger;
|
|
21
60
|
execute(action: Action): Promise<Action[]>;
|
|
61
|
+
protected undo(): Promise<Action[]>;
|
|
62
|
+
protected redo(): Promise<Action[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Lifted from `@eclipse-glsp/server` 2.7.0's `UndoRedoActionHandler.undo`
|
|
65
|
+
* and `redo`, telling the client of a skip and ending a failure of the
|
|
66
|
+
* command stack's undo or redo, which flushes the history on any failure.
|
|
67
|
+
* A failed submit after it leaves the history whole and fails as upstream.
|
|
68
|
+
* The accompanying test pins upstream's source.
|
|
69
|
+
*/
|
|
70
|
+
protected undoOrRedo(direction: UndoRedoDirection): Promise<Action[]>;
|
|
71
|
+
/**
|
|
72
|
+
* The message for an undo or redo that failed, logging a failure its
|
|
73
|
+
* reconcile has not. A conflict thrown rather than dropped, by a state that
|
|
74
|
+
* does not reconcile or a reconcile that could not read the text, is the
|
|
75
|
+
* same foreign edit as a dropped write and is told as one.
|
|
76
|
+
*/
|
|
77
|
+
protected failure(direction: UndoRedoDirection, error: unknown): MessageAction;
|
|
78
|
+
protected render(message: MessageDefinition<string>): string;
|
|
22
79
|
}
|
|
23
80
|
//# sourceMappingURL=hydranium-glsp-undo-redo-action-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-undo-redo-action-handler.d.ts","sourceRoot":"","sources":["../../src/command/hydranium-glsp-undo-redo-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-undo-redo-action-handler.d.ts","sourceRoot":"","sources":["../../src/command/hydranium-glsp-undo-redo-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,aAAa,EAAsC,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACrI,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,iBAAiB,EAAiD,MAAM,qBAAqB,CAAC;AAE5G,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAG5F,OAAO,EAAE,KAAK,iBAAiB,EAAqB,MAAM,uCAAuC,CAAC;AAElG,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,yGAGhC,CAA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
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
16
16
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17
17
|
};
|
|
18
|
-
import { ModelState, UndoRedoActionHandler } from '@eclipse-glsp/server';
|
|
18
|
+
import { Logger, MessageAction, ModelState, RedoAction, UndoAction, UndoRedoActionHandler } from '@eclipse-glsp/server';
|
|
19
|
+
import { defineMessage, describeError, isConflictError } from '@hydranium/protocol';
|
|
19
20
|
import { inject, injectable } from 'inversify';
|
|
21
|
+
import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
|
|
22
|
+
import { isDiagramEditDroppedError, logActionFailure } from './diagram-edit-dropped-error.js';
|
|
23
|
+
import { takeUndoRedoTally } from './hydranium-glsp-operation-command.js';
|
|
24
|
+
/** An undo did nothing: another editor has since changed a field it would restore. */
|
|
25
|
+
export const DIAGRAM_UNDO_SKIPPED = defineMessage('hydranium/glsp-server/diagram-undo-skipped', 'Nothing was undone: another editor has since changed what this undo would restore.');
|
|
26
|
+
/** A redo did nothing: another editor has since changed a field it would reapply. */
|
|
27
|
+
export const DIAGRAM_REDO_SKIPPED = defineMessage('hydranium/glsp-server/diagram-redo-skipped', 'Nothing was redone: another editor has since changed what this redo would reapply.');
|
|
28
|
+
/**
|
|
29
|
+
* Part of an undo did nothing: of the operations one undo step undoes, as a
|
|
30
|
+
* compound executed outside an operation does, another editor has since
|
|
31
|
+
* changed a field some would restore, and the rest were undone.
|
|
32
|
+
*/
|
|
33
|
+
export const DIAGRAM_UNDO_PARTLY_SKIPPED = defineMessage('hydranium/glsp-server/diagram-undo-partly-skipped', 'Part of this undo was not applied: another editor has since changed some of what it would restore.');
|
|
34
|
+
/** Part of a redo did nothing, as {@link DIAGRAM_UNDO_PARTLY_SKIPPED} describes for an undo. */
|
|
35
|
+
export const DIAGRAM_REDO_PARTLY_SKIPPED = defineMessage('hydranium/glsp-server/diagram-redo-partly-skipped', 'Part of this redo was not applied: another editor has since changed some of what it would reapply.');
|
|
36
|
+
/**
|
|
37
|
+
* An undo failed because another editor changed a field it writes while it
|
|
38
|
+
* ran. GLSP clears the undo history on every failed undo or redo, so the
|
|
39
|
+
* message says so: the next undo otherwise does nothing, unexplained.
|
|
40
|
+
*/
|
|
41
|
+
export const DIAGRAM_UNDO_FAILED = defineMessage('hydranium/glsp-server/diagram-undo-failed', 'Could not undo: another editor changed the same element meanwhile. The undo and redo history of this diagram was cleared.');
|
|
42
|
+
/** A redo failed as {@link DIAGRAM_UNDO_FAILED} describes for an undo. */
|
|
43
|
+
export const DIAGRAM_REDO_FAILED = defineMessage('hydranium/glsp-server/diagram-redo-failed', 'Could not redo: another editor changed the same element meanwhile. The undo and redo history of this diagram was cleared.');
|
|
44
|
+
/**
|
|
45
|
+
* An undo failed for a reason of its own, a side effect that threw, say, and
|
|
46
|
+
* GLSP cleared the history as it does on every failed undo or redo. The
|
|
47
|
+
* reason goes in the message's details; the log has it in full.
|
|
48
|
+
*/
|
|
49
|
+
export const DIAGRAM_UNDO_ERROR = defineMessage('hydranium/glsp-server/diagram-undo-error', 'Could not undo: an error occurred. The undo and redo history of this diagram was cleared.');
|
|
50
|
+
/** A redo failed as {@link DIAGRAM_UNDO_ERROR} describes for an undo. */
|
|
51
|
+
export const DIAGRAM_REDO_ERROR = defineMessage('hydranium/glsp-server/diagram-redo-error', 'Could not redo: an error occurred. The undo and redo history of this diagram was cleared.');
|
|
20
52
|
/**
|
|
21
53
|
* GLSP's undo and redo handler inside the state's `runExclusive`. GLSP's
|
|
22
54
|
* command stack moves its position before it undoes or redoes the entry, so
|
|
23
55
|
* the boundary covers the whole action: taken around the undo or redo alone,
|
|
24
56
|
* an undo arriving while an operation runs would move the position past an
|
|
25
57
|
* entry it then cannot undo.
|
|
58
|
+
*
|
|
59
|
+
* An undo or redo a foreign edit skipped, whole or in part, tells the client,
|
|
60
|
+
* which otherwise sees nothing happen. One that fails ends here, as a message saying the
|
|
61
|
+
* history was cleared in place of GLSP's generic notice for a failed action:
|
|
62
|
+
* a dropped or conflicting one says another editor changed the element, and
|
|
63
|
+
* any but a dropped one, which its reconcile has logged, is logged here.
|
|
26
64
|
*/
|
|
27
65
|
let HydraniumGlspUndoRedoActionHandler = class HydraniumGlspUndoRedoActionHandler extends UndoRedoActionHandler {
|
|
28
66
|
modelState;
|
|
67
|
+
sharedServices;
|
|
68
|
+
logger;
|
|
29
69
|
execute(action) {
|
|
30
70
|
return this.modelState.runExclusive(() => super.execute(action));
|
|
31
71
|
}
|
|
72
|
+
undo() {
|
|
73
|
+
return this.undoOrRedo('undo');
|
|
74
|
+
}
|
|
75
|
+
redo() {
|
|
76
|
+
return this.undoOrRedo('redo');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Lifted from `@eclipse-glsp/server` 2.7.0's `UndoRedoActionHandler.undo`
|
|
80
|
+
* and `redo`, telling the client of a skip and ending a failure of the
|
|
81
|
+
* command stack's undo or redo, which flushes the history on any failure.
|
|
82
|
+
* A failed submit after it leaves the history whole and fails as upstream.
|
|
83
|
+
* The accompanying test pins upstream's source.
|
|
84
|
+
*/
|
|
85
|
+
async undoOrRedo(direction) {
|
|
86
|
+
const undo = direction === 'undo';
|
|
87
|
+
if (!(undo ? this.commandStack.canUndo() : this.commandStack.canRedo())) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
// A tally no handler read, as of an undo whose submit failed or that ran outside this handler, is not this one's.
|
|
91
|
+
takeUndoRedoTally(this.modelState);
|
|
92
|
+
try {
|
|
93
|
+
await (undo ? this.commandStack.undo() : this.commandStack.redo());
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
return [this.failure(direction, error)];
|
|
97
|
+
}
|
|
98
|
+
const actions = await this.modelSubmissionHandler.submitModel(direction);
|
|
99
|
+
const { skipped, applied } = takeUndoRedoTally(this.modelState);
|
|
100
|
+
if (skipped === 0) {
|
|
101
|
+
return actions;
|
|
102
|
+
}
|
|
103
|
+
const message = applied === 0
|
|
104
|
+
? undo
|
|
105
|
+
? DIAGRAM_UNDO_SKIPPED
|
|
106
|
+
: DIAGRAM_REDO_SKIPPED
|
|
107
|
+
: undo
|
|
108
|
+
? DIAGRAM_UNDO_PARTLY_SKIPPED
|
|
109
|
+
: DIAGRAM_REDO_PARTLY_SKIPPED;
|
|
110
|
+
return [MessageAction.create(this.render(message), { severity: 'WARNING' }), ...actions];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The message for an undo or redo that failed, logging a failure its
|
|
114
|
+
* reconcile has not. A conflict thrown rather than dropped, by a state that
|
|
115
|
+
* does not reconcile or a reconcile that could not read the text, is the
|
|
116
|
+
* same foreign edit as a dropped write and is told as one.
|
|
117
|
+
*/
|
|
118
|
+
failure(direction, error) {
|
|
119
|
+
const undo = direction === 'undo';
|
|
120
|
+
if (isDiagramEditDroppedError(error)) {
|
|
121
|
+
return MessageAction.create(this.render(undo ? DIAGRAM_UNDO_FAILED : DIAGRAM_REDO_FAILED), { severity: 'ERROR' });
|
|
122
|
+
}
|
|
123
|
+
logActionFailure(this.logger, undo ? UndoAction.create() : RedoAction.create(), error);
|
|
124
|
+
if (isConflictError(error)) {
|
|
125
|
+
// The conflict's own message names the document, which the details carry.
|
|
126
|
+
return MessageAction.create(this.render(undo ? DIAGRAM_UNDO_FAILED : DIAGRAM_REDO_FAILED), {
|
|
127
|
+
severity: 'ERROR',
|
|
128
|
+
details: describeError(error)
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return MessageAction.create(this.render(undo ? DIAGRAM_UNDO_ERROR : DIAGRAM_REDO_ERROR), {
|
|
132
|
+
severity: 'ERROR',
|
|
133
|
+
details: describeError(error)
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
render(message) {
|
|
137
|
+
return this.sharedServices.MessageRenderer.renderMessage(message);
|
|
138
|
+
}
|
|
32
139
|
};
|
|
33
140
|
__decorate([
|
|
34
141
|
inject(ModelState),
|
|
35
142
|
__metadata("design:type", Function)
|
|
36
143
|
], HydraniumGlspUndoRedoActionHandler.prototype, "modelState", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
inject(HydraniumTypes.SharedCoreServices),
|
|
146
|
+
__metadata("design:type", Object)
|
|
147
|
+
], HydraniumGlspUndoRedoActionHandler.prototype, "sharedServices", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
inject(Logger),
|
|
150
|
+
__metadata("design:type", Logger)
|
|
151
|
+
], HydraniumGlspUndoRedoActionHandler.prototype, "logger", void 0);
|
|
37
152
|
HydraniumGlspUndoRedoActionHandler = __decorate([
|
|
38
153
|
injectable()
|
|
39
154
|
], HydraniumGlspUndoRedoActionHandler);
|