@eclipse-glsp/client 2.1.0-next.296 → 2.1.0-next.298
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/base/auto-complete/auto-complete-widget.d.ts +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +16 -0
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/command-stack.d.ts +22 -3
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +2 -2
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/default.module.d.ts +1 -1
- package/lib/base/default.module.d.ts.map +1 -1
- package/lib/base/default.module.js +2 -2
- package/lib/base/default.module.js.map +1 -1
- package/lib/base/selection-service.d.ts +18 -3
- package/lib/base/selection-service.d.ts.map +1 -1
- package/lib/base/selection-service.js +1 -1
- package/lib/base/selection-service.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/base/auto-complete/auto-complete-widget.ts +3 -2
- package/src/base/command-stack.ts +10 -5
- package/src/base/default.module.ts +2 -2
- package/src/base/selection-service.ts +12 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/client",
|
|
3
|
-
"version": "2.1.0-next.
|
|
3
|
+
"version": "2.1.0-next.298+3cf3749",
|
|
4
4
|
"description": "A sprotty-based client for GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"watch": "tsc -w"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@eclipse-glsp/sprotty": "2.1.0-next.
|
|
50
|
+
"@eclipse-glsp/sprotty": "2.1.0-next.298+3cf3749",
|
|
51
51
|
"autocompleter": "^9.1.0",
|
|
52
52
|
"file-saver": "^2.0.5",
|
|
53
53
|
"lodash": "4.17.21"
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "3cf3749eacd5084c1683210cc726d34db10b5e28"
|
|
63
63
|
}
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { AutocompleteResult, AutocompleteSettings } from 'autocompleter';
|
|
17
16
|
import {
|
|
18
17
|
Action,
|
|
18
|
+
GModelRoot,
|
|
19
19
|
ILogger,
|
|
20
20
|
LabeledAction,
|
|
21
|
-
GModelRoot,
|
|
22
21
|
ValidationStatus,
|
|
23
22
|
codiconCSSClasses,
|
|
24
23
|
matchesKeystroke,
|
|
25
24
|
toArray
|
|
26
25
|
} from '@eclipse-glsp/sprotty';
|
|
26
|
+
import { AutocompleteResult, AutocompleteSettings } from 'autocompleter';
|
|
27
27
|
import { AutoCompleteValue } from './auto-complete-actions';
|
|
28
28
|
import { IValidationDecorator } from './validation-decorator';
|
|
29
29
|
|
|
@@ -196,6 +196,7 @@ export class AutoCompleteWidget {
|
|
|
196
196
|
maxHeight: number
|
|
197
197
|
): void {
|
|
198
198
|
// move container into our UIExtension container as this is already positioned correctly
|
|
199
|
+
container.style.position = 'fixed';
|
|
199
200
|
if (this.containerElement) {
|
|
200
201
|
this.containerElement.appendChild(container);
|
|
201
202
|
|
|
@@ -13,33 +13,38 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { injectable, multiInject, optional, preDestroy } from 'inversify';
|
|
17
16
|
import {
|
|
18
17
|
CommandStack,
|
|
19
18
|
Disposable,
|
|
20
19
|
DisposableCollection,
|
|
21
20
|
Emitter,
|
|
22
21
|
Event,
|
|
23
|
-
ICommand,
|
|
24
22
|
GModelRoot,
|
|
23
|
+
ICommand,
|
|
25
24
|
SetModelCommand,
|
|
26
25
|
TYPES,
|
|
27
26
|
UpdateModelCommand
|
|
28
27
|
} from '@eclipse-glsp/sprotty';
|
|
28
|
+
import { injectable, multiInject, optional, preDestroy } from 'inversify';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* A hook to listen for model root changes. Will be called after a server update
|
|
32
32
|
* has been processed
|
|
33
33
|
*/
|
|
34
|
-
export interface
|
|
34
|
+
export interface IGModelRootListener {
|
|
35
35
|
modelRootChanged(root: Readonly<GModelRoot>): void;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use {@link IGModelRootListener} instead
|
|
40
|
+
*/
|
|
41
|
+
export type ISModelRootListener = IGModelRootListener;
|
|
42
|
+
|
|
38
43
|
@injectable()
|
|
39
44
|
export class GLSPCommandStack extends CommandStack implements Disposable {
|
|
40
|
-
@multiInject(TYPES.
|
|
45
|
+
@multiInject(TYPES.IGModelRootListener)
|
|
41
46
|
@optional()
|
|
42
|
-
protected modelRootListeners:
|
|
47
|
+
protected modelRootListeners: IGModelRootListener[] = [];
|
|
43
48
|
protected toDispose = new DisposableCollection();
|
|
44
49
|
|
|
45
50
|
protected override initialize(): void {
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import '@vscode/codicons/dist/codicon.css';
|
|
17
16
|
import {
|
|
18
17
|
ActionHandlerRegistry,
|
|
19
18
|
FeatureModule,
|
|
@@ -30,6 +29,7 @@ import {
|
|
|
30
29
|
configureCommand,
|
|
31
30
|
sprottyDefaultModule
|
|
32
31
|
} from '@eclipse-glsp/sprotty';
|
|
32
|
+
import '@vscode/codicons/dist/codicon.css';
|
|
33
33
|
import '../../css/glsp-sprotty.css';
|
|
34
34
|
import { GLSPActionDispatcher } from './action-dispatcher';
|
|
35
35
|
import { GLSPActionHandlerRegistry } from './action-handler-registry';
|
|
@@ -96,7 +96,7 @@ export const defaultModule = new FeatureModule((bind, unbind, isBound, rebind, .
|
|
|
96
96
|
bindOrRebind(context, TYPES.ViewRegistry).to(GViewRegistry).inSingletonScope();
|
|
97
97
|
|
|
98
98
|
bind(SelectionService).toSelf().inSingletonScope();
|
|
99
|
-
bind(TYPES.
|
|
99
|
+
bind(TYPES.IGModelRootListener).toService(SelectionService);
|
|
100
100
|
|
|
101
101
|
// Feedback Support ------------------------------------
|
|
102
102
|
// Generic re-usable feedback modifying css classes
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { inject, injectable, multiInject, optional, postConstruct, preDestroy } from 'inversify';
|
|
17
16
|
import {
|
|
18
17
|
Action,
|
|
19
18
|
Command,
|
|
@@ -23,9 +22,9 @@ import {
|
|
|
23
22
|
Emitter,
|
|
24
23
|
Event,
|
|
25
24
|
GChildElement,
|
|
26
|
-
ILogger,
|
|
27
25
|
GModelElement,
|
|
28
26
|
GModelRoot,
|
|
27
|
+
ILogger,
|
|
29
28
|
SelectAction,
|
|
30
29
|
SelectAllAction,
|
|
31
30
|
Selectable,
|
|
@@ -36,8 +35,9 @@ import {
|
|
|
36
35
|
isSelectable,
|
|
37
36
|
pluck
|
|
38
37
|
} from '@eclipse-glsp/sprotty';
|
|
38
|
+
import { inject, injectable, multiInject, optional, postConstruct, preDestroy } from 'inversify';
|
|
39
39
|
import { getElements, getMatchingElements } from '../utils/gmodel-util';
|
|
40
|
-
import {
|
|
40
|
+
import { IGModelRootListener } from './command-stack';
|
|
41
41
|
import { IFeedbackActionDispatcher } from './feedback/feedback-action-dispatcher';
|
|
42
42
|
|
|
43
43
|
export interface ISelectionListener {
|
|
@@ -51,7 +51,7 @@ export interface SelectionChange {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
@injectable()
|
|
54
|
-
export class SelectionService implements
|
|
54
|
+
export class SelectionService implements IGModelRootListener, Disposable {
|
|
55
55
|
protected root: Readonly<GModelRoot>;
|
|
56
56
|
protected selectedElementIDs: Set<string> = new Set();
|
|
57
57
|
|
|
@@ -197,7 +197,10 @@ export class SelectCommand extends Command {
|
|
|
197
197
|
protected selected: GModelElement[] = [];
|
|
198
198
|
protected deselected: GModelElement[] = [];
|
|
199
199
|
|
|
200
|
-
constructor(
|
|
200
|
+
constructor(
|
|
201
|
+
@inject(TYPES.Action) public action: SelectAction,
|
|
202
|
+
@inject(SelectionService) public selectionService: SelectionService
|
|
203
|
+
) {
|
|
201
204
|
super();
|
|
202
205
|
}
|
|
203
206
|
|
|
@@ -234,7 +237,10 @@ export class SelectAllCommand extends Command {
|
|
|
234
237
|
static readonly KIND = SprottySelectAllCommand.KIND;
|
|
235
238
|
protected previousSelection: Map<string, boolean> = new Map<string, boolean>();
|
|
236
239
|
|
|
237
|
-
constructor(
|
|
240
|
+
constructor(
|
|
241
|
+
@inject(TYPES.Action) public action: SelectAllAction,
|
|
242
|
+
@inject(SelectionService) public selectionService: SelectionService
|
|
243
|
+
) {
|
|
238
244
|
super();
|
|
239
245
|
}
|
|
240
246
|
|