@hydranium/glsp-client-theia 1.0.0-next.28 → 1.0.0-next.29

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.
@@ -8,6 +8,8 @@
8
8
  ********************************************************************************/
9
9
  import { GLSPDiagramManager } from '@eclipse-glsp/theia-integration';
10
10
  import { type GLSPDiagramLanguage } from '@eclipse-glsp/theia-integration/lib/common';
11
+ import { type GLSPDiagramWidget } from '@eclipse-glsp/theia-integration/lib/browser';
12
+ import { type WidgetOpenerOptions } from '@theia/core/lib/browser';
11
13
  /**
12
14
  * `GLSPDiagramManager` subclass that derives the language-correlated getters
13
15
  * (`fileExtensions`, `diagramType`, `contributionId`, `iconClass`) from a
@@ -42,5 +44,25 @@ export declare abstract class AbstractHydraniumGlspDiagramManager extends GLSPDi
42
44
  get contributionId(): string;
43
45
  get iconClass(): string;
44
46
  get label(): string;
47
+ /**
48
+ * Drops a `selection` key that is present but `undefined` before the base
49
+ * class reads it.
50
+ *
51
+ * Without this, opening a diagram from Theia's file picker throws and the
52
+ * editor never leaves "Loading diagram…". Upstream's
53
+ * `OptionsWithSelection.is` tests `'selection' in options`, which is true for
54
+ * a key explicitly set to `undefined`, and the branch it guards then calls
55
+ * `Object.keys` on that value. Theia's own `QuickFileOpenService` always sets
56
+ * the key — its `buildOpenerOptions` returns `{ selection: range }`, and
57
+ * `range` is `undefined` unless the query carried a `:line:column` suffix —
58
+ * so the crash is reached by the ordinary act of opening a diagram by name.
59
+ *
60
+ * Normalising the OPTIONS rather than rebinding
61
+ * `TheiaOpenerOptionsNavigationService`: the service is shared by every
62
+ * diagram type in the container, so replacing it would make one adopter's
63
+ * fix silently global, and the guard belongs where the value enters rather
64
+ * than where it is consumed. The base method stays the single implementation.
65
+ */
66
+ protected handleNavigations(widget: GLSPDiagramWidget, options?: WidgetOpenerOptions): boolean;
45
67
  }
46
68
  //# sourceMappingURL=glsp-diagram-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-diagram-manager.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAGtF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BACsB,mCAAoC,SAAQ,kBAAkB;IACjF,8EAA8E;IAC9E,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAEjE,wEAAwE;IACxE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAEjD,sFAAsF;IACtF,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAE5C,IAAa,cAAc,IAAI,MAAM,EAAE,CAEtC;IAED,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;CACH"}
1
+ {"version":3,"file":"glsp-diagram-manager.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BACsB,mCAAoC,SAAQ,kBAAkB;IACjF,8EAA8E;IAC9E,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAEjE,wEAAwE;IACxE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAEjD,sFAAsF;IACtF,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAE5C,IAAa,cAAc,IAAI,MAAM,EAAE,CAEtC;IAED,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;;;;;;;;;;;;;;;OAkBG;cACgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO;CAOzG"}
@@ -58,6 +58,32 @@ let AbstractHydraniumGlspDiagramManager = class AbstractHydraniumGlspDiagramMana
58
58
  get label() {
59
59
  return this.managerLabel;
60
60
  }
61
+ /**
62
+ * Drops a `selection` key that is present but `undefined` before the base
63
+ * class reads it.
64
+ *
65
+ * Without this, opening a diagram from Theia's file picker throws and the
66
+ * editor never leaves "Loading diagram…". Upstream's
67
+ * `OptionsWithSelection.is` tests `'selection' in options`, which is true for
68
+ * a key explicitly set to `undefined`, and the branch it guards then calls
69
+ * `Object.keys` on that value. Theia's own `QuickFileOpenService` always sets
70
+ * the key — its `buildOpenerOptions` returns `{ selection: range }`, and
71
+ * `range` is `undefined` unless the query carried a `:line:column` suffix —
72
+ * so the crash is reached by the ordinary act of opening a diagram by name.
73
+ *
74
+ * Normalising the OPTIONS rather than rebinding
75
+ * `TheiaOpenerOptionsNavigationService`: the service is shared by every
76
+ * diagram type in the container, so replacing it would make one adopter's
77
+ * fix silently global, and the guard belongs where the value enters rather
78
+ * than where it is consumed. The base method stays the single implementation.
79
+ */
80
+ handleNavigations(widget, options) {
81
+ if (options && 'selection' in options && options.selection === undefined) {
82
+ const { selection: _dropped, ...rest } = options;
83
+ return super.handleNavigations(widget, rest);
84
+ }
85
+ return super.handleNavigations(widget, options);
86
+ }
61
87
  };
62
88
  exports.AbstractHydraniumGlspDiagramManager = AbstractHydraniumGlspDiagramManager;
63
89
  exports.AbstractHydraniumGlspDiagramManager = AbstractHydraniumGlspDiagramManager = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-diagram-manager.js","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAAwD;AACxD,uEAAqE;AAErE,4DAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEI,IAAe,mCAAmC,GAAlD,MAAe,mCAAoC,SAAQ,sCAAkB;IAOjF,sFAAsF;IACnE,eAAe,CAAU;IAE5C,IAAa,cAAc;QACxB,OAAO,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,IAAa,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;IAC3C,CAAC;IAED,IAAa,cAAc;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC;IAC9C,CAAC;IAED,IAAa,SAAS;QACnB,OAAO,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,IAAI,IAAA,yBAAgB,EAAC,oBAAoB,CAAC,CAAC;IAC3G,CAAC;IAED,IAAI,KAAK;QACN,OAAO,IAAI,CAAC,YAAY,CAAC;IAC5B,CAAC;CACH,CAAA;AA7BqB,kFAAmC;8CAAnC,mCAAmC;IADxD,IAAA,sBAAU,GAAE;GACS,mCAAmC,CA6BxD"}
