sysml-validate 0.10.17 → 0.10.18
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/README.md +18 -18
- package/out/main.js +512 -450
- package/out/main.js.map +4 -4
- package/package.json +9 -9
- package/resources/sysml.dimension-table.json +1 -1
package/out/main.js
CHANGED
|
@@ -717,22 +717,22 @@ var require_linkedMap = __commonJS({
|
|
|
717
717
|
}
|
|
718
718
|
forEach(callbackfn, thisArg) {
|
|
719
719
|
const state = this._state;
|
|
720
|
-
let
|
|
721
|
-
while (
|
|
720
|
+
let current2 = this._head;
|
|
721
|
+
while (current2) {
|
|
722
722
|
if (thisArg) {
|
|
723
|
-
callbackfn.bind(thisArg)(
|
|
723
|
+
callbackfn.bind(thisArg)(current2.value, current2.key, this);
|
|
724
724
|
} else {
|
|
725
|
-
callbackfn(
|
|
725
|
+
callbackfn(current2.value, current2.key, this);
|
|
726
726
|
}
|
|
727
727
|
if (this._state !== state) {
|
|
728
728
|
throw new Error(`LinkedMap got modified during iteration.`);
|
|
729
729
|
}
|
|
730
|
-
|
|
730
|
+
current2 = current2.next;
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
keys() {
|
|
734
734
|
const state = this._state;
|
|
735
|
-
let
|
|
735
|
+
let current2 = this._head;
|
|
736
736
|
const iterator = {
|
|
737
737
|
[Symbol.iterator]: () => {
|
|
738
738
|
return iterator;
|
|
@@ -741,9 +741,9 @@ var require_linkedMap = __commonJS({
|
|
|
741
741
|
if (this._state !== state) {
|
|
742
742
|
throw new Error(`LinkedMap got modified during iteration.`);
|
|
743
743
|
}
|
|
744
|
-
if (
|
|
745
|
-
const result = { value:
|
|
746
|
-
|
|
744
|
+
if (current2) {
|
|
745
|
+
const result = { value: current2.key, done: false };
|
|
746
|
+
current2 = current2.next;
|
|
747
747
|
return result;
|
|
748
748
|
} else {
|
|
749
749
|
return { value: void 0, done: true };
|
|
@@ -754,7 +754,7 @@ var require_linkedMap = __commonJS({
|
|
|
754
754
|
}
|
|
755
755
|
values() {
|
|
756
756
|
const state = this._state;
|
|
757
|
-
let
|
|
757
|
+
let current2 = this._head;
|
|
758
758
|
const iterator = {
|
|
759
759
|
[Symbol.iterator]: () => {
|
|
760
760
|
return iterator;
|
|
@@ -763,9 +763,9 @@ var require_linkedMap = __commonJS({
|
|
|
763
763
|
if (this._state !== state) {
|
|
764
764
|
throw new Error(`LinkedMap got modified during iteration.`);
|
|
765
765
|
}
|
|
766
|
-
if (
|
|
767
|
-
const result = { value:
|
|
768
|
-
|
|
766
|
+
if (current2) {
|
|
767
|
+
const result = { value: current2.value, done: false };
|
|
768
|
+
current2 = current2.next;
|
|
769
769
|
return result;
|
|
770
770
|
} else {
|
|
771
771
|
return { value: void 0, done: true };
|
|
@@ -776,7 +776,7 @@ var require_linkedMap = __commonJS({
|
|
|
776
776
|
}
|
|
777
777
|
entries() {
|
|
778
778
|
const state = this._state;
|
|
779
|
-
let
|
|
779
|
+
let current2 = this._head;
|
|
780
780
|
const iterator = {
|
|
781
781
|
[Symbol.iterator]: () => {
|
|
782
782
|
return iterator;
|
|
@@ -785,9 +785,9 @@ var require_linkedMap = __commonJS({
|
|
|
785
785
|
if (this._state !== state) {
|
|
786
786
|
throw new Error(`LinkedMap got modified during iteration.`);
|
|
787
787
|
}
|
|
788
|
-
if (
|
|
789
|
-
const result = { value: [
|
|
790
|
-
|
|
788
|
+
if (current2) {
|
|
789
|
+
const result = { value: [current2.key, current2.value], done: false };
|
|
790
|
+
current2 = current2.next;
|
|
791
791
|
return result;
|
|
792
792
|
} else {
|
|
793
793
|
return { value: void 0, done: true };
|
|
@@ -807,17 +807,17 @@ var require_linkedMap = __commonJS({
|
|
|
807
807
|
this.clear();
|
|
808
808
|
return;
|
|
809
809
|
}
|
|
810
|
-
let
|
|
810
|
+
let current2 = this._head;
|
|
811
811
|
let currentSize = this.size;
|
|
812
|
-
while (
|
|
813
|
-
this._map.delete(
|
|
814
|
-
|
|
812
|
+
while (current2 && currentSize > newSize) {
|
|
813
|
+
this._map.delete(current2.key);
|
|
814
|
+
current2 = current2.next;
|
|
815
815
|
currentSize--;
|
|
816
816
|
}
|
|
817
|
-
this._head =
|
|
817
|
+
this._head = current2;
|
|
818
818
|
this._size = currentSize;
|
|
819
|
-
if (
|
|
820
|
-
|
|
819
|
+
if (current2) {
|
|
820
|
+
current2.previous = void 0;
|
|
821
821
|
}
|
|
822
822
|
this._state++;
|
|
823
823
|
}
|
|
@@ -3098,7 +3098,7 @@ var require_main = __commonJS({
|
|
|
3098
3098
|
exports2.createMessageConnection = exports2.createServerSocketTransport = exports2.createClientSocketTransport = exports2.createServerPipeTransport = exports2.createClientPipeTransport = exports2.generateRandomPipeName = exports2.StreamMessageWriter = exports2.StreamMessageReader = exports2.SocketMessageWriter = exports2.SocketMessageReader = exports2.PortMessageWriter = exports2.PortMessageReader = exports2.IPCMessageWriter = exports2.IPCMessageReader = void 0;
|
|
3099
3099
|
var ril_1 = require_ril();
|
|
3100
3100
|
ril_1.default.install();
|
|
3101
|
-
var
|
|
3101
|
+
var path10 = __require("path");
|
|
3102
3102
|
var os2 = __require("os");
|
|
3103
3103
|
var crypto_1 = __require("crypto");
|
|
3104
3104
|
var net_1 = __require("net");
|
|
@@ -3234,9 +3234,9 @@ var require_main = __commonJS({
|
|
|
3234
3234
|
}
|
|
3235
3235
|
let result;
|
|
3236
3236
|
if (XDG_RUNTIME_DIR) {
|
|
3237
|
-
result =
|
|
3237
|
+
result = path10.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
|
|
3238
3238
|
} else {
|
|
3239
|
-
result =
|
|
3239
|
+
result = path10.join(os2.tmpdir(), `vscode-${randomSuffix}.sock`);
|
|
3240
3240
|
}
|
|
3241
3241
|
const limit = safeIpcPathLengths.get(process.platform);
|
|
3242
3242
|
if (limit !== void 0 && result.length > limit) {
|
|
@@ -8326,8 +8326,8 @@ var require_files = __commonJS({
|
|
|
8326
8326
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
8327
8327
|
exports2.resolveModulePath = exports2.FileSystem = exports2.resolveGlobalYarnPath = exports2.resolveGlobalNodePath = exports2.resolve = exports2.uriToFilePath = void 0;
|
|
8328
8328
|
var url = __require("url");
|
|
8329
|
-
var
|
|
8330
|
-
var
|
|
8329
|
+
var path10 = __require("path");
|
|
8330
|
+
var fs9 = __require("fs");
|
|
8331
8331
|
var child_process_1 = __require("child_process");
|
|
8332
8332
|
function uriToFilePath(uri) {
|
|
8333
8333
|
let parsed = url.parse(uri);
|
|
@@ -8345,7 +8345,7 @@ var require_files = __commonJS({
|
|
|
8345
8345
|
segments.shift();
|
|
8346
8346
|
}
|
|
8347
8347
|
}
|
|
8348
|
-
return
|
|
8348
|
+
return path10.normalize(segments.join("/"));
|
|
8349
8349
|
}
|
|
8350
8350
|
exports2.uriToFilePath = uriToFilePath;
|
|
8351
8351
|
function isWindows() {
|
|
@@ -8374,9 +8374,9 @@ var require_files = __commonJS({
|
|
|
8374
8374
|
let env = process.env;
|
|
8375
8375
|
let newEnv = /* @__PURE__ */ Object.create(null);
|
|
8376
8376
|
Object.keys(env).forEach((key) => newEnv[key] = env[key]);
|
|
8377
|
-
if (nodePath &&
|
|
8377
|
+
if (nodePath && fs9.existsSync(nodePath)) {
|
|
8378
8378
|
if (newEnv[nodePathKey]) {
|
|
8379
|
-
newEnv[nodePathKey] = nodePath +
|
|
8379
|
+
newEnv[nodePathKey] = nodePath + path10.delimiter + newEnv[nodePathKey];
|
|
8380
8380
|
} else {
|
|
8381
8381
|
newEnv[nodePathKey] = nodePath;
|
|
8382
8382
|
}
|
|
@@ -8449,9 +8449,9 @@ var require_files = __commonJS({
|
|
|
8449
8449
|
}
|
|
8450
8450
|
if (prefix.length > 0) {
|
|
8451
8451
|
if (isWindows()) {
|
|
8452
|
-
return
|
|
8452
|
+
return path10.join(prefix, "node_modules");
|
|
8453
8453
|
} else {
|
|
8454
|
-
return
|
|
8454
|
+
return path10.join(prefix, "lib", "node_modules");
|
|
8455
8455
|
}
|
|
8456
8456
|
}
|
|
8457
8457
|
return void 0;
|
|
@@ -8491,7 +8491,7 @@ var require_files = __commonJS({
|
|
|
8491
8491
|
try {
|
|
8492
8492
|
let yarn = JSON.parse(line);
|
|
8493
8493
|
if (yarn.type === "log") {
|
|
8494
|
-
return
|
|
8494
|
+
return path10.join(yarn.data, "node_modules");
|
|
8495
8495
|
}
|
|
8496
8496
|
} catch (e) {
|
|
8497
8497
|
}
|
|
@@ -8514,24 +8514,24 @@ var require_files = __commonJS({
|
|
|
8514
8514
|
if (process.platform === "win32") {
|
|
8515
8515
|
_isCaseSensitive = false;
|
|
8516
8516
|
} else {
|
|
8517
|
-
_isCaseSensitive = !
|
|
8517
|
+
_isCaseSensitive = !fs9.existsSync(__filename.toUpperCase()) || !fs9.existsSync(__filename.toLowerCase());
|
|
8518
8518
|
}
|
|
8519
8519
|
return _isCaseSensitive;
|
|
8520
8520
|
}
|
|
8521
8521
|
FileSystem2.isCaseSensitive = isCaseSensitive;
|
|
8522
8522
|
function isParent(parent, child) {
|
|
8523
8523
|
if (isCaseSensitive()) {
|
|
8524
|
-
return
|
|
8524
|
+
return path10.normalize(child).indexOf(path10.normalize(parent)) === 0;
|
|
8525
8525
|
} else {
|
|
8526
|
-
return
|
|
8526
|
+
return path10.normalize(child).toLowerCase().indexOf(path10.normalize(parent).toLowerCase()) === 0;
|
|
8527
8527
|
}
|
|
8528
8528
|
}
|
|
8529
8529
|
FileSystem2.isParent = isParent;
|
|
8530
8530
|
})(FileSystem || (exports2.FileSystem = FileSystem = {}));
|
|
8531
8531
|
function resolveModulePath(workspaceRoot, moduleName, nodePath, tracer) {
|
|
8532
8532
|
if (nodePath) {
|
|
8533
|
-
if (!
|
|
8534
|
-
nodePath =
|
|
8533
|
+
if (!path10.isAbsolute(nodePath)) {
|
|
8534
|
+
nodePath = path10.join(workspaceRoot, nodePath);
|
|
8535
8535
|
}
|
|
8536
8536
|
return resolve7(moduleName, nodePath, nodePath, tracer).then((value) => {
|
|
8537
8537
|
if (FileSystem.isParent(nodePath, value)) {
|
|
@@ -8885,8 +8885,8 @@ ${stack}`);
|
|
|
8885
8885
|
});
|
|
8886
8886
|
|
|
8887
8887
|
// src/main.ts
|
|
8888
|
-
import * as
|
|
8889
|
-
import * as
|
|
8888
|
+
import * as fs8 from "fs";
|
|
8889
|
+
import * as path9 from "path";
|
|
8890
8890
|
import { fileURLToPath as fileURLToPath2, pathToFileURL } from "url";
|
|
8891
8891
|
|
|
8892
8892
|
// src/args.ts
|
|
@@ -9197,8 +9197,8 @@ function formatReport(run, options) {
|
|
|
9197
9197
|
}
|
|
9198
9198
|
|
|
9199
9199
|
// src/validate.ts
|
|
9200
|
-
import * as
|
|
9201
|
-
import * as
|
|
9200
|
+
import * as fs7 from "fs";
|
|
9201
|
+
import * as path8 from "path";
|
|
9202
9202
|
import { fileURLToPath } from "url";
|
|
9203
9203
|
|
|
9204
9204
|
// ../../node_modules/.pnpm/langium@3.5.0/node_modules/langium/lib/index.js
|
|
@@ -10089,12 +10089,12 @@ function getInteriorNodes(start, end) {
|
|
|
10089
10089
|
function getCommonParent(a2, b) {
|
|
10090
10090
|
const aParents = getParentChain(a2);
|
|
10091
10091
|
const bParents = getParentChain(b);
|
|
10092
|
-
let
|
|
10092
|
+
let current2;
|
|
10093
10093
|
for (let i = 0; i < aParents.length && i < bParents.length; i++) {
|
|
10094
10094
|
const aParent = aParents[i];
|
|
10095
10095
|
const bParent = bParents[i];
|
|
10096
10096
|
if (aParent.parent === bParent.parent) {
|
|
10097
|
-
|
|
10097
|
+
current2 = {
|
|
10098
10098
|
parent: aParent.parent,
|
|
10099
10099
|
a: aParent.index,
|
|
10100
10100
|
b: bParent.index
|
|
@@ -10103,7 +10103,7 @@ function getCommonParent(a2, b) {
|
|
|
10103
10103
|
break;
|
|
10104
10104
|
}
|
|
10105
10105
|
}
|
|
10106
|
-
return
|
|
10106
|
+
return current2;
|
|
10107
10107
|
}
|
|
10108
10108
|
function getParentChain(node) {
|
|
10109
10109
|
const chain = [];
|
|
@@ -13865,19 +13865,19 @@ function toKey(value) {
|
|
|
13865
13865
|
var toKey_default = toKey;
|
|
13866
13866
|
|
|
13867
13867
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js
|
|
13868
|
-
function baseGet(object,
|
|
13869
|
-
|
|
13870
|
-
var index = 0, length =
|
|
13868
|
+
function baseGet(object, path10) {
|
|
13869
|
+
path10 = castPath_default(path10, object);
|
|
13870
|
+
var index = 0, length = path10.length;
|
|
13871
13871
|
while (object != null && index < length) {
|
|
13872
|
-
object = object[toKey_default(
|
|
13872
|
+
object = object[toKey_default(path10[index++])];
|
|
13873
13873
|
}
|
|
13874
13874
|
return index && index == length ? object : void 0;
|
|
13875
13875
|
}
|
|
13876
13876
|
var baseGet_default = baseGet;
|
|
13877
13877
|
|
|
13878
13878
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js
|
|
13879
|
-
function get(object,
|
|
13880
|
-
var result = object == null ? void 0 : baseGet_default(object,
|
|
13879
|
+
function get(object, path10, defaultValue) {
|
|
13880
|
+
var result = object == null ? void 0 : baseGet_default(object, path10);
|
|
13881
13881
|
return result === void 0 ? defaultValue : result;
|
|
13882
13882
|
}
|
|
13883
13883
|
var get_default = get;
|
|
@@ -14789,11 +14789,11 @@ function baseHasIn(object, key) {
|
|
|
14789
14789
|
var baseHasIn_default = baseHasIn;
|
|
14790
14790
|
|
|
14791
14791
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js
|
|
14792
|
-
function hasPath(object,
|
|
14793
|
-
|
|
14794
|
-
var index = -1, length =
|
|
14792
|
+
function hasPath(object, path10, hasFunc) {
|
|
14793
|
+
path10 = castPath_default(path10, object);
|
|
14794
|
+
var index = -1, length = path10.length, result = false;
|
|
14795
14795
|
while (++index < length) {
|
|
14796
|
-
var key = toKey_default(
|
|
14796
|
+
var key = toKey_default(path10[index]);
|
|
14797
14797
|
if (!(result = object != null && hasFunc(object, key))) {
|
|
14798
14798
|
break;
|
|
14799
14799
|
}
|
|
@@ -14808,21 +14808,21 @@ function hasPath(object, path12, hasFunc) {
|
|
|
14808
14808
|
var hasPath_default = hasPath;
|
|
14809
14809
|
|
|
14810
14810
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js
|
|
14811
|
-
function hasIn(object,
|
|
14812
|
-
return object != null && hasPath_default(object,
|
|
14811
|
+
function hasIn(object, path10) {
|
|
14812
|
+
return object != null && hasPath_default(object, path10, baseHasIn_default);
|
|
14813
14813
|
}
|
|
14814
14814
|
var hasIn_default = hasIn;
|
|
14815
14815
|
|
|
14816
14816
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js
|
|
14817
14817
|
var COMPARE_PARTIAL_FLAG6 = 1;
|
|
14818
14818
|
var COMPARE_UNORDERED_FLAG4 = 2;
|
|
14819
|
-
function baseMatchesProperty(
|
|
14820
|
-
if (isKey_default(
|
|
14821
|
-
return matchesStrictComparable_default(toKey_default(
|
|
14819
|
+
function baseMatchesProperty(path10, srcValue) {
|
|
14820
|
+
if (isKey_default(path10) && isStrictComparable_default(srcValue)) {
|
|
14821
|
+
return matchesStrictComparable_default(toKey_default(path10), srcValue);
|
|
14822
14822
|
}
|
|
14823
14823
|
return function(object) {
|
|
14824
|
-
var objValue = get_default(object,
|
|
14825
|
-
return objValue === void 0 && objValue === srcValue ? hasIn_default(object,
|
|
14824
|
+
var objValue = get_default(object, path10);
|
|
14825
|
+
return objValue === void 0 && objValue === srcValue ? hasIn_default(object, path10) : baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG6 | COMPARE_UNORDERED_FLAG4);
|
|
14826
14826
|
};
|
|
14827
14827
|
}
|
|
14828
14828
|
var baseMatchesProperty_default = baseMatchesProperty;
|
|
@@ -14836,16 +14836,16 @@ function baseProperty(key) {
|
|
|
14836
14836
|
var baseProperty_default = baseProperty;
|
|
14837
14837
|
|
|
14838
14838
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js
|
|
14839
|
-
function basePropertyDeep(
|
|
14839
|
+
function basePropertyDeep(path10) {
|
|
14840
14840
|
return function(object) {
|
|
14841
|
-
return baseGet_default(object,
|
|
14841
|
+
return baseGet_default(object, path10);
|
|
14842
14842
|
};
|
|
14843
14843
|
}
|
|
14844
14844
|
var basePropertyDeep_default = basePropertyDeep;
|
|
14845
14845
|
|
|
14846
14846
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js
|
|
14847
|
-
function property(
|
|
14848
|
-
return isKey_default(
|
|
14847
|
+
function property(path10) {
|
|
14848
|
+
return isKey_default(path10) ? baseProperty_default(toKey_default(path10)) : basePropertyDeep_default(path10);
|
|
14849
14849
|
}
|
|
14850
14850
|
var property_default = property;
|
|
14851
14851
|
|
|
@@ -15213,8 +15213,8 @@ function baseHas(object, key) {
|
|
|
15213
15213
|
var baseHas_default = baseHas;
|
|
15214
15214
|
|
|
15215
15215
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/has.js
|
|
15216
|
-
function has(object,
|
|
15217
|
-
return object != null && hasPath_default(object,
|
|
15216
|
+
function has(object, path10) {
|
|
15217
|
+
return object != null && hasPath_default(object, path10, baseHas_default);
|
|
15218
15218
|
}
|
|
15219
15219
|
var has_default = has;
|
|
15220
15220
|
|
|
@@ -15337,14 +15337,14 @@ function negate(predicate) {
|
|
|
15337
15337
|
var negate_default = negate;
|
|
15338
15338
|
|
|
15339
15339
|
// ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSet.js
|
|
15340
|
-
function baseSet(object,
|
|
15340
|
+
function baseSet(object, path10, value, customizer) {
|
|
15341
15341
|
if (!isObject_default(object)) {
|
|
15342
15342
|
return object;
|
|
15343
15343
|
}
|
|
15344
|
-
|
|
15345
|
-
var index = -1, length =
|
|
15344
|
+
path10 = castPath_default(path10, object);
|
|
15345
|
+
var index = -1, length = path10.length, lastIndex = length - 1, nested = object;
|
|
15346
15346
|
while (nested != null && ++index < length) {
|
|
15347
|
-
var key = toKey_default(
|
|
15347
|
+
var key = toKey_default(path10[index]), newValue = value;
|
|
15348
15348
|
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
15349
15349
|
return object;
|
|
15350
15350
|
}
|
|
@@ -15352,7 +15352,7 @@ function baseSet(object, path12, value, customizer) {
|
|
|
15352
15352
|
var objValue = nested[key];
|
|
15353
15353
|
newValue = customizer ? customizer(objValue, key, nested) : void 0;
|
|
15354
15354
|
if (newValue === void 0) {
|
|
15355
|
-
newValue = isObject_default(objValue) ? objValue : isIndex_default(
|
|
15355
|
+
newValue = isObject_default(objValue) ? objValue : isIndex_default(path10[index + 1]) ? [] : {};
|
|
15356
15356
|
}
|
|
15357
15357
|
}
|
|
15358
15358
|
assignValue_default(nested, key, newValue);
|
|
@@ -15366,9 +15366,9 @@ var baseSet_default = baseSet;
|
|
|
15366
15366
|
function basePickBy(object, paths, predicate) {
|
|
15367
15367
|
var index = -1, length = paths.length, result = {};
|
|
15368
15368
|
while (++index < length) {
|
|
15369
|
-
var
|
|
15370
|
-
if (predicate(value,
|
|
15371
|
-
baseSet_default(result, castPath_default(
|
|
15369
|
+
var path10 = paths[index], value = baseGet_default(object, path10);
|
|
15370
|
+
if (predicate(value, path10)) {
|
|
15371
|
+
baseSet_default(result, castPath_default(path10, object), value);
|
|
15372
15372
|
}
|
|
15373
15373
|
}
|
|
15374
15374
|
return result;
|
|
@@ -15384,8 +15384,8 @@ function pickBy(object, predicate) {
|
|
|
15384
15384
|
return [prop];
|
|
15385
15385
|
});
|
|
15386
15386
|
predicate = baseIteratee_default(predicate);
|
|
15387
|
-
return basePickBy_default(object, props, function(value,
|
|
15388
|
-
return predicate(value,
|
|
15387
|
+
return basePickBy_default(object, props, function(value, path10) {
|
|
15388
|
+
return predicate(value, path10[0]);
|
|
15389
15389
|
});
|
|
15390
15390
|
}
|
|
15391
15391
|
var pickBy_default = pickBy;
|
|
@@ -16983,12 +16983,12 @@ function assignCategoriesMapProp(tokenTypes) {
|
|
|
16983
16983
|
singleAssignCategoriesToksMap([], currTokType);
|
|
16984
16984
|
});
|
|
16985
16985
|
}
|
|
16986
|
-
function singleAssignCategoriesToksMap(
|
|
16987
|
-
forEach_default(
|
|
16986
|
+
function singleAssignCategoriesToksMap(path10, nextNode) {
|
|
16987
|
+
forEach_default(path10, (pathNode) => {
|
|
16988
16988
|
nextNode.categoryMatchesMap[pathNode.tokenTypeIdx] = true;
|
|
16989
16989
|
});
|
|
16990
16990
|
forEach_default(nextNode.CATEGORIES, (nextCategory) => {
|
|
16991
|
-
const newPath =
|
|
16991
|
+
const newPath = path10.concat(nextNode);
|
|
16992
16992
|
if (!includes_default(newPath, nextCategory)) {
|
|
16993
16993
|
singleAssignCategoriesToksMap(newPath, nextCategory);
|
|
16994
16994
|
}
|
|
@@ -17832,10 +17832,10 @@ var GastRefResolverVisitor = class extends GAstVisitor {
|
|
|
17832
17832
|
|
|
17833
17833
|
// ../../node_modules/.pnpm/chevrotain@11.0.3/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js
|
|
17834
17834
|
var AbstractNextPossibleTokensWalker = class extends RestWalker {
|
|
17835
|
-
constructor(topProd,
|
|
17835
|
+
constructor(topProd, path10) {
|
|
17836
17836
|
super();
|
|
17837
17837
|
this.topProd = topProd;
|
|
17838
|
-
this.path =
|
|
17838
|
+
this.path = path10;
|
|
17839
17839
|
this.possibleTokTypes = [];
|
|
17840
17840
|
this.nextProductionName = "";
|
|
17841
17841
|
this.nextProductionOccurrence = 0;
|
|
@@ -17879,9 +17879,9 @@ var AbstractNextPossibleTokensWalker = class extends RestWalker {
|
|
|
17879
17879
|
}
|
|
17880
17880
|
};
|
|
17881
17881
|
var NextAfterTokenWalker = class extends AbstractNextPossibleTokensWalker {
|
|
17882
|
-
constructor(topProd,
|
|
17883
|
-
super(topProd,
|
|
17884
|
-
this.path =
|
|
17882
|
+
constructor(topProd, path10) {
|
|
17883
|
+
super(topProd, path10);
|
|
17884
|
+
this.path = path10;
|
|
17885
17885
|
this.nextTerminalName = "";
|
|
17886
17886
|
this.nextTerminalOccurrence = 0;
|
|
17887
17887
|
this.nextTerminalName = this.path.lastTok.name;
|
|
@@ -18486,10 +18486,10 @@ function initializeArrayOfArrays(size) {
|
|
|
18486
18486
|
}
|
|
18487
18487
|
return result;
|
|
18488
18488
|
}
|
|
18489
|
-
function pathToHashKeys(
|
|
18489
|
+
function pathToHashKeys(path10) {
|
|
18490
18490
|
let keys3 = [""];
|
|
18491
|
-
for (let i = 0; i <
|
|
18492
|
-
const tokType =
|
|
18491
|
+
for (let i = 0; i < path10.length; i++) {
|
|
18492
|
+
const tokType = path10[i];
|
|
18493
18493
|
const longerKeys = [];
|
|
18494
18494
|
for (let j = 0; j < keys3.length; j++) {
|
|
18495
18495
|
const currShorterKey = keys3[j];
|
|
@@ -18728,7 +18728,7 @@ function validateRuleIsOverridden(ruleName, definedRulesNames, className) {
|
|
|
18728
18728
|
}
|
|
18729
18729
|
return errors;
|
|
18730
18730
|
}
|
|
18731
|
-
function validateNoLeftRecursion(topRule, currRule, errMsgProvider,
|
|
18731
|
+
function validateNoLeftRecursion(topRule, currRule, errMsgProvider, path10 = []) {
|
|
18732
18732
|
const errors = [];
|
|
18733
18733
|
const nextNonTerminals = getFirstNoneTerminal(currRule.definition);
|
|
18734
18734
|
if (isEmpty_default(nextNonTerminals)) {
|
|
@@ -18740,15 +18740,15 @@ function validateNoLeftRecursion(topRule, currRule, errMsgProvider, path12 = [])
|
|
|
18740
18740
|
errors.push({
|
|
18741
18741
|
message: errMsgProvider.buildLeftRecursionError({
|
|
18742
18742
|
topLevelRule: topRule,
|
|
18743
|
-
leftRecursionPath:
|
|
18743
|
+
leftRecursionPath: path10
|
|
18744
18744
|
}),
|
|
18745
18745
|
type: ParserDefinitionErrorType.LEFT_RECURSION,
|
|
18746
18746
|
ruleName
|
|
18747
18747
|
});
|
|
18748
18748
|
}
|
|
18749
|
-
const validNextSteps = difference_default(nextNonTerminals,
|
|
18749
|
+
const validNextSteps = difference_default(nextNonTerminals, path10.concat([topRule]));
|
|
18750
18750
|
const errorsFromNextSteps = flatMap_default(validNextSteps, (currRefRule) => {
|
|
18751
|
-
const newPath = clone_default(
|
|
18751
|
+
const newPath = clone_default(path10);
|
|
18752
18752
|
newPath.push(currRefRule);
|
|
18753
18753
|
return validateNoLeftRecursion(topRule, currRefRule, errMsgProvider, newPath);
|
|
18754
18754
|
});
|
|
@@ -22356,19 +22356,19 @@ function toKey2(value) {
|
|
|
22356
22356
|
var toKey_default2 = toKey2;
|
|
22357
22357
|
|
|
22358
22358
|
// ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js
|
|
22359
|
-
function baseGet2(object,
|
|
22360
|
-
|
|
22361
|
-
var index = 0, length =
|
|
22359
|
+
function baseGet2(object, path10) {
|
|
22360
|
+
path10 = castPath_default2(path10, object);
|
|
22361
|
+
var index = 0, length = path10.length;
|
|
22362
22362
|
while (object != null && index < length) {
|
|
22363
|
-
object = object[toKey_default2(
|
|
22363
|
+
object = object[toKey_default2(path10[index++])];
|
|
22364
22364
|
}
|
|
22365
22365
|
return index && index == length ? object : void 0;
|
|
22366
22366
|
}
|
|
22367
22367
|
var baseGet_default2 = baseGet2;
|
|
22368
22368
|
|
|
22369
22369
|
// ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/get.js
|
|
22370
|
-
function get2(object,
|
|
22371
|
-
var result = object == null ? void 0 : baseGet_default2(object,
|
|
22370
|
+
function get2(object, path10, defaultValue) {
|
|
22371
|
+
var result = object == null ? void 0 : baseGet_default2(object, path10);
|
|
22372
22372
|
return result === void 0 ? defaultValue : result;
|
|
22373
22373
|
}
|
|
22374
22374
|
var get_default2 = get2;
|
|
@@ -22380,11 +22380,11 @@ function baseHasIn2(object, key) {
|
|
|
22380
22380
|
var baseHasIn_default2 = baseHasIn2;
|
|
22381
22381
|
|
|
22382
22382
|
// ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js
|
|
22383
|
-
function hasPath2(object,
|
|
22384
|
-
|
|
22385
|
-
var index = -1, length =
|
|
22383
|
+
function hasPath2(object, path10, hasFunc) {
|
|
22384
|
+
path10 = castPath_default2(path10, object);
|
|
22385
|
+
var index = -1, length = path10.length, result = false;
|
|
22386
22386
|
while (++index < length) {
|
|
22387
|
-
var key = toKey_default2(
|
|
22387
|
+
var key = toKey_default2(path10[index]);
|
|
22388
22388
|
if (!(result = object != null && hasFunc(object, key))) {
|
|
22389
22389
|
break;
|
|
22390
22390
|
}
|
|
@@ -22399,21 +22399,21 @@ function hasPath2(object, path12, hasFunc) {
|
|
|
22399
22399
|
var hasPath_default2 = hasPath2;
|
|
22400
22400
|
|
|
22401
22401
|
// ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js
|
|
22402
|
-
function hasIn2(object,
|
|
22403
|
-
return object != null && hasPath_default2(object,
|
|
22402
|
+
function hasIn2(object, path10) {
|
|
22403
|
+
return object != null && hasPath_default2(object, path10, baseHasIn_default2);
|
|
22404
22404
|
}
|
|
22405
22405
|
var hasIn_default2 = hasIn2;
|
|
22406
22406
|
|
|
22407
22407
|
// ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js
|
|
22408
22408
|
var COMPARE_PARTIAL_FLAG12 = 1;
|
|
22409
22409
|
var COMPARE_UNORDERED_FLAG8 = 2;
|
|
22410
|
-
function baseMatchesProperty2(
|
|
22411
|
-
if (isKey_default2(
|
|
22412
|
-
return matchesStrictComparable_default2(toKey_default2(
|
|
22410
|
+
function baseMatchesProperty2(path10, srcValue) {
|
|
22411
|
+
if (isKey_default2(path10) && isStrictComparable_default2(srcValue)) {
|
|
22412
|
+
return matchesStrictComparable_default2(toKey_default2(path10), srcValue);
|
|
22413
22413
|
}
|
|
22414
22414
|
return function(object) {
|
|
22415
|
-
var objValue = get_default2(object,
|
|
22416
|
-
return objValue === void 0 && objValue === srcValue ? hasIn_default2(object,
|
|
22415
|
+
var objValue = get_default2(object, path10);
|
|
22416
|
+
return objValue === void 0 && objValue === srcValue ? hasIn_default2(object, path10) : baseIsEqual_default2(srcValue, objValue, COMPARE_PARTIAL_FLAG12 | COMPARE_UNORDERED_FLAG8);
|
|
22417
22417
|
};
|
|
22418
22418
|
}
|
|
22419
22419
|
var baseMatchesProperty_default2 = baseMatchesProperty2;
|
|
@@ -22433,16 +22433,16 @@ function baseProperty2(key) {
|
|
|
22433
22433
|
var baseProperty_default2 = baseProperty2;
|
|
22434
22434
|
|
|
22435
22435
|
// ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js
|
|
22436
|
-
function basePropertyDeep2(
|
|
22436
|
+
function basePropertyDeep2(path10) {
|
|
22437
22437
|
return function(object) {
|
|
22438
|
-
return baseGet_default2(object,
|
|
22438
|
+
return baseGet_default2(object, path10);
|
|
22439
22439
|
};
|
|
22440
22440
|
}
|
|
22441
22441
|
var basePropertyDeep_default2 = basePropertyDeep2;
|
|
22442
22442
|
|
|
22443
22443
|
// ../../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/property.js
|
|
22444
|
-
function property2(
|
|
22445
|
-
return isKey_default2(
|
|
22444
|
+
function property2(path10) {
|
|
22445
|
+
return isKey_default2(path10) ? baseProperty_default2(toKey_default2(path10)) : basePropertyDeep_default2(path10);
|
|
22446
22446
|
}
|
|
22447
22447
|
var property_default2 = property2;
|
|
22448
22448
|
|
|
@@ -22955,9 +22955,9 @@ function getATNConfigKey(config, alt = true) {
|
|
|
22955
22955
|
function baseExtremum(array, iteratee, comparator) {
|
|
22956
22956
|
var index = -1, length = array.length;
|
|
22957
22957
|
while (++index < length) {
|
|
22958
|
-
var value = array[index],
|
|
22959
|
-
if (
|
|
22960
|
-
var computed =
|
|
22958
|
+
var value = array[index], current2 = iteratee(value);
|
|
22959
|
+
if (current2 != null && (computed === void 0 ? current2 === current2 && !isSymbol_default2(current2) : comparator(current2, computed))) {
|
|
22960
|
+
var computed = current2, result = value;
|
|
22961
22961
|
}
|
|
22962
22962
|
}
|
|
22963
22963
|
return result;
|
|
@@ -23283,7 +23283,7 @@ var LLStarLookaheadStrategy = class extends LLkLookaheadStrategy {
|
|
|
23283
23283
|
occurrence: prodOccurrence,
|
|
23284
23284
|
prodType: "Alternation",
|
|
23285
23285
|
rule
|
|
23286
|
-
}), (currAlt) => map_default2(currAlt, (
|
|
23286
|
+
}), (currAlt) => map_default2(currAlt, (path10) => path10[0]));
|
|
23287
23287
|
if (isLL1Sequence(partialAlts, false) && !dynamicTokensEnabled) {
|
|
23288
23288
|
const choiceToAlt = reduce_default2(partialAlts, (result, currAlt, idx) => {
|
|
23289
23289
|
forEach_default2(currAlt, (currTokType) => {
|
|
@@ -23428,7 +23428,7 @@ function adaptivePredict(dfaCaches, decision, predicateSet, logging) {
|
|
|
23428
23428
|
function performLookahead(dfa, s0, predicateSet, logging) {
|
|
23429
23429
|
let previousD = s0;
|
|
23430
23430
|
let i = 1;
|
|
23431
|
-
const
|
|
23431
|
+
const path10 = [];
|
|
23432
23432
|
let t = this.LA(i++);
|
|
23433
23433
|
while (true) {
|
|
23434
23434
|
let d = getExistingTargetState(previousD, t);
|
|
@@ -23436,13 +23436,13 @@ function performLookahead(dfa, s0, predicateSet, logging) {
|
|
|
23436
23436
|
d = computeLookaheadTarget.apply(this, [dfa, previousD, t, i, predicateSet, logging]);
|
|
23437
23437
|
}
|
|
23438
23438
|
if (d === DFA_ERROR) {
|
|
23439
|
-
return buildAdaptivePredictError(
|
|
23439
|
+
return buildAdaptivePredictError(path10, previousD, t);
|
|
23440
23440
|
}
|
|
23441
23441
|
if (d.isAcceptState === true) {
|
|
23442
23442
|
return d.prediction;
|
|
23443
23443
|
}
|
|
23444
23444
|
previousD = d;
|
|
23445
|
-
|
|
23445
|
+
path10.push(t);
|
|
23446
23446
|
t = this.LA(i++);
|
|
23447
23447
|
}
|
|
23448
23448
|
}
|
|
@@ -23515,13 +23515,13 @@ function getProductionDslName2(prod) {
|
|
|
23515
23515
|
throw Error("non exhaustive match");
|
|
23516
23516
|
}
|
|
23517
23517
|
}
|
|
23518
|
-
function buildAdaptivePredictError(
|
|
23518
|
+
function buildAdaptivePredictError(path10, previous, current2) {
|
|
23519
23519
|
const nextTransitions = flatMap_default2(previous.configs.elements, (e) => e.state.transitions);
|
|
23520
23520
|
const nextTokenTypes = uniqBy_default(nextTransitions.filter((e) => e instanceof AtomTransition).map((e) => e.tokenType), (e) => e.tokenTypeIdx);
|
|
23521
23521
|
return {
|
|
23522
|
-
actualToken:
|
|
23522
|
+
actualToken: current2,
|
|
23523
23523
|
possibleTokenTypes: nextTokenTypes,
|
|
23524
|
-
tokenPath:
|
|
23524
|
+
tokenPath: path10
|
|
23525
23525
|
};
|
|
23526
23526
|
}
|
|
23527
23527
|
function getExistingTargetState(state, token) {
|
|
@@ -24956,31 +24956,31 @@ var CstNodeBuilder = class {
|
|
|
24956
24956
|
leafNode.root = this.rootNode;
|
|
24957
24957
|
nodes.push(leafNode);
|
|
24958
24958
|
}
|
|
24959
|
-
let
|
|
24959
|
+
let current2 = this.current;
|
|
24960
24960
|
let added = false;
|
|
24961
|
-
if (
|
|
24962
|
-
|
|
24961
|
+
if (current2.content.length > 0) {
|
|
24962
|
+
current2.content.push(...nodes);
|
|
24963
24963
|
return;
|
|
24964
24964
|
}
|
|
24965
|
-
while (
|
|
24966
|
-
const index =
|
|
24965
|
+
while (current2.container) {
|
|
24966
|
+
const index = current2.container.content.indexOf(current2);
|
|
24967
24967
|
if (index > 0) {
|
|
24968
|
-
|
|
24968
|
+
current2.container.content.splice(index, 0, ...nodes);
|
|
24969
24969
|
added = true;
|
|
24970
24970
|
break;
|
|
24971
24971
|
}
|
|
24972
|
-
|
|
24972
|
+
current2 = current2.container;
|
|
24973
24973
|
}
|
|
24974
24974
|
if (!added) {
|
|
24975
24975
|
this.rootNode.content.unshift(...nodes);
|
|
24976
24976
|
}
|
|
24977
24977
|
}
|
|
24978
24978
|
construct(item) {
|
|
24979
|
-
const
|
|
24979
|
+
const current2 = this.current;
|
|
24980
24980
|
if (typeof item.$type === "string") {
|
|
24981
24981
|
this.current.astNode = item;
|
|
24982
24982
|
}
|
|
24983
|
-
item.$cstNode =
|
|
24983
|
+
item.$cstNode = current2;
|
|
24984
24984
|
const node = this.nodeStack.pop();
|
|
24985
24985
|
if ((node === null || node === void 0 ? void 0 : node.content.length) === 0) {
|
|
24986
24986
|
this.removeNode(node);
|
|
@@ -25278,16 +25278,16 @@ var LangiumParser = class extends AbstractLangiumParser {
|
|
|
25278
25278
|
this.nodeBuilder.addHiddenNodes(hiddenTokens);
|
|
25279
25279
|
const leafNode = this.nodeBuilder.buildLeafNode(token, feature);
|
|
25280
25280
|
const { assignment, isCrossRef } = this.getAssignment(feature);
|
|
25281
|
-
const
|
|
25281
|
+
const current2 = this.current;
|
|
25282
25282
|
if (assignment) {
|
|
25283
25283
|
const convertedValue = isKeyword(feature) ? token.image : this.converter.convert(token.image, leafNode);
|
|
25284
25284
|
this.assign(assignment.operator, assignment.feature, convertedValue, leafNode, isCrossRef);
|
|
25285
|
-
} else if (isDataTypeNode(
|
|
25285
|
+
} else if (isDataTypeNode(current2)) {
|
|
25286
25286
|
let text = token.image;
|
|
25287
25287
|
if (!isKeyword(feature)) {
|
|
25288
25288
|
text = this.converter.convert(text, leafNode).toString();
|
|
25289
25289
|
}
|
|
25290
|
-
|
|
25290
|
+
current2.value += text;
|
|
25291
25291
|
}
|
|
25292
25292
|
}
|
|
25293
25293
|
}
|
|
@@ -25324,11 +25324,11 @@ var LangiumParser = class extends AbstractLangiumParser {
|
|
|
25324
25324
|
if (assignment) {
|
|
25325
25325
|
this.assign(assignment.operator, assignment.feature, result, cstNode, isCrossRef);
|
|
25326
25326
|
} else if (!assignment) {
|
|
25327
|
-
const
|
|
25328
|
-
if (isDataTypeNode(
|
|
25329
|
-
|
|
25327
|
+
const current2 = this.current;
|
|
25328
|
+
if (isDataTypeNode(current2)) {
|
|
25329
|
+
current2.value += result.toString();
|
|
25330
25330
|
} else if (typeof result === "object" && result) {
|
|
25331
|
-
const object = this.assignWithoutOverride(result,
|
|
25331
|
+
const object = this.assignWithoutOverride(result, current2);
|
|
25332
25332
|
const newItem = object;
|
|
25333
25333
|
this.stack.pop();
|
|
25334
25334
|
this.stack.push(newItem);
|
|
@@ -26153,9 +26153,9 @@ async function interruptAndCheck(token) {
|
|
|
26153
26153
|
if (token === cancellation_exports.CancellationToken.None) {
|
|
26154
26154
|
return;
|
|
26155
26155
|
}
|
|
26156
|
-
const
|
|
26157
|
-
if (
|
|
26158
|
-
lastTick =
|
|
26156
|
+
const current2 = performance.now();
|
|
26157
|
+
if (current2 - lastTick >= globalInterruptionPeriod) {
|
|
26158
|
+
lastTick = current2;
|
|
26159
26159
|
await delayNextTick();
|
|
26160
26160
|
lastTick = performance.now();
|
|
26161
26161
|
}
|
|
@@ -26752,7 +26752,7 @@ var UriUtils;
|
|
|
26752
26752
|
return (a2 === null || a2 === void 0 ? void 0 : a2.toString()) === (b === null || b === void 0 ? void 0 : b.toString());
|
|
26753
26753
|
}
|
|
26754
26754
|
UriUtils2.equals = equals;
|
|
26755
|
-
function
|
|
26755
|
+
function relative3(from, to) {
|
|
26756
26756
|
const fromPath = typeof from === "string" ? URI2.parse(from).path : from.path;
|
|
26757
26757
|
const toPath = typeof to === "string" ? URI2.parse(to).path : to.path;
|
|
26758
26758
|
const fromParts = fromPath.split("/").filter((e) => e.length > 0);
|
|
@@ -26779,7 +26779,7 @@ var UriUtils;
|
|
|
26779
26779
|
const toPart = toParts.slice(i).join("/");
|
|
26780
26780
|
return backPart + toPart;
|
|
26781
26781
|
}
|
|
26782
|
-
UriUtils2.relative =
|
|
26782
|
+
UriUtils2.relative = relative3;
|
|
26783
26783
|
function normalize2(uri) {
|
|
26784
26784
|
return URI2.parse(uri.toString()).toString();
|
|
26785
26785
|
}
|
|
@@ -27195,12 +27195,12 @@ var DefaultReferences = class {
|
|
|
27195
27195
|
const nameNode = this.nameProvider.getNameNode(targetNode);
|
|
27196
27196
|
if (nameNode) {
|
|
27197
27197
|
const doc = getDocument(targetNode);
|
|
27198
|
-
const
|
|
27198
|
+
const path10 = this.nodeLocator.getAstNodePath(targetNode);
|
|
27199
27199
|
return {
|
|
27200
27200
|
sourceUri: doc.uri,
|
|
27201
|
-
sourcePath:
|
|
27201
|
+
sourcePath: path10,
|
|
27202
27202
|
targetUri: doc.uri,
|
|
27203
|
-
targetPath:
|
|
27203
|
+
targetPath: path10,
|
|
27204
27204
|
segment: toDocumentSegment(nameNode),
|
|
27205
27205
|
local: true
|
|
27206
27206
|
};
|
|
@@ -28379,9 +28379,9 @@ var DefaultAstNodeDescriptionProvider = class {
|
|
|
28379
28379
|
createDescription(node, name, document) {
|
|
28380
28380
|
const doc = document !== null && document !== void 0 ? document : getDocument(node);
|
|
28381
28381
|
name !== null && name !== void 0 ? name : name = this.nameProvider.getName(node);
|
|
28382
|
-
const
|
|
28382
|
+
const path10 = this.astNodeLocator.getAstNodePath(node);
|
|
28383
28383
|
if (!name) {
|
|
28384
|
-
throw new Error(`Node at path ${
|
|
28384
|
+
throw new Error(`Node at path ${path10} has no name.`);
|
|
28385
28385
|
}
|
|
28386
28386
|
let nameNodeSegment;
|
|
28387
28387
|
const nameSegmentGetter = () => {
|
|
@@ -28397,7 +28397,7 @@ var DefaultAstNodeDescriptionProvider = class {
|
|
|
28397
28397
|
selectionSegment: toDocumentSegment(node.$cstNode),
|
|
28398
28398
|
type: node.$type,
|
|
28399
28399
|
documentUri: doc.uri,
|
|
28400
|
-
path:
|
|
28400
|
+
path: path10
|
|
28401
28401
|
};
|
|
28402
28402
|
}
|
|
28403
28403
|
};
|
|
@@ -28461,8 +28461,8 @@ var DefaultAstNodeLocator = class {
|
|
|
28461
28461
|
}
|
|
28462
28462
|
return $containerProperty;
|
|
28463
28463
|
}
|
|
28464
|
-
getAstNode(node,
|
|
28465
|
-
const segments =
|
|
28464
|
+
getAstNode(node, path10) {
|
|
28465
|
+
const segments = path10.split(this.segmentSeparator);
|
|
28466
28466
|
return segments.reduce((previousValue, currentValue) => {
|
|
28467
28467
|
if (!previousValue || currentValue.length === 0) {
|
|
28468
28468
|
return previousValue;
|
|
@@ -56065,9 +56065,9 @@ var DefaultFuzzyMatcher = class {
|
|
|
56065
56065
|
}
|
|
56066
56066
|
return false;
|
|
56067
56067
|
}
|
|
56068
|
-
isWordTransition(previous,
|
|
56069
|
-
return a <= previous && previous <= z && A <=
|
|
56070
|
-
previous === _ &&
|
|
56068
|
+
isWordTransition(previous, current2) {
|
|
56069
|
+
return a <= previous && previous <= z && A <= current2 && current2 <= Z || // camelCase transition
|
|
56070
|
+
previous === _ && current2 !== _;
|
|
56071
56071
|
}
|
|
56072
56072
|
toUpperCharCode(charCode) {
|
|
56073
56073
|
if (a <= charCode && charCode <= z) {
|
|
@@ -57949,22 +57949,22 @@ function namespaceMembers(node) {
|
|
|
57949
57949
|
return [...n?.elements ?? [], ...n?.members ?? []];
|
|
57950
57950
|
}
|
|
57951
57951
|
function expandImportInto(imp, globalDescriptions, out, options, visitedNamespaces) {
|
|
57952
|
-
const
|
|
57953
|
-
if (!
|
|
57952
|
+
const path10 = importedPath(imp);
|
|
57953
|
+
if (!path10)
|
|
57954
57954
|
return;
|
|
57955
57955
|
const start = out.length;
|
|
57956
|
-
const namedSegments =
|
|
57956
|
+
const namedSegments = path10.split("::");
|
|
57957
57957
|
const wildcard = importWildcard(imp);
|
|
57958
57958
|
if (wildcard === "none") {
|
|
57959
|
-
const targetDesc = resolveImportedDescription(
|
|
57959
|
+
const targetDesc = resolveImportedDescription(path10, globalDescriptions, options, visitedNamespaces);
|
|
57960
57960
|
if (targetDesc) {
|
|
57961
57961
|
const alias = imp.alias ?? namedSegments[namedSegments.length - 1];
|
|
57962
57962
|
if (alias)
|
|
57963
57963
|
out.push({ name: alias, targetName: targetDesc.name, description: targetDesc });
|
|
57964
57964
|
}
|
|
57965
57965
|
} else {
|
|
57966
|
-
expandNamespaceMembers(
|
|
57967
|
-
expandNamespaceImports(
|
|
57966
|
+
expandNamespaceMembers(path10, wildcard, globalDescriptions, out);
|
|
57967
|
+
expandNamespaceImports(path10, globalDescriptions, out, options, visitedNamespaces);
|
|
57968
57968
|
}
|
|
57969
57969
|
applyImportFilters(imp, out, start, options);
|
|
57970
57970
|
}
|
|
@@ -58063,21 +58063,21 @@ function qualifiedNameMatches(a2, b) {
|
|
|
58063
58063
|
}
|
|
58064
58064
|
return true;
|
|
58065
58065
|
}
|
|
58066
|
-
function resolveImportedDescription(
|
|
58067
|
-
const direct = globalDescriptions.find((desc) => desc.name ===
|
|
58066
|
+
function resolveImportedDescription(path10, globalDescriptions, options, visitedNamespaces) {
|
|
58067
|
+
const direct = globalDescriptions.find((desc) => desc.name === path10);
|
|
58068
58068
|
if (direct)
|
|
58069
58069
|
return direct;
|
|
58070
|
-
const split =
|
|
58070
|
+
const split = path10.lastIndexOf("::");
|
|
58071
58071
|
if (split < 0)
|
|
58072
58072
|
return void 0;
|
|
58073
|
-
const ownerPath =
|
|
58074
|
-
const simpleName2 =
|
|
58073
|
+
const ownerPath = path10.slice(0, split);
|
|
58074
|
+
const simpleName2 = path10.slice(split + 2);
|
|
58075
58075
|
const exported = [];
|
|
58076
58076
|
expandNamespaceImports(ownerPath, globalDescriptions, exported, options, visitedNamespaces);
|
|
58077
58077
|
return exported.find((entry) => entry.name === simpleName2)?.description;
|
|
58078
58078
|
}
|
|
58079
|
-
function expandNamespaceMembers(
|
|
58080
|
-
const prefix =
|
|
58079
|
+
function expandNamespaceMembers(path10, wildcard, globalDescriptions, out) {
|
|
58080
|
+
const prefix = path10 + "::";
|
|
58081
58081
|
for (const desc of globalDescriptions) {
|
|
58082
58082
|
if (!desc.name.startsWith(prefix))
|
|
58083
58083
|
continue;
|
|
@@ -58090,9 +58090,9 @@ function expandNamespaceMembers(path12, wildcard, globalDescriptions, out) {
|
|
|
58090
58090
|
out.push({ name: simple, targetName: desc.name, description: desc });
|
|
58091
58091
|
}
|
|
58092
58092
|
}
|
|
58093
|
-
function expandNamespaceImports(
|
|
58093
|
+
function expandNamespaceImports(path10, globalDescriptions, out, options, visitedNamespaces) {
|
|
58094
58094
|
for (const namespaceDesc of globalDescriptions) {
|
|
58095
|
-
if (namespaceDesc.name !==
|
|
58095
|
+
if (namespaceDesc.name !== path10)
|
|
58096
58096
|
continue;
|
|
58097
58097
|
const key = descriptionKey(namespaceDesc);
|
|
58098
58098
|
if (visitedNamespaces.has(key))
|
|
@@ -58888,17 +58888,33 @@ function stereotypeMapping(inner) {
|
|
|
58888
58888
|
return V1_STEREOTYPE_MAP[normalizeStereotype(inner)];
|
|
58889
58889
|
}
|
|
58890
58890
|
|
|
58891
|
+
// ../language-server/out/src/platform/platform.js
|
|
58892
|
+
var current;
|
|
58893
|
+
function setPlatform(platform) {
|
|
58894
|
+
current = platform;
|
|
58895
|
+
}
|
|
58896
|
+
function getPlatform() {
|
|
58897
|
+
if (!current)
|
|
58898
|
+
throw new Error("SysML: no platform installed \u2014 the entry point must call setPlatform() first.");
|
|
58899
|
+
return current;
|
|
58900
|
+
}
|
|
58901
|
+
function hasPlatform() {
|
|
58902
|
+
return current !== void 0;
|
|
58903
|
+
}
|
|
58904
|
+
|
|
58891
58905
|
// ../language-server/out/src/services/library-index-manager.js
|
|
58892
|
-
import * as path2 from "path";
|
|
58893
58906
|
var SysmlIndexManager = class extends DefaultIndexManager {
|
|
58894
58907
|
constructor(services) {
|
|
58895
58908
|
super(services);
|
|
58896
58909
|
}
|
|
58910
|
+
// REQ-075, REQ-383 — `libraryRoot` is a URI and the concrete file URIs come
|
|
58911
|
+
// from the platform, because the two hosts index the same library under
|
|
58912
|
+
// different schemes (`file:` on the desktop, `sysml-lib:` in a worker).
|
|
58897
58913
|
loadPrecomputedLibraryIndex(index, libraryRoot) {
|
|
58914
|
+
const platform = getPlatform();
|
|
58898
58915
|
let symbolCount = 0;
|
|
58899
58916
|
for (const file of index.files) {
|
|
58900
|
-
const
|
|
58901
|
-
const documentUri = URI2.file(filePath);
|
|
58917
|
+
const documentUri = platform.libraryUri(libraryRoot, file.path);
|
|
58902
58918
|
const descriptions = file.symbols.map((symbol) => this.deserializeSymbol(symbol, documentUri));
|
|
58903
58919
|
const uri = documentUri.toString();
|
|
58904
58920
|
this.symbolIndex.set(uri, descriptions);
|
|
@@ -58925,20 +58941,26 @@ function isSysmlIndexManager(value) {
|
|
|
58925
58941
|
return typeof value.loadPrecomputedLibraryIndex === "function";
|
|
58926
58942
|
}
|
|
58927
58943
|
var libraryRoots = /* @__PURE__ */ new Set();
|
|
58944
|
+
var ROOT_SEPARATOR = "\0";
|
|
58928
58945
|
function normalizeLibraryPath(p) {
|
|
58929
58946
|
return p.replace(/\\/gu, "/").replace(/\/+$/u, "").toLowerCase();
|
|
58930
58947
|
}
|
|
58931
|
-
function registerLibraryRoot(
|
|
58932
|
-
|
|
58933
|
-
|
|
58948
|
+
function registerLibraryRoot(root3) {
|
|
58949
|
+
const uri = typeof root3 === "string" ? root3.length > 0 ? URI2.file(root3) : void 0 : root3;
|
|
58950
|
+
if (!uri)
|
|
58951
|
+
return;
|
|
58952
|
+
libraryRoots.add(`${uri.scheme}${ROOT_SEPARATOR}${normalizeLibraryPath(uri.path)}`);
|
|
58934
58953
|
}
|
|
58935
58954
|
function isInsideDir(fsPath, dir) {
|
|
58936
58955
|
return fsPath === dir || fsPath.startsWith(`${dir}/`);
|
|
58937
58956
|
}
|
|
58938
58957
|
function isStandardLibraryUri(uri) {
|
|
58939
58958
|
const fsPath = normalizeLibraryPath(uri.path);
|
|
58940
|
-
for (const
|
|
58941
|
-
|
|
58959
|
+
for (const entry of libraryRoots) {
|
|
58960
|
+
const separator = entry.indexOf(ROOT_SEPARATOR);
|
|
58961
|
+
if (entry.slice(0, separator) !== uri.scheme)
|
|
58962
|
+
continue;
|
|
58963
|
+
if (isInsideDir(fsPath, entry.slice(separator + 1)))
|
|
58942
58964
|
return true;
|
|
58943
58965
|
}
|
|
58944
58966
|
return fsPath.split("/").some((segment) => segment === "sysml.library");
|
|
@@ -60053,9 +60075,9 @@ ${baseIndent}}`;
|
|
|
60053
60075
|
if (isImport(child)) {
|
|
60054
60076
|
imports.push(child);
|
|
60055
60077
|
const alias = child.alias;
|
|
60056
|
-
const
|
|
60057
|
-
if (alias &&
|
|
60058
|
-
aliasMap.set(alias,
|
|
60078
|
+
const path10 = importedPath(child);
|
|
60079
|
+
if (alias && path10 && importWildcard(child) === "none")
|
|
60080
|
+
aliasMap.set(alias, path10);
|
|
60059
60081
|
} else if (isVerifyStmt(child))
|
|
60060
60082
|
verifyStmts.push(child);
|
|
60061
60083
|
else if (isSatisfyStmt(child))
|
|
@@ -60530,16 +60552,16 @@ ${baseIndent}}`;
|
|
|
60530
60552
|
// REQ-320 — RES004 importing a private element from outside its namespace
|
|
60531
60553
|
checkPrivateImports(imports, index, accept) {
|
|
60532
60554
|
for (const imp of imports) {
|
|
60533
|
-
const
|
|
60534
|
-
if (!
|
|
60555
|
+
const path10 = importedPath(imp);
|
|
60556
|
+
if (!path10)
|
|
60535
60557
|
continue;
|
|
60536
|
-
const target = this.resolve(
|
|
60558
|
+
const target = this.resolve(path10, index, imp);
|
|
60537
60559
|
if (!target || !isPrivate(target))
|
|
60538
60560
|
continue;
|
|
60539
60561
|
if (isWithinNamespaceOf(imp, target))
|
|
60540
60562
|
continue;
|
|
60541
|
-
const related = relatedInfo(target, `'${declName(target) ??
|
|
60542
|
-
accept(severity("RES004", "error"), `'${
|
|
60563
|
+
const related = relatedInfo(target, `'${declName(target) ?? path10}' is declared private here`);
|
|
60564
|
+
accept(severity("RES004", "error"), `'${path10}' is private and cannot be imported from outside its namespace.`, { node: imp, code: "RES004", relatedInformation: related ? [related] : void 0 });
|
|
60543
60565
|
}
|
|
60544
60566
|
}
|
|
60545
60567
|
// REQ-320 — RES004 for wildcard imports. `import Lib::*` legitimately skips
|
|
@@ -60556,9 +60578,9 @@ ${baseIndent}}`;
|
|
|
60556
60578
|
const kind = importWildcard(imp);
|
|
60557
60579
|
if (kind === "none")
|
|
60558
60580
|
continue;
|
|
60559
|
-
const
|
|
60560
|
-
if (
|
|
60561
|
-
wildcards.push({ path:
|
|
60581
|
+
const path10 = importedPath(imp);
|
|
60582
|
+
if (path10)
|
|
60583
|
+
wildcards.push({ path: path10, recursive: kind === "recursive" });
|
|
60562
60584
|
}
|
|
60563
60585
|
if (wildcards.length === 0)
|
|
60564
60586
|
return;
|
|
@@ -60623,10 +60645,10 @@ ${baseIndent}}`;
|
|
|
60623
60645
|
// wildcard import (`import B::*` → `B`), or the owner of the named member for
|
|
60624
60646
|
// a membership import (`import B::Member` → `B`). Resolved to its Package node.
|
|
60625
60647
|
importTargetNamespace(imp, index) {
|
|
60626
|
-
const
|
|
60627
|
-
if (!
|
|
60648
|
+
const path10 = importedPath(imp);
|
|
60649
|
+
if (!path10)
|
|
60628
60650
|
return void 0;
|
|
60629
|
-
const nsName = importWildcard(imp) === "none" ?
|
|
60651
|
+
const nsName = importWildcard(imp) === "none" ? path10.includes("::") ? path10.slice(0, path10.lastIndexOf("::")) : void 0 : path10;
|
|
60630
60652
|
if (!nsName)
|
|
60631
60653
|
return void 0;
|
|
60632
60654
|
const node = this.resolve(nsName, index, imp);
|
|
@@ -60655,9 +60677,9 @@ ${baseIndent}}`;
|
|
|
60655
60677
|
for (const imp of imports) {
|
|
60656
60678
|
if (importIsUsed(imp, index, usedFull, usedFirst, this.nodeOf.bind(this)))
|
|
60657
60679
|
continue;
|
|
60658
|
-
const
|
|
60680
|
+
const path10 = importedPath(imp) ?? imp.head;
|
|
60659
60681
|
const baseSeverity = level === "error" ? "error" : "warning";
|
|
60660
|
-
accept(severity("RES009", baseSeverity), `Import '${
|
|
60682
|
+
accept(severity("RES009", baseSeverity), `Import '${path10}' is never used in this file.`, { node: imp, code: "RES009", tags: [import_vscode_languageserver10.DiagnosticTag.Unnecessary] });
|
|
60661
60683
|
}
|
|
60662
60684
|
}
|
|
60663
60685
|
// REQ-319 — RES003 cyclic specialization (warning)
|
|
@@ -61173,11 +61195,11 @@ function isClassifierNode(node) {
|
|
|
61173
61195
|
return node.isDef === true || CLASSIFIER_TYPES.has(node.$type);
|
|
61174
61196
|
}
|
|
61175
61197
|
function hasAncestorType(node, type) {
|
|
61176
|
-
let
|
|
61177
|
-
while (
|
|
61178
|
-
if (
|
|
61198
|
+
let current2 = node.$container;
|
|
61199
|
+
while (current2) {
|
|
61200
|
+
if (current2.$type === type)
|
|
61179
61201
|
return true;
|
|
61180
|
-
|
|
61202
|
+
current2 = current2.$container;
|
|
61181
61203
|
}
|
|
61182
61204
|
return false;
|
|
61183
61205
|
}
|
|
@@ -61347,17 +61369,17 @@ function collectUsedNames(root3) {
|
|
|
61347
61369
|
return { usedFull, usedFirst };
|
|
61348
61370
|
}
|
|
61349
61371
|
function importIsUsed(imp, index, usedFull, usedFirst, nodeOf) {
|
|
61350
|
-
const
|
|
61351
|
-
if (!
|
|
61372
|
+
const path10 = importedPath(imp);
|
|
61373
|
+
if (!path10)
|
|
61352
61374
|
return true;
|
|
61353
61375
|
const wildcard = importWildcard(imp);
|
|
61354
|
-
const prefix =
|
|
61376
|
+
const prefix = path10 + "::";
|
|
61355
61377
|
for (const ref of usedFull) {
|
|
61356
|
-
if (ref ===
|
|
61378
|
+
if (ref === path10 || ref.startsWith(prefix))
|
|
61357
61379
|
return true;
|
|
61358
61380
|
}
|
|
61359
61381
|
if (wildcard === "none") {
|
|
61360
|
-
const named =
|
|
61382
|
+
const named = path10.split("::");
|
|
61361
61383
|
const simple = imp.alias ?? named[named.length - 1];
|
|
61362
61384
|
return usedFirst.has(simple);
|
|
61363
61385
|
}
|
|
@@ -61440,8 +61462,8 @@ function applyLintProfile(diagnostics) {
|
|
|
61440
61462
|
}
|
|
61441
61463
|
|
|
61442
61464
|
// ../cli/src/services.ts
|
|
61443
|
-
import * as
|
|
61444
|
-
import * as
|
|
61465
|
+
import * as fs5 from "fs";
|
|
61466
|
+
import * as path6 from "path";
|
|
61445
61467
|
|
|
61446
61468
|
// ../../node_modules/.pnpm/langium@3.5.0/node_modules/langium/lib/node/node-file-system-provider.js
|
|
61447
61469
|
import * as fs from "node:fs";
|
|
@@ -62686,11 +62708,11 @@ function memberList(node) {
|
|
|
62686
62708
|
return lines;
|
|
62687
62709
|
}
|
|
62688
62710
|
function nearestAncestor(node, types) {
|
|
62689
|
-
let
|
|
62690
|
-
while (
|
|
62691
|
-
if (types.has(
|
|
62692
|
-
return
|
|
62693
|
-
|
|
62711
|
+
let current2 = node;
|
|
62712
|
+
while (current2) {
|
|
62713
|
+
if (types.has(current2.$type))
|
|
62714
|
+
return current2;
|
|
62715
|
+
current2 = current2.$container;
|
|
62694
62716
|
}
|
|
62695
62717
|
return void 0;
|
|
62696
62718
|
}
|
|
@@ -64034,8 +64056,8 @@ var SysmlCompletionProvider = class extends DefaultCompletionProvider {
|
|
|
64034
64056
|
const root3 = document.parseResult.value;
|
|
64035
64057
|
const enclosing = smallestNodeAtOffset(root3, offset);
|
|
64036
64058
|
const owner = nearestMemberOwner(enclosing) ?? root3;
|
|
64037
|
-
return collectReachablePorts(owner).map((
|
|
64038
|
-
label:
|
|
64059
|
+
return collectReachablePorts(owner).map((path10) => ({
|
|
64060
|
+
label: path10,
|
|
64039
64061
|
kind: import_vscode_languageserver16.CompletionItemKind.Interface,
|
|
64040
64062
|
detail: "Reachable port",
|
|
64041
64063
|
sortText: "0"
|
|
@@ -64264,13 +64286,13 @@ function typingTarget(node) {
|
|
|
64264
64286
|
return findNamedNode(ast_utils_exports.getDocument(node).parseResult.value, simpleName(refText), { definitionsOnly: true });
|
|
64265
64287
|
}
|
|
64266
64288
|
function resolveReceiverMembers(root3, receiver) {
|
|
64267
|
-
let
|
|
64289
|
+
let current2 = findNamedNode(root3, simpleName(receiver.split(/[.:]+/u)[0]));
|
|
64268
64290
|
for (const segment of receiver.split(/(?:\.|::)/u).slice(1)) {
|
|
64269
|
-
|
|
64270
|
-
if (!
|
|
64291
|
+
current2 = collectMembersWithTyped(current2).find((member) => nodeName(member) === segment);
|
|
64292
|
+
if (!current2)
|
|
64271
64293
|
return [];
|
|
64272
64294
|
}
|
|
64273
|
-
return collectMembersWithTyped(
|
|
64295
|
+
return collectMembersWithTyped(current2);
|
|
64274
64296
|
}
|
|
64275
64297
|
function collectMembersWithTyped(node) {
|
|
64276
64298
|
if (!node)
|
|
@@ -64323,11 +64345,11 @@ function smallestNodeAtOffset(root3, offset) {
|
|
|
64323
64345
|
return best;
|
|
64324
64346
|
}
|
|
64325
64347
|
function nearestMemberOwner(node) {
|
|
64326
|
-
let
|
|
64327
|
-
while (
|
|
64328
|
-
if (nodeMembers(
|
|
64329
|
-
return
|
|
64330
|
-
|
|
64348
|
+
let current2 = node;
|
|
64349
|
+
while (current2) {
|
|
64350
|
+
if (nodeMembers(current2).length > 0 && current2.$type !== "Document")
|
|
64351
|
+
return current2;
|
|
64352
|
+
current2 = current2.$container;
|
|
64331
64353
|
}
|
|
64332
64354
|
return void 0;
|
|
64333
64355
|
}
|
|
@@ -64897,9 +64919,9 @@ var SysmlScopeComputation = class extends DefaultScopeComputation {
|
|
|
64897
64919
|
combineSegments(segmentChoices, separator) {
|
|
64898
64920
|
let paths = [""];
|
|
64899
64921
|
for (const choices of segmentChoices) {
|
|
64900
|
-
paths = paths.flatMap((
|
|
64922
|
+
paths = paths.flatMap((path10) => choices.map((choice) => path10 ? `${path10}${separator}${choice}` : choice));
|
|
64901
64923
|
}
|
|
64902
|
-
return paths.filter((
|
|
64924
|
+
return paths.filter((path10) => path10.length > 0);
|
|
64903
64925
|
}
|
|
64904
64926
|
nameAliasesOf(node) {
|
|
64905
64927
|
const aliases = [];
|
|
@@ -64953,17 +64975,17 @@ function exportAliasKey(description) {
|
|
|
64953
64975
|
return `${description.name}|${description.documentUri.toString()}|${description.path}`;
|
|
64954
64976
|
}
|
|
64955
64977
|
function directImportEntries(imp, descriptions) {
|
|
64956
|
-
const
|
|
64957
|
-
if (!
|
|
64978
|
+
const path10 = importedPath(imp);
|
|
64979
|
+
if (!path10)
|
|
64958
64980
|
return [];
|
|
64959
64981
|
const wildcard = importWildcard(imp);
|
|
64960
64982
|
if (wildcard === "none") {
|
|
64961
|
-
const description = descriptions.find((candidate) => candidate.name ===
|
|
64983
|
+
const description = descriptions.find((candidate) => candidate.name === path10);
|
|
64962
64984
|
if (!description)
|
|
64963
64985
|
return [];
|
|
64964
|
-
return [{ name: imp.alias ??
|
|
64986
|
+
return [{ name: imp.alias ?? path10.split("::").pop() ?? path10, description }];
|
|
64965
64987
|
}
|
|
64966
|
-
const prefix = `${
|
|
64988
|
+
const prefix = `${path10}::`;
|
|
64967
64989
|
const entries = [];
|
|
64968
64990
|
const seen = /* @__PURE__ */ new Set();
|
|
64969
64991
|
for (const description of descriptions) {
|
|
@@ -64999,7 +65021,6 @@ function specializationTargets4(node) {
|
|
|
64999
65021
|
}
|
|
65000
65022
|
|
|
65001
65023
|
// ../language-server/out/src/services/linker.js
|
|
65002
|
-
import * as fs2 from "fs";
|
|
65003
65024
|
var SysmlLinker = class extends DefaultLinker {
|
|
65004
65025
|
documentFactory;
|
|
65005
65026
|
libraryDocs = /* @__PURE__ */ new Map();
|
|
@@ -65029,15 +65050,15 @@ var SysmlLinker = class extends DefaultLinker {
|
|
|
65029
65050
|
this.libraryDocs.set(key, live);
|
|
65030
65051
|
return live;
|
|
65031
65052
|
}
|
|
65032
|
-
|
|
65033
|
-
const text = fs2.readFileSync(uri.fsPath, "utf8");
|
|
65034
|
-
const doc = this.documentFactory.fromString(text, uri);
|
|
65035
|
-
doc.isLibraryDocument = true;
|
|
65036
|
-
this.libraryDocs.set(key, doc);
|
|
65037
|
-
return doc;
|
|
65038
|
-
} catch {
|
|
65053
|
+
if (!hasPlatform())
|
|
65039
65054
|
return void 0;
|
|
65040
|
-
|
|
65055
|
+
const text = getPlatform().readLibrarySourceSync(uri);
|
|
65056
|
+
if (text === void 0)
|
|
65057
|
+
return void 0;
|
|
65058
|
+
const doc = this.documentFactory.fromString(text, uri);
|
|
65059
|
+
doc.isLibraryDocument = true;
|
|
65060
|
+
this.libraryDocs.set(key, doc);
|
|
65061
|
+
return doc;
|
|
65041
65062
|
}
|
|
65042
65063
|
};
|
|
65043
65064
|
|
|
@@ -65482,14 +65503,14 @@ ${indent}}`)]
|
|
|
65482
65503
|
}
|
|
65483
65504
|
const importNode = nearestAncestor2(rangeNode, isImport);
|
|
65484
65505
|
if (importNode?.$cstNode && importNode.alias && importNode.segs.every((s) => !s.star && s.name)) {
|
|
65485
|
-
const
|
|
65506
|
+
const path10 = [importNode.head, ...importNode.segs.map((s) => s.name)].join("::");
|
|
65486
65507
|
const prefix = importNode.visibility ? `${importNode.visibility} ` : "";
|
|
65487
65508
|
actions.push({
|
|
65488
|
-
title: `Convert to 'alias ${importNode.alias} for ${
|
|
65509
|
+
title: `Convert to 'alias ${importNode.alias} for ${path10}'`,
|
|
65489
65510
|
kind: import_vscode_languageserver18.CodeActionKind.RefactorRewrite,
|
|
65490
65511
|
edit: {
|
|
65491
65512
|
changes: {
|
|
65492
|
-
[uri]: [import_vscode_languageserver18.TextEdit.replace(importNode.$cstNode.range, `${prefix}alias ${importNode.alias} for ${
|
|
65513
|
+
[uri]: [import_vscode_languageserver18.TextEdit.replace(importNode.$cstNode.range, `${prefix}alias ${importNode.alias} for ${path10};`)]
|
|
65493
65514
|
}
|
|
65494
65515
|
}
|
|
65495
65516
|
});
|
|
@@ -66455,10 +66476,10 @@ function indexByName(root3, type) {
|
|
|
66455
66476
|
});
|
|
66456
66477
|
return map3;
|
|
66457
66478
|
}
|
|
66458
|
-
function lastSegment3(
|
|
66459
|
-
if (!
|
|
66479
|
+
function lastSegment3(path10) {
|
|
66480
|
+
if (!path10)
|
|
66460
66481
|
return void 0;
|
|
66461
|
-
return
|
|
66482
|
+
return path10.split(/::|\./).pop();
|
|
66462
66483
|
}
|
|
66463
66484
|
function qualifiedNameOf2(node) {
|
|
66464
66485
|
const parts = [];
|
|
@@ -67152,8 +67173,6 @@ function normalizeDiagnosticCode(diagnostic) {
|
|
|
67152
67173
|
|
|
67153
67174
|
// ../language-server/out/src/services/workspace-manager.js
|
|
67154
67175
|
var import_vscode_languageserver26 = __toESM(require_main4(), 1);
|
|
67155
|
-
import * as fs3 from "fs/promises";
|
|
67156
|
-
import * as path3 from "path";
|
|
67157
67176
|
var PROJECT_FILE_EXTENSIONS = /* @__PURE__ */ new Map([
|
|
67158
67177
|
[".kpar", "kpar"],
|
|
67159
67178
|
[".sysml", "source"],
|
|
@@ -67181,7 +67200,7 @@ var SysmlWorkspaceManager = class extends DefaultWorkspaceManager {
|
|
|
67181
67200
|
this.folders = folders;
|
|
67182
67201
|
this.projectInfo.clear();
|
|
67183
67202
|
for (const folder of folders) {
|
|
67184
|
-
this.projectInfo.set(folder.uri, await detectSysmlProjectFolder(folder, cancelToken));
|
|
67203
|
+
this.projectInfo.set(folder.uri, await detectSysmlProjectFolder(folder, this.fileSystemProvider, cancelToken));
|
|
67185
67204
|
}
|
|
67186
67205
|
if (cancelToken.isCancellationRequested) {
|
|
67187
67206
|
return;
|
|
@@ -67208,12 +67227,12 @@ var SysmlWorkspaceManager = class extends DefaultWorkspaceManager {
|
|
|
67208
67227
|
return [...this.projectInfo.values()];
|
|
67209
67228
|
}
|
|
67210
67229
|
};
|
|
67211
|
-
async function detectSysmlProjectFolder(workspaceFolder, cancelToken = import_vscode_languageserver26.CancellationToken.None) {
|
|
67230
|
+
async function detectSysmlProjectFolder(workspaceFolder, fileSystem, cancelToken = import_vscode_languageserver26.CancellationToken.None) {
|
|
67212
67231
|
const markers = [];
|
|
67213
67232
|
let scanned = 0;
|
|
67214
67233
|
let root3;
|
|
67215
67234
|
try {
|
|
67216
|
-
root3 = URI2.parse(workspaceFolder.uri)
|
|
67235
|
+
root3 = URI2.parse(workspaceFolder.uri);
|
|
67217
67236
|
} catch {
|
|
67218
67237
|
return { workspaceFolder, isSysmlProject: false, markers };
|
|
67219
67238
|
}
|
|
@@ -67223,28 +67242,24 @@ async function detectSysmlProjectFolder(workspaceFolder, cancelToken = import_vs
|
|
|
67223
67242
|
}
|
|
67224
67243
|
let entries;
|
|
67225
67244
|
try {
|
|
67226
|
-
entries = await
|
|
67245
|
+
entries = await fileSystem.readDirectory(directory);
|
|
67227
67246
|
} catch {
|
|
67228
67247
|
return false;
|
|
67229
67248
|
}
|
|
67230
67249
|
scanned += entries.length;
|
|
67231
67250
|
for (const entry of entries) {
|
|
67232
|
-
if (!entry.isFile
|
|
67251
|
+
if (!entry.isFile)
|
|
67233
67252
|
continue;
|
|
67234
|
-
const
|
|
67235
|
-
const kind = PROJECT_FILE_EXTENSIONS.get(path3.extname(name));
|
|
67253
|
+
const kind = PROJECT_FILE_EXTENSIONS.get(extensionOf(UriUtils.basename(entry.uri)));
|
|
67236
67254
|
if (!kind)
|
|
67237
67255
|
continue;
|
|
67238
|
-
markers.push({
|
|
67239
|
-
kind,
|
|
67240
|
-
path: path3.relative(root3, path3.join(directory, entry.name)).replace(/\\/g, "/")
|
|
67241
|
-
});
|
|
67256
|
+
markers.push({ kind, path: UriUtils.relative(root3, entry.uri) });
|
|
67242
67257
|
return true;
|
|
67243
67258
|
}
|
|
67244
67259
|
for (const entry of entries) {
|
|
67245
|
-
if (!entry.isDirectory
|
|
67260
|
+
if (!entry.isDirectory || SKIPPED_PROJECT_SCAN_DIRS.has(UriUtils.basename(entry.uri)))
|
|
67246
67261
|
continue;
|
|
67247
|
-
if (await scanDirectory(
|
|
67262
|
+
if (await scanDirectory(entry.uri))
|
|
67248
67263
|
return true;
|
|
67249
67264
|
}
|
|
67250
67265
|
return false;
|
|
@@ -67256,6 +67271,11 @@ async function detectSysmlProjectFolder(workspaceFolder, cancelToken = import_vs
|
|
|
67256
67271
|
markers
|
|
67257
67272
|
};
|
|
67258
67273
|
}
|
|
67274
|
+
function extensionOf(name) {
|
|
67275
|
+
const lower = name.toLowerCase();
|
|
67276
|
+
const dot = lower.lastIndexOf(".");
|
|
67277
|
+
return dot > 0 ? lower.slice(dot) : "";
|
|
67278
|
+
}
|
|
67259
67279
|
|
|
67260
67280
|
// ../language-server/out/src/services/value-converter.js
|
|
67261
67281
|
var SysmlValueConverter = class extends DefaultValueConverter {
|
|
@@ -67368,17 +67388,134 @@ function createSysMLServices(context) {
|
|
|
67368
67388
|
}
|
|
67369
67389
|
|
|
67370
67390
|
// ../language-server/out/src/services/library-loader.js
|
|
67371
|
-
|
|
67372
|
-
|
|
67391
|
+
var INDEXING_STATUS_NOTIFICATION = "sysml/indexingStatus";
|
|
67392
|
+
var LIBRARY_LOAD_BATCH_SIZE = 8;
|
|
67393
|
+
var LibraryLoader = class {
|
|
67394
|
+
shared;
|
|
67395
|
+
constructor(shared) {
|
|
67396
|
+
this.shared = shared;
|
|
67397
|
+
}
|
|
67398
|
+
// REQ-002, REQ-003, REQ-009, REQ-075, REQ-077, REQ-082, REQ-086, REQ-251 — Index bundled/configured SysML and KerML library files
|
|
67399
|
+
async loadLibrary(userLibraryPath) {
|
|
67400
|
+
const connection = this.shared.lsp.Connection;
|
|
67401
|
+
const platform = getPlatform();
|
|
67402
|
+
const resolved = await platform.resolveLibraryRoot(userLibraryPath);
|
|
67403
|
+
if (!resolved) {
|
|
67404
|
+
this.notify({ state: "ready", fileCount: 0, phase: "library" });
|
|
67405
|
+
return 0;
|
|
67406
|
+
}
|
|
67407
|
+
const libRoot = resolved.uri;
|
|
67408
|
+
registerLibraryRoot(libRoot);
|
|
67409
|
+
if (resolved.bundled) {
|
|
67410
|
+
const precomputed = await this.loadBundledPrecomputedIndex(libRoot);
|
|
67411
|
+
if (precomputed !== void 0) {
|
|
67412
|
+
connection?.console.log(`SysML: Loaded ${precomputed} precomputed library symbols from ${libRoot.toString()}`);
|
|
67413
|
+
this.notify({
|
|
67414
|
+
state: "ready",
|
|
67415
|
+
fileCount: precomputed,
|
|
67416
|
+
phase: "library",
|
|
67417
|
+
mode: "precomputed"
|
|
67418
|
+
});
|
|
67419
|
+
return precomputed;
|
|
67420
|
+
}
|
|
67421
|
+
connection?.console.warn("SysML: bundled standard-library index missing or unreadable; falling back to runtime indexing.");
|
|
67422
|
+
}
|
|
67423
|
+
const files = await platform.collectLibraryFiles(libRoot);
|
|
67424
|
+
if (files.length === 0) {
|
|
67425
|
+
this.notify({ state: "ready", fileCount: 0, totalFileCount: 0, phase: "library", mode: "runtime" });
|
|
67426
|
+
return 0;
|
|
67427
|
+
}
|
|
67428
|
+
this.notify({
|
|
67429
|
+
state: "indexing",
|
|
67430
|
+
fileCount: 0,
|
|
67431
|
+
totalFileCount: files.length,
|
|
67432
|
+
phase: "library",
|
|
67433
|
+
mode: "runtime"
|
|
67434
|
+
});
|
|
67435
|
+
let loaded = 0;
|
|
67436
|
+
const workspace = this.shared.workspace;
|
|
67437
|
+
const docs = [];
|
|
67438
|
+
for (let i = 0; i < files.length; i++) {
|
|
67439
|
+
const uri = files[i];
|
|
67440
|
+
try {
|
|
67441
|
+
const doc = await workspace.LangiumDocuments.getOrCreateDocument(uri);
|
|
67442
|
+
doc.isLibraryDocument = true;
|
|
67443
|
+
docs.push(doc);
|
|
67444
|
+
loaded++;
|
|
67445
|
+
} catch {
|
|
67446
|
+
}
|
|
67447
|
+
if ((i + 1) % LIBRARY_LOAD_BATCH_SIZE === 0 || i + 1 === files.length) {
|
|
67448
|
+
this.notify({
|
|
67449
|
+
state: "indexing",
|
|
67450
|
+
fileCount: loaded,
|
|
67451
|
+
totalFileCount: files.length,
|
|
67452
|
+
phase: "library",
|
|
67453
|
+
mode: "runtime"
|
|
67454
|
+
});
|
|
67455
|
+
await this.yieldToEventLoop();
|
|
67456
|
+
}
|
|
67457
|
+
}
|
|
67458
|
+
if (docs.length > 0) {
|
|
67459
|
+
await workspace.DocumentBuilder.build(docs, { validation: false });
|
|
67460
|
+
}
|
|
67461
|
+
connection?.console.log(`SysML: Loaded ${loaded} library files from ${libRoot.toString()}`);
|
|
67462
|
+
this.notify({
|
|
67463
|
+
state: "ready",
|
|
67464
|
+
fileCount: loaded,
|
|
67465
|
+
totalFileCount: files.length,
|
|
67466
|
+
phase: "library",
|
|
67467
|
+
mode: "runtime"
|
|
67468
|
+
});
|
|
67469
|
+
return loaded;
|
|
67470
|
+
}
|
|
67471
|
+
// REQ-075, REQ-383 — Load the precomputed symbol index shipped beside the
|
|
67472
|
+
// bundled library, then make that library's SOURCE readable synchronously so
|
|
67473
|
+
// the linker can resolve an index description on demand (see
|
|
67474
|
+
// `SysmlPlatform.primeLibrarySources`). Priming is driven by the file list in
|
|
67475
|
+
// the index we just parsed, so the 8 MB document is never read twice.
|
|
67476
|
+
async loadBundledPrecomputedIndex(libraryRoot) {
|
|
67477
|
+
const platform = getPlatform();
|
|
67478
|
+
const raw = await platform.readResource("sysml.library.index.json");
|
|
67479
|
+
if (raw === void 0)
|
|
67480
|
+
return void 0;
|
|
67481
|
+
const indexManager = this.shared.workspace.IndexManager;
|
|
67482
|
+
if (!isSysmlIndexManager(indexManager))
|
|
67483
|
+
return void 0;
|
|
67484
|
+
try {
|
|
67485
|
+
const index = JSON.parse(raw);
|
|
67486
|
+
if (index.version !== 1)
|
|
67487
|
+
return void 0;
|
|
67488
|
+
const symbolCount = indexManager.loadPrecomputedLibraryIndex(index, libraryRoot);
|
|
67489
|
+
await platform.primeLibrarySources(libraryRoot, index.files.map((file) => file.path));
|
|
67490
|
+
return symbolCount;
|
|
67491
|
+
} catch (err) {
|
|
67492
|
+
this.shared.lsp.Connection?.console.warn(`SysML: failed to load precomputed library index: ${String(err)}`);
|
|
67493
|
+
return void 0;
|
|
67494
|
+
}
|
|
67495
|
+
}
|
|
67496
|
+
notify(status) {
|
|
67497
|
+
this.shared.lsp.Connection?.sendNotification(INDEXING_STATUS_NOTIFICATION, status);
|
|
67498
|
+
}
|
|
67499
|
+
// REQ-383 — Yield so the indexing-progress notifications actually reach the
|
|
67500
|
+
// client mid-load. `setImmediate` does not exist in a Web Worker, so this
|
|
67501
|
+
// uses the portable macrotask hop both hosts have.
|
|
67502
|
+
yieldToEventLoop() {
|
|
67503
|
+
return new Promise((resolve7) => setTimeout(resolve7, 0));
|
|
67504
|
+
}
|
|
67505
|
+
};
|
|
67506
|
+
|
|
67507
|
+
// ../language-server/out/src/platform/node-platform.js
|
|
67508
|
+
import * as fs3 from "fs";
|
|
67509
|
+
import * as path4 from "path";
|
|
67373
67510
|
|
|
67374
67511
|
// ../language-server/out/src/services/kpar.js
|
|
67375
|
-
import * as
|
|
67512
|
+
import * as fs2 from "fs";
|
|
67376
67513
|
import * as os from "os";
|
|
67377
|
-
import * as
|
|
67514
|
+
import * as path3 from "path";
|
|
67378
67515
|
import * as zlib from "zlib";
|
|
67379
67516
|
|
|
67380
67517
|
// ../language-server/out/src/services/abstract-syntax.js
|
|
67381
|
-
import * as
|
|
67518
|
+
import * as path2 from "path";
|
|
67382
67519
|
var RESERVED_WORDS = /* @__PURE__ */ new Set([
|
|
67383
67520
|
"abstract",
|
|
67384
67521
|
"action",
|
|
@@ -67758,7 +67895,7 @@ function forEachObject(value, cb, seen = /* @__PURE__ */ new Set()) {
|
|
|
67758
67895
|
}
|
|
67759
67896
|
}
|
|
67760
67897
|
function abstractSyntaxProjectionPath(jsonPath) {
|
|
67761
|
-
const ext =
|
|
67898
|
+
const ext = path2.extname(jsonPath);
|
|
67762
67899
|
return ext ? jsonPath.slice(0, -ext.length) + ".abstract.sysml" : `${jsonPath}.abstract.sysml`;
|
|
67763
67900
|
}
|
|
67764
67901
|
|
|
@@ -67769,9 +67906,9 @@ function isKparFile(p) {
|
|
|
67769
67906
|
}
|
|
67770
67907
|
function isKparDir(p) {
|
|
67771
67908
|
try {
|
|
67772
|
-
if (!
|
|
67909
|
+
if (!fs2.statSync(p).isDirectory())
|
|
67773
67910
|
return false;
|
|
67774
|
-
return
|
|
67911
|
+
return fs2.readdirSync(p).some((name) => name.toLowerCase().endsWith(".kpar"));
|
|
67775
67912
|
} catch {
|
|
67776
67913
|
return false;
|
|
67777
67914
|
}
|
|
@@ -67848,7 +67985,7 @@ function decodeLocalEntry(buffer, localHeaderOffset, method, compressedSize, max
|
|
|
67848
67985
|
return void 0;
|
|
67849
67986
|
}
|
|
67850
67987
|
function extractKparModelFiles(kparPath, destDir, options = {}) {
|
|
67851
|
-
const buffer =
|
|
67988
|
+
const buffer = fs2.readFileSync(kparPath);
|
|
67852
67989
|
const entries = readZipEntries(buffer);
|
|
67853
67990
|
const written = [];
|
|
67854
67991
|
let textualCount = 0;
|
|
@@ -67871,7 +68008,7 @@ function extractKparModelFiles(kparPath, destDir, options = {}) {
|
|
|
67871
68008
|
if (!lower.endsWith(".json") || lower.endsWith(".meta.json") || lower.endsWith(".project.json"))
|
|
67872
68009
|
continue;
|
|
67873
68010
|
try {
|
|
67874
|
-
const converted = abstractSyntaxJsonToSysml(entry.data.toString("utf8"),
|
|
68011
|
+
const converted = abstractSyntaxJsonToSysml(entry.data.toString("utf8"), path3.basename(entry.name, path3.extname(entry.name)));
|
|
67875
68012
|
if (converted.elementCount === 0)
|
|
67876
68013
|
continue;
|
|
67877
68014
|
const target = safeTargetPath(destDir, abstractSyntaxProjectionPath(entry.name));
|
|
@@ -67890,16 +68027,16 @@ function extractKparDistribution(distributionPath) {
|
|
|
67890
68027
|
return extractKparDistributionFiles(distributionPath)?.root;
|
|
67891
68028
|
}
|
|
67892
68029
|
function extractKparDistributionFiles(distributionPath, destRoot, options = { jsonAbstractSyntax: "when-no-text" }) {
|
|
67893
|
-
const archives = isKparFile(distributionPath) ? [distributionPath] :
|
|
68030
|
+
const archives = isKparFile(distributionPath) ? [distributionPath] : fs2.readdirSync(distributionPath).filter((name) => name.toLowerCase().endsWith(".kpar")).sort((a2, b) => a2.localeCompare(b)).map((name) => path3.join(distributionPath, name));
|
|
67894
68031
|
if (archives.length === 0)
|
|
67895
68032
|
return void 0;
|
|
67896
|
-
const root3 = destRoot ??
|
|
67897
|
-
|
|
68033
|
+
const root3 = destRoot ?? fs2.mkdtempSync(path3.join(os.tmpdir(), "sysml-kpar-"));
|
|
68034
|
+
fs2.mkdirSync(root3, { recursive: true });
|
|
67898
68035
|
const files = [];
|
|
67899
68036
|
let textualCount = 0;
|
|
67900
68037
|
let jsonCount = 0;
|
|
67901
68038
|
for (const archive of archives) {
|
|
67902
|
-
const sub =
|
|
68039
|
+
const sub = path3.join(root3, path3.basename(archive, path3.extname(archive)));
|
|
67903
68040
|
try {
|
|
67904
68041
|
const extracted = extractKparModelFiles(archive, sub, {
|
|
67905
68042
|
jsonAbstractSyntax: options.jsonAbstractSyntax ?? "when-no-text",
|
|
@@ -67914,7 +68051,7 @@ function extractKparDistributionFiles(distributionPath, destRoot, options = { js
|
|
|
67914
68051
|
if (files.length === 0) {
|
|
67915
68052
|
if (!destRoot) {
|
|
67916
68053
|
try {
|
|
67917
|
-
|
|
68054
|
+
fs2.rmSync(root3, { recursive: true, force: true });
|
|
67918
68055
|
} catch {
|
|
67919
68056
|
}
|
|
67920
68057
|
}
|
|
@@ -67932,179 +68069,103 @@ function safeTargetPath(destDir, entryName) {
|
|
|
67932
68069
|
const safe = entryName.replace(/\\/gu, "/").split("/").filter((seg) => seg && seg !== "." && seg !== "..");
|
|
67933
68070
|
if (safe.length === 0)
|
|
67934
68071
|
return void 0;
|
|
67935
|
-
return
|
|
68072
|
+
return path3.join(destDir, ...safe);
|
|
67936
68073
|
}
|
|
67937
68074
|
function writeExtractedFile(target, data, readonly) {
|
|
67938
|
-
|
|
67939
|
-
|
|
68075
|
+
fs2.mkdirSync(path3.dirname(target), { recursive: true });
|
|
68076
|
+
fs2.writeFileSync(target, data);
|
|
67940
68077
|
if (readonly) {
|
|
67941
68078
|
try {
|
|
67942
|
-
|
|
68079
|
+
fs2.chmodSync(target, 292);
|
|
67943
68080
|
} catch {
|
|
67944
68081
|
}
|
|
67945
68082
|
}
|
|
67946
68083
|
}
|
|
67947
68084
|
|
|
67948
|
-
// ../language-server/out/src/
|
|
67949
|
-
var
|
|
67950
|
-
|
|
67951
|
-
|
|
67952
|
-
|
|
67953
|
-
constructor(shared) {
|
|
67954
|
-
this.shared = shared;
|
|
68085
|
+
// ../language-server/out/src/platform/node-platform.js
|
|
68086
|
+
var NodePlatform = class {
|
|
68087
|
+
extensionRoot;
|
|
68088
|
+
constructor(extensionRoot) {
|
|
68089
|
+
this.extensionRoot = extensionRoot;
|
|
67955
68090
|
}
|
|
67956
|
-
|
|
67957
|
-
|
|
67958
|
-
|
|
67959
|
-
|
|
67960
|
-
|
|
67961
|
-
|
|
67962
|
-
|
|
67963
|
-
|
|
67964
|
-
const libPath = resolved.path;
|
|
67965
|
-
registerLibraryRoot(libPath);
|
|
67966
|
-
if (resolved.bundled) {
|
|
67967
|
-
const precomputed = this.loadBundledPrecomputedIndex(extensionPath, libPath);
|
|
67968
|
-
if (precomputed !== void 0) {
|
|
67969
|
-
connection?.console.log(`SysML: Loaded ${precomputed} precomputed library symbols from ${libPath}`);
|
|
67970
|
-
this.notify({
|
|
67971
|
-
state: "ready",
|
|
67972
|
-
fileCount: precomputed,
|
|
67973
|
-
phase: "library",
|
|
67974
|
-
mode: "precomputed"
|
|
67975
|
-
});
|
|
67976
|
-
return precomputed;
|
|
67977
|
-
}
|
|
67978
|
-
connection?.console.warn("SysML: bundled standard-library index missing or unreadable; falling back to runtime indexing.");
|
|
67979
|
-
}
|
|
67980
|
-
const files = this.collectLibraryFiles(libPath);
|
|
67981
|
-
if (files.length === 0) {
|
|
67982
|
-
this.notify({ state: "ready", fileCount: 0, totalFileCount: 0, phase: "library", mode: "runtime" });
|
|
67983
|
-
return 0;
|
|
67984
|
-
}
|
|
67985
|
-
this.notify({
|
|
67986
|
-
state: "indexing",
|
|
67987
|
-
fileCount: 0,
|
|
67988
|
-
totalFileCount: files.length,
|
|
67989
|
-
phase: "library",
|
|
67990
|
-
mode: "runtime"
|
|
67991
|
-
});
|
|
67992
|
-
let loaded = 0;
|
|
67993
|
-
const workspace = this.shared.workspace;
|
|
67994
|
-
const docs = [];
|
|
67995
|
-
for (let i = 0; i < files.length; i++) {
|
|
67996
|
-
const file = files[i];
|
|
67997
|
-
try {
|
|
67998
|
-
const uri = URI2.file(file);
|
|
67999
|
-
const doc = await workspace.LangiumDocuments.getOrCreateDocument(uri);
|
|
68000
|
-
doc.isLibraryDocument = true;
|
|
68001
|
-
docs.push(doc);
|
|
68002
|
-
loaded++;
|
|
68003
|
-
} catch {
|
|
68004
|
-
}
|
|
68005
|
-
if ((i + 1) % LIBRARY_LOAD_BATCH_SIZE === 0 || i + 1 === files.length) {
|
|
68006
|
-
this.notify({
|
|
68007
|
-
state: "indexing",
|
|
68008
|
-
fileCount: loaded,
|
|
68009
|
-
totalFileCount: files.length,
|
|
68010
|
-
phase: "library",
|
|
68011
|
-
mode: "runtime"
|
|
68012
|
-
});
|
|
68013
|
-
await this.yieldToEventLoop();
|
|
68014
|
-
}
|
|
68015
|
-
}
|
|
68016
|
-
if (docs.length > 0) {
|
|
68017
|
-
await workspace.DocumentBuilder.build(docs, { validation: false });
|
|
68091
|
+
async readResource(relativePath) {
|
|
68092
|
+
try {
|
|
68093
|
+
const target = path4.join(this.extensionRoot, "resources", ...relativePath.split("/"));
|
|
68094
|
+
if (!fs3.existsSync(target))
|
|
68095
|
+
return void 0;
|
|
68096
|
+
return fs3.readFileSync(target, "utf8");
|
|
68097
|
+
} catch {
|
|
68098
|
+
return void 0;
|
|
68018
68099
|
}
|
|
68019
|
-
connection?.console.log(`SysML: Loaded ${loaded} library files from ${libPath}`);
|
|
68020
|
-
this.notify({
|
|
68021
|
-
state: "ready",
|
|
68022
|
-
fileCount: loaded,
|
|
68023
|
-
totalFileCount: files.length,
|
|
68024
|
-
phase: "library",
|
|
68025
|
-
mode: "runtime"
|
|
68026
|
-
});
|
|
68027
|
-
return loaded;
|
|
68028
68100
|
}
|
|
68029
|
-
// REQ-076, REQ-
|
|
68030
|
-
//
|
|
68031
|
-
//
|
|
68032
|
-
//
|
|
68033
|
-
//
|
|
68034
|
-
|
|
68035
|
-
|
|
68036
|
-
|
|
68037
|
-
|
|
68038
|
-
|
|
68039
|
-
if (userPath && userPath.length > 0) {
|
|
68040
|
-
const resolved = path6.resolve(userPath);
|
|
68041
|
-
if (fs5.existsSync(resolved)) {
|
|
68101
|
+
// REQ-076, REQ-090 — Prefer the configured library path, fall back to the
|
|
68102
|
+
// bundled library. A configured `.kpar` archive (or a directory of them,
|
|
68103
|
+
// e.g. the OMG `sysml.library.kpar/` distribution) is extracted to a temp
|
|
68104
|
+
// directory and routed into the SAME index path as an unzipped tree, so
|
|
68105
|
+
// there is no parallel loader.
|
|
68106
|
+
async resolveLibraryRoot(userLibraryPath) {
|
|
68107
|
+
const bundled = path4.join(this.extensionRoot, "resources", "sysml.library");
|
|
68108
|
+
if (userLibraryPath && userLibraryPath.length > 0) {
|
|
68109
|
+
const resolved = path4.resolve(userLibraryPath);
|
|
68110
|
+
if (fs3.existsSync(resolved)) {
|
|
68042
68111
|
if (classifyDistribution(resolved) === "kpar") {
|
|
68043
68112
|
const extracted = extractKparDistribution(resolved);
|
|
68044
68113
|
if (extracted) {
|
|
68045
|
-
|
|
68046
|
-
return { path: extracted, bundled: false, format: "kpar" };
|
|
68114
|
+
return { uri: URI2.file(extracted), bundled: false, format: "kpar" };
|
|
68047
68115
|
}
|
|
68048
|
-
|
|
68049
|
-
return null;
|
|
68116
|
+
return void 0;
|
|
68050
68117
|
}
|
|
68051
68118
|
return {
|
|
68052
|
-
|
|
68053
|
-
bundled:
|
|
68119
|
+
uri: URI2.file(resolved),
|
|
68120
|
+
bundled: path4.resolve(resolved) === path4.resolve(bundled),
|
|
68054
68121
|
format: "tree"
|
|
68055
68122
|
};
|
|
68056
68123
|
}
|
|
68057
68124
|
}
|
|
68058
|
-
if (
|
|
68059
|
-
return {
|
|
68060
|
-
return
|
|
68125
|
+
if (fs3.existsSync(bundled))
|
|
68126
|
+
return { uri: URI2.file(bundled), bundled: true, format: "tree" };
|
|
68127
|
+
return void 0;
|
|
68061
68128
|
}
|
|
68062
|
-
|
|
68063
|
-
|
|
68064
|
-
|
|
68065
|
-
|
|
68066
|
-
|
|
68067
|
-
|
|
68068
|
-
|
|
68129
|
+
libraryUri(libraryRoot, relativePath) {
|
|
68130
|
+
return UriUtils.joinPath(libraryRoot, ...relativePath.split("/"));
|
|
68131
|
+
}
|
|
68132
|
+
// REQ-075 — Node reads library source on demand inside the linker, so there
|
|
68133
|
+
// is nothing to pre-load.
|
|
68134
|
+
async primeLibrarySources() {
|
|
68135
|
+
}
|
|
68136
|
+
readLibrarySourceSync(uri) {
|
|
68069
68137
|
try {
|
|
68070
|
-
|
|
68071
|
-
|
|
68072
|
-
if (index.version !== 1)
|
|
68073
|
-
return void 0;
|
|
68074
|
-
return indexManager.loadPrecomputedLibraryIndex(index, libraryRoot);
|
|
68075
|
-
} catch (err) {
|
|
68076
|
-
this.shared.lsp.Connection?.console.warn(`SysML: failed to load precomputed library index: ${String(err)}`);
|
|
68138
|
+
return fs3.readFileSync(uri.fsPath, "utf8");
|
|
68139
|
+
} catch {
|
|
68077
68140
|
return void 0;
|
|
68078
68141
|
}
|
|
68079
68142
|
}
|
|
68080
|
-
// REQ-075, REQ-082, REQ-086 — Recursively collect
|
|
68081
|
-
collectLibraryFiles(
|
|
68143
|
+
// REQ-075, REQ-082, REQ-086 — Recursively collect library source files.
|
|
68144
|
+
async collectLibraryFiles(libraryRoot) {
|
|
68082
68145
|
const files = [];
|
|
68083
|
-
|
|
68084
|
-
|
|
68146
|
+
const walk = (dir) => {
|
|
68147
|
+
let entries;
|
|
68148
|
+
try {
|
|
68149
|
+
entries = fs3.readdirSync(dir, { withFileTypes: true }).sort((a2, b) => a2.name.localeCompare(b.name));
|
|
68150
|
+
} catch {
|
|
68151
|
+
return;
|
|
68152
|
+
}
|
|
68085
68153
|
for (const entry of entries) {
|
|
68086
|
-
const
|
|
68087
|
-
if (entry.isDirectory())
|
|
68088
|
-
|
|
68089
|
-
|
|
68090
|
-
files.push(
|
|
68091
|
-
}
|
|
68154
|
+
const full = path4.join(dir, entry.name);
|
|
68155
|
+
if (entry.isDirectory())
|
|
68156
|
+
walk(full);
|
|
68157
|
+
else if (entry.name.endsWith(".sysml") || entry.name.endsWith(".kerml"))
|
|
68158
|
+
files.push(URI2.file(full));
|
|
68092
68159
|
}
|
|
68093
|
-
}
|
|
68094
|
-
|
|
68160
|
+
};
|
|
68161
|
+
walk(libraryRoot.fsPath);
|
|
68095
68162
|
return files;
|
|
68096
68163
|
}
|
|
68097
|
-
notify(status) {
|
|
68098
|
-
this.shared.lsp.Connection?.sendNotification(INDEXING_STATUS_NOTIFICATION, status);
|
|
68099
|
-
}
|
|
68100
|
-
yieldToEventLoop() {
|
|
68101
|
-
return new Promise((resolve7) => setImmediate(resolve7));
|
|
68102
|
-
}
|
|
68103
68164
|
};
|
|
68104
68165
|
|
|
68105
68166
|
// ../cli/src/discovery.ts
|
|
68106
|
-
import * as
|
|
68107
|
-
import * as
|
|
68167
|
+
import * as fs4 from "fs";
|
|
68168
|
+
import * as path5 from "path";
|
|
68108
68169
|
var MODEL_EXTENSIONS = [".sysml", ".kerml"];
|
|
68109
68170
|
var SKIP_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
68110
68171
|
"node_modules",
|
|
@@ -68118,21 +68179,21 @@ var SKIP_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
|
68118
68179
|
]);
|
|
68119
68180
|
var MAX_INDEXED_FILES = 5e3;
|
|
68120
68181
|
function isModelFile(file) {
|
|
68121
|
-
return MODEL_EXTENSIONS.includes(
|
|
68182
|
+
return MODEL_EXTENSIONS.includes(path5.extname(file).toLowerCase());
|
|
68122
68183
|
}
|
|
68123
68184
|
function walkModelFiles(dir, limit = Infinity) {
|
|
68124
68185
|
const found = [];
|
|
68125
|
-
const visit = (
|
|
68186
|
+
const visit = (current2) => {
|
|
68126
68187
|
if (found.length >= limit) return;
|
|
68127
68188
|
let entries;
|
|
68128
68189
|
try {
|
|
68129
|
-
entries =
|
|
68190
|
+
entries = fs4.readdirSync(current2, { withFileTypes: true });
|
|
68130
68191
|
} catch {
|
|
68131
68192
|
return;
|
|
68132
68193
|
}
|
|
68133
68194
|
for (const entry of entries.sort((a2, b) => a2.name.localeCompare(b.name))) {
|
|
68134
68195
|
if (found.length >= limit) return;
|
|
68135
|
-
const full =
|
|
68196
|
+
const full = path5.join(current2, entry.name);
|
|
68136
68197
|
if (entry.isDirectory()) {
|
|
68137
68198
|
if (!SKIP_DIRECTORIES.has(entry.name) && !entry.name.startsWith(".")) visit(full);
|
|
68138
68199
|
continue;
|
|
@@ -68140,7 +68201,7 @@ function walkModelFiles(dir, limit = Infinity) {
|
|
|
68140
68201
|
if (isModelFile(entry.name)) found.push(full);
|
|
68141
68202
|
}
|
|
68142
68203
|
};
|
|
68143
|
-
visit(
|
|
68204
|
+
visit(path5.resolve(dir));
|
|
68144
68205
|
return found;
|
|
68145
68206
|
}
|
|
68146
68207
|
|
|
@@ -68161,11 +68222,11 @@ function diagnosticsOf(document, file) {
|
|
|
68161
68222
|
function resolveResourceRoot(fromDir) {
|
|
68162
68223
|
const candidates = [
|
|
68163
68224
|
fromDir,
|
|
68164
|
-
|
|
68165
|
-
|
|
68166
|
-
|
|
68225
|
+
path6.resolve(fromDir, ".."),
|
|
68226
|
+
path6.resolve(fromDir, "..", "..", "extension"),
|
|
68227
|
+
path6.resolve(fromDir, "..", "..", "..", "extension")
|
|
68167
68228
|
];
|
|
68168
|
-
return candidates.find((dir) =>
|
|
68229
|
+
return candidates.find((dir) => fs5.existsSync(path6.join(dir, "resources", "sysml.library")));
|
|
68169
68230
|
}
|
|
68170
68231
|
async function bootServices(options) {
|
|
68171
68232
|
const { shared } = createSysMLServices({ ...NodeFileSystem });
|
|
@@ -68173,11 +68234,12 @@ async function bootServices(options) {
|
|
|
68173
68234
|
if (!resourceRoot && !options.library) {
|
|
68174
68235
|
throw new Error("Standard library not found; pass --library <dir> or reinstall the package.");
|
|
68175
68236
|
}
|
|
68176
|
-
|
|
68237
|
+
setPlatform(new NodePlatform(resourceRoot ?? ""));
|
|
68238
|
+
await new LibraryLoader(shared).loadLibrary(options.library);
|
|
68177
68239
|
loadDimensionTable(resourceRoot);
|
|
68178
68240
|
await shared.workspace.WorkspaceManager.initializeWorkspace(
|
|
68179
68241
|
options.workspaceFolders.map((folder) => ({
|
|
68180
|
-
name:
|
|
68242
|
+
name: path6.basename(folder),
|
|
68181
68243
|
uri: URI2.file(folder).toString()
|
|
68182
68244
|
}))
|
|
68183
68245
|
);
|
|
@@ -68199,23 +68261,23 @@ async function bootServices(options) {
|
|
|
68199
68261
|
return {
|
|
68200
68262
|
shared,
|
|
68201
68263
|
indexedFiles,
|
|
68202
|
-
document: (file) => shared.workspace.LangiumDocuments.getOrCreateDocument(URI2.file(
|
|
68264
|
+
document: (file) => shared.workspace.LangiumDocuments.getOrCreateDocument(URI2.file(path6.resolve(file)))
|
|
68203
68265
|
};
|
|
68204
68266
|
}
|
|
68205
68267
|
function loadDimensionTable(resourceRoot) {
|
|
68206
68268
|
if (!resourceRoot) return;
|
|
68207
68269
|
try {
|
|
68208
|
-
const table2 =
|
|
68209
|
-
if (!
|
|
68210
|
-
const parsed = JSON.parse(
|
|
68270
|
+
const table2 = path6.join(resourceRoot, "resources", "sysml.dimension-table.json");
|
|
68271
|
+
if (!fs5.existsSync(table2)) return;
|
|
68272
|
+
const parsed = JSON.parse(fs5.readFileSync(table2, "utf8"));
|
|
68211
68273
|
if (parsed.version === 1) setDimensionTable(parsed);
|
|
68212
68274
|
} catch {
|
|
68213
68275
|
}
|
|
68214
68276
|
}
|
|
68215
68277
|
|
|
68216
68278
|
// ../cli/src/workspace.ts
|
|
68217
|
-
import * as
|
|
68218
|
-
import * as
|
|
68279
|
+
import * as fs6 from "fs";
|
|
68280
|
+
import * as path7 from "path";
|
|
68219
68281
|
|
|
68220
68282
|
// ../extension/src/diagram-project-config.ts
|
|
68221
68283
|
function projectConfigRelPath() {
|
|
@@ -68243,14 +68305,14 @@ function normalizeProjectConfig(value) {
|
|
|
68243
68305
|
|
|
68244
68306
|
// ../cli/src/workspace.ts
|
|
68245
68307
|
function findWorkspaceRoot(target) {
|
|
68246
|
-
const resolved =
|
|
68247
|
-
const start =
|
|
68308
|
+
const resolved = path7.resolve(target);
|
|
68309
|
+
const start = fs6.existsSync(resolved) && fs6.statSync(resolved).isDirectory() ? resolved : path7.dirname(resolved);
|
|
68248
68310
|
let repoRoot;
|
|
68249
68311
|
let dir = start;
|
|
68250
68312
|
for (; ; ) {
|
|
68251
|
-
if (
|
|
68252
|
-
if (repoRoot === void 0 &&
|
|
68253
|
-
const parent =
|
|
68313
|
+
if (fs6.existsSync(path7.join(dir, ".vscode", "sysml"))) return dir;
|
|
68314
|
+
if (repoRoot === void 0 && fs6.existsSync(path7.join(dir, ".git"))) repoRoot = dir;
|
|
68315
|
+
const parent = path7.dirname(dir);
|
|
68254
68316
|
if (parent === dir) break;
|
|
68255
68317
|
dir = parent;
|
|
68256
68318
|
}
|
|
@@ -68259,7 +68321,7 @@ function findWorkspaceRoot(target) {
|
|
|
68259
68321
|
function readJsonFile(file) {
|
|
68260
68322
|
let text;
|
|
68261
68323
|
try {
|
|
68262
|
-
text =
|
|
68324
|
+
text = fs6.readFileSync(file, "utf8");
|
|
68263
68325
|
} catch {
|
|
68264
68326
|
return void 0;
|
|
68265
68327
|
}
|
|
@@ -68303,12 +68365,12 @@ function stripJsonComments(text) {
|
|
|
68303
68365
|
return out.replace(/,(\s*[}\]])/g, "$1");
|
|
68304
68366
|
}
|
|
68305
68367
|
function readProjectConfig(root3) {
|
|
68306
|
-
const raw = readJsonFile(
|
|
68368
|
+
const raw = readJsonFile(path7.join(root3, projectConfigRelPath()));
|
|
68307
68369
|
return raw === void 0 ? void 0 : normalizeProjectConfig(raw);
|
|
68308
68370
|
}
|
|
68309
68371
|
function sysmlSettings(root3) {
|
|
68310
68372
|
const out = {};
|
|
68311
|
-
const settings = readJsonFile(
|
|
68373
|
+
const settings = readJsonFile(path7.join(root3, ".vscode", "settings.json"));
|
|
68312
68374
|
if (settings && typeof settings === "object") {
|
|
68313
68375
|
for (const [key, value] of Object.entries(settings)) {
|
|
68314
68376
|
if (key.startsWith("sysml.")) out[key] = value;
|
|
@@ -68325,15 +68387,15 @@ function collectModelFiles(paths) {
|
|
|
68325
68387
|
const found = [];
|
|
68326
68388
|
const seen = /* @__PURE__ */ new Set();
|
|
68327
68389
|
const add = (file) => {
|
|
68328
|
-
const resolved =
|
|
68390
|
+
const resolved = path8.resolve(file);
|
|
68329
68391
|
if (seen.has(resolved)) return;
|
|
68330
68392
|
seen.add(resolved);
|
|
68331
68393
|
found.push(resolved);
|
|
68332
68394
|
};
|
|
68333
68395
|
for (const target of targets) {
|
|
68334
|
-
const resolved =
|
|
68335
|
-
if (!
|
|
68336
|
-
if (
|
|
68396
|
+
const resolved = path8.resolve(target);
|
|
68397
|
+
if (!fs7.existsSync(resolved)) throw new Error(`No such file or directory: ${target}`);
|
|
68398
|
+
if (fs7.statSync(resolved).isDirectory()) for (const file of walkModelFiles(resolved)) add(file);
|
|
68337
68399
|
else add(resolved);
|
|
68338
68400
|
}
|
|
68339
68401
|
return found;
|
|
@@ -68349,11 +68411,11 @@ function applySettings(settings, lintProfileOverride) {
|
|
|
68349
68411
|
}
|
|
68350
68412
|
async function runValidation(command) {
|
|
68351
68413
|
const files = collectModelFiles(command.paths);
|
|
68352
|
-
const workspaceRoot = command.workspace === void 0 ? void 0 :
|
|
68414
|
+
const workspaceRoot = command.workspace === void 0 ? void 0 : path8.resolve(command.workspace);
|
|
68353
68415
|
const root3 = workspaceRoot ?? findWorkspaceRoot(files[0] ?? command.paths[0] ?? ".");
|
|
68354
68416
|
applySettings(command.noConfig ? {} : sysmlSettings(root3), command.lintProfile);
|
|
68355
68417
|
const services = await bootServices({
|
|
68356
|
-
fromDir:
|
|
68418
|
+
fromDir: path8.dirname(fileURLToPath(import.meta.url)),
|
|
68357
68419
|
library: command.library,
|
|
68358
68420
|
// A validator invocation is scoped exactly to the paths the user named.
|
|
68359
68421
|
// Do not even initialize the inferred repository as a workspace: its
|
|
@@ -68377,7 +68439,7 @@ async function runValidation(command) {
|
|
|
68377
68439
|
}
|
|
68378
68440
|
|
|
68379
68441
|
// src/main.ts
|
|
68380
|
-
var VERSION2 = true ? "0.10.
|
|
68442
|
+
var VERSION2 = true ? "0.10.18" : "dev";
|
|
68381
68443
|
async function main(argv) {
|
|
68382
68444
|
const command = parseArgs(argv);
|
|
68383
68445
|
if (command.kind === "help") {
|
|
@@ -68407,7 +68469,7 @@ ${USAGE}`);
|
|
|
68407
68469
|
process.stderr.write("sysml-validate: no .sysml or .kerml files found.\n");
|
|
68408
68470
|
return 2;
|
|
68409
68471
|
}
|
|
68410
|
-
const root3 = command.workspace ?
|
|
68472
|
+
const root3 = command.workspace ? path9.resolve(command.workspace) : findWorkspaceRoot(run.files[0]);
|
|
68411
68473
|
const color = command.color ?? (command.out === void 0 && process.stdout.isTTY === true && !process.env.NO_COLOR);
|
|
68412
68474
|
const report = formatReport(run, {
|
|
68413
68475
|
format: command.format,
|
|
@@ -68419,8 +68481,8 @@ ${USAGE}`);
|
|
|
68419
68481
|
});
|
|
68420
68482
|
if (command.out) {
|
|
68421
68483
|
try {
|
|
68422
|
-
|
|
68423
|
-
|
|
68484
|
+
fs8.mkdirSync(path9.dirname(path9.resolve(command.out)), { recursive: true });
|
|
68485
|
+
fs8.writeFileSync(path9.resolve(command.out), report, "utf8");
|
|
68424
68486
|
} catch (err) {
|
|
68425
68487
|
process.stderr.write(`sysml-validate: cannot write ${command.out}: ${err instanceof Error ? err.message : String(err)}
|
|
68426
68488
|
`);
|
|
@@ -68448,7 +68510,7 @@ function isEntryPoint() {
|
|
|
68448
68510
|
if (entry === void 0) return false;
|
|
68449
68511
|
const here = fileURLToPath2(import.meta.url);
|
|
68450
68512
|
try {
|
|
68451
|
-
return
|
|
68513
|
+
return fs8.realpathSync(entry) === fs8.realpathSync(here);
|
|
68452
68514
|
} catch {
|
|
68453
68515
|
return pathToFileURL(entry).href === import.meta.url;
|
|
68454
68516
|
}
|