@hydranium/glsp-server 1.0.0-next.23 → 1.0.0-next.25

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.
@@ -40,8 +40,15 @@ export function diagnosticsToMarkers(diagnostics, lookups) {
40
40
  * The ids of the elements drawn on this diagram for the diagnostic's target,
41
41
  * starting at the node it points at and walking up its containers; empty when
42
42
  * the path does not resolve or nothing on the chain is rendered.
43
+ *
44
+ * @param elementPath absent for a lexer or parser error, which Langium pushes
45
+ * onto the document without one — such a diagnostic points at text no node
46
+ * was built from, so it marks nothing.
43
47
  */
44
48
  function renderedElementIds(elementPath, lookups) {
49
+ if (elementPath === undefined) {
50
+ return [];
51
+ }
45
52
  let node = lookups.resolveElement(elementPath);
46
53
  while (node !== undefined) {
47
54
  const ids = lookups.renderedIdsFor(node);
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic-markers.js","sourceRoot":"","sources":["../../src/validation/diagnostic-markers.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAe,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAuB7E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAA6C,EAAE,OAAgC;IACjH,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC7C,0EAA0E;QAC1E,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACxD,KAAK,MAAM,SAAS,IAAI,kBAAkB,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;YACvE,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EA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AAC;QAC1B,KAAK,kBAAkB,CAAC,KAAK,CAAC;QAC9B;YACG,OAAO,UAAU,CAAC,KAAK,CAAC;IAC9B,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hydranium/glsp-server",
3
- "version": "1.0.0-next.23",
3
+ "version": "1.0.0-next.25",
4
4
  "description": "GLSP protocol head for the hydranium framework. Peer of @hydranium/core/lsp and @hydranium/data-server; built on @hydranium/core.",
5
5
  "keywords": [
6
6
  "hydranium",
@@ -79,9 +79,9 @@
79
79
  "devDependencies": {
80
80
  "@eclipse-glsp/protocol": "2.7.0",
81
81
  "@eclipse-glsp/server": "2.7.0",
82
- "@hydranium/core": "1.0.0-next.23",
83
- "@hydranium/langium": "1.0.0-next.23",
84
- "@hydranium/protocol": "1.0.0-next.23",
82
+ "@hydranium/core": "1.0.0-next.25",
83
+ "@hydranium/langium": "1.0.0-next.25",
84
+ "@hydranium/protocol": "1.0.0-next.25",
85
85
  "inversify": "6.2.2",
86
86
  "reflect-metadata": "0.2.2",
87
87
  "rimraf": "^5.0.0",
@@ -92,9 +92,9 @@
92
92
  "peerDependencies": {
93
93
  "@eclipse-glsp/protocol": "^2.6.0",
94
94
  "@eclipse-glsp/server": "^2.6.0",
95
- "@hydranium/core": "1.0.0-next.23",
96
- "@hydranium/langium": "1.0.0-next.23",
97
- "@hydranium/protocol": "1.0.0-next.23",
95
+ "@hydranium/core": "1.0.0-next.25",
96
+ "@hydranium/langium": "1.0.0-next.25",
97
+ "@hydranium/protocol": "1.0.0-next.25",
98
98
  "inversify": "^6.0.0",
99
99
  "reflect-metadata": "^0.2.2",
100
100
  "vscode-jsonrpc": "9.0.1",
@@ -65,8 +65,15 @@ export function diagnosticsToMarkers(diagnostics: readonly TransferLspDiagnostic
65
65
  * The ids of the elements drawn on this diagram for the diagnostic's target,
66
66
  * starting at the node it points at and walking up its containers; empty when
67
67
  * the path does not resolve or nothing on the chain is rendered.
68
+ *
69
+ * @param elementPath absent for a lexer or parser error, which Langium pushes
70
+ * onto the document without one — such a diagnostic points at text no node
71
+ * was built from, so it marks nothing.
68
72
  */
69
- function renderedElementIds(elementPath: string, lookups: DiagnosticMarkerLookups): readonly string[] {
73
+ function renderedElementIds(elementPath: string | undefined, lookups: DiagnosticMarkerLookups): readonly string[] {
74
+ if (elementPath === undefined) {
75
+ return [];
76
+ }
70
77
  let node: AstNode | undefined = lookups.resolveElement(elementPath);
71
78
  while (node !== undefined) {
72
79
  const ids = lookups.renderedIdsFor(node);