1
+ {"version":3,"file":"glsp-diagram-manager.js","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAAwD;AACxD,uEAAqE;AAIrE,4DAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEI,IAAe,mCAAmC,GAAlD,MAAe,mCAAoC,SAAQ,sCAAkB;IAOjF,sFAAsF;IACnE,eAAe,CAAU;IAE5C,IAAa,cAAc;QACxB,OAAO,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,IAAa,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;IAC3C,CAAC;IAED,IAAa,cAAc;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC;IAC9C,CAAC;IAED,IAAa,SAAS;QACnB,OAAO,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,IAAI,IAAA,yBAAgB,EAAC,oBAAoB,CAAC,CAAC;IAC3G,CAAC;IAED,IAAI,KAAK;QACN,OAAO,IAAI,CAAC,YAAY,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACgB,iBAAiB,CAAC,MAAyB,EAAE,OAA6B;QAC1F,IAAI,OAAO,IAAI,WAAW,IAAI,OAAO,IAAK,OAAmC,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACrG,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,OAAwD,CAAC;YAClG,OAAO,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACH,CAAA;AAxDqB,kFAAmC;8CAAnC,mCAAmC;IADxD,IAAA,sBAAU,GAAE;GACS,mCAAmC,CAwDxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hydranium/glsp-client-theia",
3
- "version": "1.0.0-next.28",
3
+ "version": "1.0.0-next.29",
4
4
  "description": "Theia-coupled client primitives for GLSP heads built on @hydranium/glsp-server. Provides the action dispatcher, channel logger, and connection-handler bases that Theia-based adopters extend; companion of @hydranium/glsp-server.",
5
5
  "keywords": [
6
6
  "hydranium",
@@ -78,8 +78,8 @@
78
78
  "devDependencies": {
79
79
  "@eclipse-glsp/client": "2.7.0",
80
80
  "@eclipse-glsp/theia-integration": "2.7.0",
81
- "@hydranium/client-theia": "1.0.0-next.28",
82
- "@hydranium/protocol": "1.0.0-next.28",
81
+ "@hydranium/client-theia": "1.0.0-next.29",
82
+ "@hydranium/protocol": "1.0.0-next.29",
83
83
  "@theia/core": "^1.70.0",
84
84
  "@theia/output": "^1.70.0",
85
85
  "@theia/process": "^1.70.0",
@@ -93,8 +93,8 @@
93
93
  "peerDependencies": {
94
94
  "@eclipse-glsp/client": "^2.6.0",
95
95
  "@eclipse-glsp/theia-integration": "^2.6.0",
96
- "@hydranium/client-theia": "1.0.0-next.28",
97
- "@hydranium/protocol": "1.0.0-next.28",
96
+ "@hydranium/client-theia": "1.0.0-next.29",
97
+ "@hydranium/protocol": "1.0.0-next.29",
98
98
  "@theia/core": "^1.70.0",
99
99
  "@theia/output": "^1.70.0",
100
100
  "@theia/process": "^1.70.0",
@@ -10,6 +10,8 @@
10
10
  import { codiconCSSString } from '@eclipse-glsp/client';
11
11
  import { GLSPDiagramManager } from '@eclipse-glsp/theia-integration';
12
12
  import { type GLSPDiagramLanguage } from '@eclipse-glsp/theia-integration/lib/common';
13
+ import { type GLSPDiagramWidget } from '@eclipse-glsp/theia-integration/lib/browser';
14
+ import { type WidgetOpenerOptions } from '@theia/core/lib/browser';
13
15
  import { injectable } from '@theia/core/shared/inversify';
14
16
 
15
17
  /**
@@ -64,4 +66,31 @@ export abstract class AbstractHydraniumGlspDiagramManager extends GLSPDiagramMan
64
66
  get label(): string {
65
67
  return this.managerLabel;
66
68
  }
69
+
70
+ /**
71
+ * Drops a `selection` key that is present but `undefined` before the base
72
+ * class reads it.
73
+ *
74
+ * Without this, opening a diagram from Theia's file picker throws and the
75
+ * editor never leaves "Loading diagram…". Upstream's
76
+ * `OptionsWithSelection.is` tests `'selection' in options`, which is true for
77
+ * a key explicitly set to `undefined`, and the branch it guards then calls
78
+ * `Object.keys` on that value. Theia's own `QuickFileOpenService` always sets
79
+ * the key — its `buildOpenerOptions` returns `{ selection: range }`, and
80
+ * `range` is `undefined` unless the query carried a `:line:column` suffix —
81
+ * so the crash is reached by the ordinary act of opening a diagram by name.
82
+ *
83
+ * Normalising the OPTIONS rather than rebinding
84
+ * `TheiaOpenerOptionsNavigationService`: the service is shared by every
85
+ * diagram type in the container, so replacing it would make one adopter's
86
+ * fix silently global, and the guard belongs where the value enters rather
87
+ * than where it is consumed. The base method stays the single implementation.
88
+ */
89
+ protected override handleNavigations(widget: GLSPDiagramWidget, options?: WidgetOpenerOptions): boolean {
90
+ if (options && 'selection' in options && (options as { selection?: unknown }).selection === undefined) {
91
+ const { selection: _dropped, ...rest } = options as WidgetOpenerOptions & { selection?: unknown };
92
+ return super.handleNavigations(widget, rest);
93
+ }
94
+ return super.handleNavigations(widget, options);
95
+ }
67
96
  }