@hydranium/core 1.0.0-next.94 → 1.0.0-next.95
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/langium/document-builder/build-pipeline-integration.d.ts +0 -9
- package/lib/langium/document-builder/build-pipeline-integration.d.ts.map +1 -1
- package/lib/langium/document-builder/build-pipeline-integration.js +4 -19
- package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -1
- package/package.json +5 -5
- package/src/langium/document-builder/build-pipeline-integration.ts +8 -21
|
@@ -22,15 +22,6 @@ import { type ServerSharedServices } from '../module.js';
|
|
|
22
22
|
* higher. See {@link BuildPipelineIntegrationOptions} to override.
|
|
23
23
|
*/
|
|
24
24
|
export declare const INTEGRITY_PASS_PRIORITY = -1000;
|
|
25
|
-
/**
|
|
26
|
-
* Default priority of the framework scope-cache pass. In the NEGATIVE
|
|
27
|
-
* foundational band for the reason {@link INTEGRITY_PASS_PRIORITY} gives: an
|
|
28
|
-
* adopter pass at `IndexedContent` takes the default `0`, and one running first
|
|
29
|
-
* reads scopes built from the mid-rebuild index. Sharing that constant's value
|
|
30
|
-
* is not sharing its knob — priority orders passes only within one phase
|
|
31
|
-
* bucket, and integrity registers at no phase this pass runs at.
|
|
32
|
-
*/
|
|
33
|
-
export declare const SCOPE_CACHE_PASS_PRIORITY = -1000;
|
|
34
25
|
/** Construction options for {@link BuildPipelineIntegration}. */
|
|
35
26
|
export interface BuildPipelineIntegrationOptions {
|
|
36
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-pipeline-integration.d.ts","sourceRoot":"","sources":["../../../src/langium/document-builder/build-pipeline-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAuCzD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"build-pipeline-integration.d.ts","sourceRoot":"","sources":["../../../src/langium/document-builder/build-pipeline-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAuCzD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAE7C,iEAAiE;AACjE,MAAM,WAAW,+BAA+B;IAC7C;;;;;;OAMG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;;;;GASG;AAEH,MAAM,WAAW,wBAAwB;CAAG;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,+BAAgC,YAAW,wBAAwB;IAE1E,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB;gBAA9B,QAAQ,EAAE,oBAAoB,EACjD,OAAO,GAAE,+BAAoC;IA8DhD;;;;;;;;;;OAUG;cACa,aAAa,CAC1B,SAAS,EAAE,SAAS,eAAe,EAAE,EACrC,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,iBAAiB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAYhB;;;;;;OAMG;IACH,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAMlC,oFAAoF;IACpF,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI;IAI1G;;;;;;;OAOG;IACH,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrI"}
|
|
@@ -57,15 +57,6 @@ const BUILD_PHASE_PASS_STATES = [
|
|
|
57
57
|
* higher. See {@link BuildPipelineIntegrationOptions} to override.
|
|
58
58
|
*/
|
|
59
59
|
export const INTEGRITY_PASS_PRIORITY = -1000;
|
|
60
|
-
/**
|
|
61
|
-
* Default priority of the framework scope-cache pass. In the NEGATIVE
|
|
62
|
-
* foundational band for the reason {@link INTEGRITY_PASS_PRIORITY} gives: an
|
|
63
|
-
* adopter pass at `IndexedContent` takes the default `0`, and one running first
|
|
64
|
-
* reads scopes built from the mid-rebuild index. Sharing that constant's value
|
|
65
|
-
* is not sharing its knob — priority orders passes only within one phase
|
|
66
|
-
* bucket, and integrity registers at no phase this pass runs at.
|
|
67
|
-
*/
|
|
68
|
-
export const SCOPE_CACHE_PASS_PRIORITY = -1000;
|
|
69
60
|
/**
|
|
70
61
|
* Wires the framework's build-time features (integrity rules, AST
|
|
71
62
|
* enrichment) into Langium's document-build pipeline. The single shared
|
|
@@ -112,16 +103,6 @@ export class DefaultBuildPipelineIntegration {
|
|
|
112
103
|
run: (documents, cancelToken) => this.callIntegrity(documents, phase, cancelToken)
|
|
113
104
|
});
|
|
114
105
|
}
|
|
115
|
-
// A pass rather than a listener each scope provider registers for itself,
|
|
116
|
-
// so an adopter pass at this phase is ordered against it by declaration
|
|
117
|
-
// instead of by DI construction order. `clearScopeCaches` carries why the
|
|
118
|
-
// caches' own eviction does not cover this.
|
|
119
|
-
passes.register({
|
|
120
|
-
id: 'framework:scope-cache:indexed-content',
|
|
121
|
-
state: DocumentState.IndexedContent,
|
|
122
|
-
priority: SCOPE_CACHE_PASS_PRIORITY,
|
|
123
|
-
run: () => this.clearScopeCaches()
|
|
124
|
-
});
|
|
125
106
|
// One onBuildPhase listener per pass state, routed through the overridable
|
|
126
107
|
// `runBuildPhase` seam → priority-ordered, sequential, cancel-aware pass
|
|
127
108
|
// dispatch. The returned promise is awaited by the build pipeline, so a
|
|
@@ -129,6 +110,10 @@ export class DefaultBuildPipelineIntegration {
|
|
|
129
110
|
for (const phase of BUILD_PHASE_PASS_STATES) {
|
|
130
111
|
builder.onBuildPhase(phase, labelPhaseListener((documents, cancelToken) => this.runBuildPhase(documents, phase, cancelToken), `BuildPipeline.runBuildPhase.${DocumentState[phase]}`));
|
|
131
112
|
}
|
|
113
|
+
// Per DOCUMENT as well: `reparseAndRelink` re-indexes one document from
|
|
114
|
+
// inside the `Linked` phase and fires no build-phase notification, so a
|
|
115
|
+
// batch-level listener cannot see the AST it replaced.
|
|
116
|
+
builder.onDocumentPhase(DocumentState.IndexedContent, labelPhaseListener(() => this.clearScopeCaches(), 'BuildPipeline.clearScopeCaches'));
|
|
132
117
|
// AST enrichment stays per-document (onDocumentPhase) and node-granular —
|
|
133
118
|
// unchanged by the build-phase-pass registry, which is batch-granular. The
|
|
134
119
|
// listener calls the `extendAst` seam directly (the document-phase analog of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-pipeline-integration.js","sourceRoot":"","sources":["../../../src/langium/document-builder/build-pipeline-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAwB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAA6B;IACpD,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,cAAc;IAC5B,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,iBAAiB;IAC/B,aAAa,CAAC,SAAS;CACzB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,uBAAuB,GAA6B;IACvD,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,cAAc;IAC5B,aAAa,CAAC,cAAc;IAC5B,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,iBAAiB;IAC/B,aAAa,CAAC,SAAS;CACzB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"build-pipeline-integration.js","sourceRoot":"","sources":["../../../src/langium/document-builder/build-pipeline-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAwB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAA6B;IACpD,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,cAAc;IAC5B,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,iBAAiB;IAC/B,aAAa,CAAC,SAAS;CACzB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,uBAAuB,GAA6B;IACvD,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,cAAc;IAC5B,aAAa,CAAC,cAAc;IAC5B,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,iBAAiB;IAC/B,aAAa,CAAC,SAAS;CACzB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAI,CAAC;AA2B7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,+BAA+B;IAEnB;IADtB,YACsB,QAA8B,EACjD,UAA2C,EAAE;QAD1B,aAAQ,GAAR,QAAQ,CAAsB;QAGjD,MAAM,OAAO,G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KAAK,EAAE,WAAW,CAAC,CAAC;IAChI,CAAC;IAED;;;;;;;OAOG;IACO,aAAa,CAAC,SAAqC,EAAE,KAAoB,EAAE,WAA8B;QAChH,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IACjG,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/core",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.95",
|
|
4
4
|
"description": "Foundational runtime of the hydranium framework: AST coordination layer (services, integrity, AST extension, serialization, multi-client documents) plus the LSP textual head at the /lsp subpath. Consumed by protocol-head packages (@hydranium/data-server, @hydranium/glsp-server).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"diff": "^5.2.0"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@hydranium/langium": "1.0.0-next.
|
|
108
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
107
|
+
"@hydranium/langium": "1.0.0-next.95",
|
|
108
|
+
"@hydranium/protocol": "1.0.0-next.95",
|
|
109
109
|
"@playwright/test": "^1.40.0",
|
|
110
110
|
"@types/diff": "^5.2.0",
|
|
111
111
|
"rimraf": "^5.0.0",
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"vscode-languageserver-types": "^3.17.5"
|
|
118
118
|
},
|
|
119
119
|
"peerDependencies": {
|
|
120
|
-
"@hydranium/langium": "1.0.0-next.
|
|
121
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
120
|
+
"@hydranium/langium": "1.0.0-next.95",
|
|
121
|
+
"@hydranium/protocol": "1.0.0-next.95",
|
|
122
122
|
"@playwright/test": "^1.40.0",
|
|
123
123
|
"vscode-jsonrpc": "9.0.1",
|
|
124
124
|
"vscode-languageserver": "~10.0.1",
|
|
@@ -64,16 +64,6 @@ const BUILD_PHASE_PASS_STATES: readonly DocumentState[] = [
|
|
|
64
64
|
*/
|
|
65
65
|
export const INTEGRITY_PASS_PRIORITY = -1000;
|
|
66
66
|
|
|
67
|
-
/**
|
|
68
|
-
* Default priority of the framework scope-cache pass. In the NEGATIVE
|
|
69
|
-
* foundational band for the reason {@link INTEGRITY_PASS_PRIORITY} gives: an
|
|
70
|
-
* adopter pass at `IndexedContent` takes the default `0`, and one running first
|
|
71
|
-
* reads scopes built from the mid-rebuild index. Sharing that constant's value
|
|
72
|
-
* is not sharing its knob — priority orders passes only within one phase
|
|
73
|
-
* bucket, and integrity registers at no phase this pass runs at.
|
|
74
|
-
*/
|
|
75
|
-
export const SCOPE_CACHE_PASS_PRIORITY = -1000;
|
|
76
|
-
|
|
77
67
|
/** Construction options for {@link BuildPipelineIntegration}. */
|
|
78
68
|
export interface BuildPipelineIntegrationOptions {
|
|
79
69
|
/**
|
|
@@ -148,17 +138,6 @@ export class DefaultBuildPipelineIntegration implements BuildPipelineIntegration
|
|
|
148
138
|
});
|
|
149
139
|
}
|
|
150
140
|
|
|
151
|
-
// A pass rather than a listener each scope provider registers for itself,
|
|
152
|
-
// so an adopter pass at this phase is ordered against it by declaration
|
|
153
|
-
// instead of by DI construction order. `clearScopeCaches` carries why the
|
|
154
|
-
// caches' own eviction does not cover this.
|
|
155
|
-
passes.register({
|
|
156
|
-
id: 'framework:scope-cache:indexed-content',
|
|
157
|
-
state: DocumentState.IndexedContent,
|
|
158
|
-
priority: SCOPE_CACHE_PASS_PRIORITY,
|
|
159
|
-
run: () => this.clearScopeCaches()
|
|
160
|
-
});
|
|
161
|
-
|
|
162
141
|
// One onBuildPhase listener per pass state, routed through the overridable
|
|
163
142
|
// `runBuildPhase` seam → priority-ordered, sequential, cancel-aware pass
|
|
164
143
|
// dispatch. The returned promise is awaited by the build pipeline, so a
|
|
@@ -173,6 +152,14 @@ export class DefaultBuildPipelineIntegration implements BuildPipelineIntegration
|
|
|
173
152
|
);
|
|
174
153
|
}
|
|
175
154
|
|
|
155
|
+
// Per DOCUMENT as well: `reparseAndRelink` re-indexes one document from
|
|
156
|
+
// inside the `Linked` phase and fires no build-phase notification, so a
|
|
157
|
+
// batch-level listener cannot see the AST it replaced.
|
|
158
|
+
builder.onDocumentPhase(
|
|
159
|
+
DocumentState.IndexedContent,
|
|
160
|
+
labelPhaseListener(() => this.clearScopeCaches(), 'BuildPipeline.clearScopeCaches')
|
|
161
|
+
);
|
|
162
|
+
|
|
176
163
|
// AST enrichment stays per-document (onDocumentPhase) and node-granular —
|
|
177
164
|
// unchanged by the build-phase-pass registry, which is batch-granular. The
|
|
178
165
|
// listener calls the `extendAst` seam directly (the document-phase analog of
|