@effect/language-service 0.47.3 → 0.49.0
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 +4 -0
- package/cli.js +215 -210
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +31 -26
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +2976 -713
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +31 -26
- package/transform.js.map +1 -1
|
@@ -26,7 +26,7 @@ __export(effect_lsp_patch_utils_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(effect_lsp_patch_utils_exports);
|
|
28
28
|
|
|
29
|
-
// node_modules/.pnpm
|
|
29
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Function.js
|
|
30
30
|
var isFunction = (input) => typeof input === "function";
|
|
31
31
|
var dual = function(arity, body) {
|
|
32
32
|
if (typeof arity === "function") {
|
|
@@ -120,7 +120,7 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
// node_modules/.pnpm
|
|
123
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/GlobalValue.js
|
|
124
124
|
var globalStoreId = `effect/GlobalValue`;
|
|
125
125
|
var globalStore;
|
|
126
126
|
var globalValue = (id, compute) => {
|
|
@@ -134,7 +134,7 @@ var globalValue = (id, compute) => {
|
|
|
134
134
|
return globalStore.get(id);
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
// node_modules/.pnpm
|
|
137
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Predicate.js
|
|
138
138
|
var isString = (input) => typeof input === "string";
|
|
139
139
|
var isNumber = (input) => typeof input === "number";
|
|
140
140
|
var isBoolean = (input) => typeof input === "boolean";
|
|
@@ -144,7 +144,7 @@ var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
|
|
|
144
144
|
var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
|
|
145
145
|
var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input);
|
|
146
146
|
|
|
147
|
-
// node_modules/.pnpm
|
|
147
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Utils.js
|
|
148
148
|
var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
|
|
149
149
|
var GenKindImpl = class {
|
|
150
150
|
value;
|
|
@@ -266,7 +266,7 @@ var internalCall = isNotOptimizedAway ? standard.effect_internal_function : forc
|
|
|
266
266
|
var genConstructor = function* () {
|
|
267
267
|
}.constructor;
|
|
268
268
|
|
|
269
|
-
// node_modules/.pnpm
|
|
269
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Hash.js
|
|
270
270
|
var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
|
|
271
271
|
var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
|
|
272
272
|
var hash = (self) => {
|
|
@@ -365,7 +365,7 @@ var cached = function() {
|
|
|
365
365
|
return hash2;
|
|
366
366
|
};
|
|
367
367
|
|
|
368
|
-
// node_modules/.pnpm
|
|
368
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Equal.js
|
|
369
369
|
var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
|
|
370
370
|
function equals() {
|
|
371
371
|
if (arguments.length === 1) {
|
|
@@ -419,7 +419,7 @@ function compareBoth(self, that) {
|
|
|
419
419
|
var isEqual = (u) => hasProperty(u, symbol2);
|
|
420
420
|
var equivalence = () => equals;
|
|
421
421
|
|
|
422
|
-
// node_modules/.pnpm
|
|
422
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Inspectable.js
|
|
423
423
|
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
424
424
|
var toJSON = (x) => {
|
|
425
425
|
try {
|
|
@@ -471,7 +471,7 @@ var redact = (u) => {
|
|
|
471
471
|
return u;
|
|
472
472
|
};
|
|
473
473
|
|
|
474
|
-
// node_modules/.pnpm
|
|
474
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Pipeable.js
|
|
475
475
|
var pipeArguments = (self, args2) => {
|
|
476
476
|
switch (args2.length) {
|
|
477
477
|
case 0:
|
|
@@ -504,14 +504,14 @@ var pipeArguments = (self, args2) => {
|
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
506
|
|
|
507
|
-
// node_modules/.pnpm
|
|
507
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/internal/opCodes/effect.js
|
|
508
508
|
var OP_COMMIT = "Commit";
|
|
509
509
|
|
|
510
|
-
// node_modules/.pnpm
|
|
510
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/internal/version.js
|
|
511
511
|
var moduleVersion = "3.18.4";
|
|
512
512
|
var getCurrentVersion = () => moduleVersion;
|
|
513
513
|
|
|
514
|
-
// node_modules/.pnpm
|
|
514
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/internal/effectable.js
|
|
515
515
|
var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
|
|
516
516
|
var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
|
|
517
517
|
var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
|
|
@@ -598,7 +598,7 @@ var StructuralCommitPrototype = {
|
|
|
598
598
|
...StructuralPrototype
|
|
599
599
|
};
|
|
600
600
|
|
|
601
|
-
// node_modules/.pnpm
|
|
601
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/internal/option.js
|
|
602
602
|
var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
|
|
603
603
|
var CommonProto = {
|
|
604
604
|
...EffectPrototype,
|
|
@@ -656,7 +656,7 @@ var some = (value) => {
|
|
|
656
656
|
return a;
|
|
657
657
|
};
|
|
658
658
|
|
|
659
|
-
// node_modules/.pnpm
|
|
659
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/internal/either.js
|
|
660
660
|
var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
|
|
661
661
|
var CommonProto2 = {
|
|
662
662
|
...EffectPrototype,
|
|
@@ -718,7 +718,7 @@ var right = (right3) => {
|
|
|
718
718
|
return a;
|
|
719
719
|
};
|
|
720
720
|
|
|
721
|
-
// node_modules/.pnpm
|
|
721
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Either.js
|
|
722
722
|
var right2 = right;
|
|
723
723
|
var left2 = left;
|
|
724
724
|
var isLeft2 = isLeft;
|
|
@@ -726,14 +726,14 @@ var isRight2 = isRight;
|
|
|
726
726
|
var map = /* @__PURE__ */ dual(2, (self, f) => isRight2(self) ? right2(f(self.right)) : left2(self.left));
|
|
727
727
|
var getOrElse = /* @__PURE__ */ dual(2, (self, onLeft) => isLeft2(self) ? onLeft(self.left) : self.right);
|
|
728
728
|
|
|
729
|
-
// node_modules/.pnpm
|
|
729
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/internal/array.js
|
|
730
730
|
var isNonEmptyArray = (self) => self.length > 0;
|
|
731
731
|
|
|
732
|
-
// node_modules/.pnpm
|
|
732
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Order.js
|
|
733
733
|
var make = (compare) => (self, that) => self === that ? 0 : compare(self, that);
|
|
734
734
|
var string2 = /* @__PURE__ */ make((self, that) => self < that ? -1 : 1);
|
|
735
735
|
|
|
736
|
-
// node_modules/.pnpm
|
|
736
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Option.js
|
|
737
737
|
var none2 = () => none;
|
|
738
738
|
var some2 = some;
|
|
739
739
|
var isNone2 = isNone;
|
|
@@ -741,7 +741,7 @@ var isSome2 = isSome;
|
|
|
741
741
|
var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
|
|
742
742
|
var fromNullable = (nullableValue) => nullableValue == null ? none2() : some2(nullableValue);
|
|
743
743
|
|
|
744
|
-
// node_modules/.pnpm
|
|
744
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Record.js
|
|
745
745
|
var map2 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
746
746
|
const out = {
|
|
747
747
|
...self
|
|
@@ -753,7 +753,7 @@ var map2 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
|
753
753
|
});
|
|
754
754
|
var keys = (self) => Object.keys(self);
|
|
755
755
|
|
|
756
|
-
// node_modules/.pnpm
|
|
756
|
+
// node_modules/.pnpm/@pkg.pr.new+Effect-TS+effect@97ff1dc_6ntygjheib5kdugabxjhox4fte/node_modules/effect/dist/esm/Array.js
|
|
757
757
|
var fromIterable = (collection) => Array.isArray(collection) ? collection : Array.from(collection);
|
|
758
758
|
var append = /* @__PURE__ */ dual(2, (self, last) => [...self, last]);
|
|
759
759
|
var appendAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable(self).concat(fromIterable(that)));
|
|
@@ -1205,7 +1205,7 @@ function parseKeyPatterns(patterns) {
|
|
|
1205
1205
|
if (!isObject(entry)) continue;
|
|
1206
1206
|
result.push({
|
|
1207
1207
|
target: hasProperty(entry, "target") && isString(entry.target) && ["service", "error", "custom"].includes(entry.target.toLowerCase()) ? entry.target.toLowerCase() : "service",
|
|
1208
|
-
pattern: hasProperty(entry, "pattern") && isString(entry.pattern) && ["package-identifier", "default"].includes(entry.pattern.toLowerCase()) ? entry.pattern.toLowerCase() : "default",
|
|
1208
|
+
pattern: hasProperty(entry, "pattern") && isString(entry.pattern) && ["package-identifier", "default", "default-hashed"].includes(entry.pattern.toLowerCase()) ? entry.pattern.toLowerCase() : "default",
|
|
1209
1209
|
skipLeadingPath: hasProperty(entry, "skipLeadingPath") && isArray(entry.skipLeadingPath) && entry.skipLeadingPath.every(isString) ? entry.skipLeadingPath : ["src/"]
|
|
1210
1210
|
});
|
|
1211
1211
|
}
|
|
@@ -2361,17 +2361,21 @@ function makeTypeCheckerUtils(ts, typeChecker, tsUtils) {
|
|
|
2361
2361
|
return result;
|
|
2362
2362
|
};
|
|
2363
2363
|
function typeToSimplifiedTypeNode(type, enclosingNode, flags) {
|
|
2364
|
+
return typeToSimplifiedTypeNodeWorker(type, enclosingNode, flags, 0);
|
|
2365
|
+
}
|
|
2366
|
+
function typeToSimplifiedTypeNodeWorker(type, enclosingNode, flags, depth) {
|
|
2364
2367
|
const fallbackStandard = () => {
|
|
2365
2368
|
const typeNode = typeChecker.typeToTypeNode(type, enclosingNode, flags);
|
|
2366
2369
|
if (!typeNode) return void 0;
|
|
2367
2370
|
return tsUtils.simplifyTypeNode(typeNode);
|
|
2368
2371
|
};
|
|
2372
|
+
if (depth > 20) return fallbackStandard();
|
|
2369
2373
|
const members = unrollUnionMembers(type);
|
|
2370
|
-
if (members.length > 1) {
|
|
2374
|
+
if (members.length > 1 && !(type.flags & ts.TypeFlags.Boolean)) {
|
|
2371
2375
|
const typeNodes = [];
|
|
2372
2376
|
members.sort(deterministicTypeOrder);
|
|
2373
2377
|
for (const member of members) {
|
|
2374
|
-
const memberNode =
|
|
2378
|
+
const memberNode = typeToSimplifiedTypeNodeWorker(member, enclosingNode, flags, depth + 1);
|
|
2375
2379
|
if (!memberNode) return fallbackStandard();
|
|
2376
2380
|
typeNodes.push(memberNode);
|
|
2377
2381
|
}
|
|
@@ -2381,7 +2385,7 @@ function makeTypeCheckerUtils(ts, typeChecker, tsUtils) {
|
|
|
2381
2385
|
const intersectionType = type;
|
|
2382
2386
|
const typeNodes = [];
|
|
2383
2387
|
for (const member of intersectionType.types) {
|
|
2384
|
-
const memberNode =
|
|
2388
|
+
const memberNode = typeToSimplifiedTypeNodeWorker(member, enclosingNode, flags, depth + 1);
|
|
2385
2389
|
if (!memberNode) return fallbackStandard();
|
|
2386
2390
|
typeNodes.push(memberNode);
|
|
2387
2391
|
}
|
|
@@ -2417,7 +2421,7 @@ function makeTypeCheckerUtils(ts, typeChecker, tsUtils) {
|
|
|
2417
2421
|
if (signatures.length !== 1) return standard2;
|
|
2418
2422
|
const returnType = typeChecker.getReturnTypeOfSignature(signatures[0]);
|
|
2419
2423
|
if (!returnType) return standard2;
|
|
2420
|
-
const returnTypeNode =
|
|
2424
|
+
const returnTypeNode = typeToSimplifiedTypeNodeWorker(returnType, enclosingNode, flags, depth + 1);
|
|
2421
2425
|
if (!returnTypeNode) return standard2;
|
|
2422
2426
|
return tsUtils.simplifyTypeNode(ts.factory.updateFunctionTypeNode(
|
|
2423
2427
|
standard2,
|
|
@@ -3616,7 +3620,8 @@ var makeKeyBuilder = fn("KeyBuilder")(
|
|
|
3616
3620
|
parts = parts.map((part) => part.startsWith("/") ? part.slice(1) : part).map(
|
|
3617
3621
|
(part) => part.endsWith("/") ? part.slice(0, -1) : part
|
|
3618
3622
|
);
|
|
3619
|
-
|
|
3623
|
+
const fullKey = parts.filter((_) => String(_).trim().length > 0).join("/");
|
|
3624
|
+
return keyPattern.pattern === "default-hashed" ? cyrb53(fullKey) : fullKey;
|
|
3620
3625
|
}
|
|
3621
3626
|
}
|
|
3622
3627
|
return {
|
|
@@ -5562,7 +5567,7 @@ var tryCatchInEffectGen = createDiagnostic({
|
|
|
5562
5567
|
while (nodeToVisit.length > 0) {
|
|
5563
5568
|
const node = nodeToVisit.shift();
|
|
5564
5569
|
ts.forEachChild(node, appendNodeToVisit);
|
|
5565
|
-
if (ts.isTryStatement(node)) {
|
|
5570
|
+
if (ts.isTryStatement(node) && node.catchClause) {
|
|
5566
5571
|
const generatorOrRegularFunction = ts.findAncestor(
|
|
5567
5572
|
node,
|
|
5568
5573
|
(_) => ts.isFunctionExpression(_) || ts.isFunctionDeclaration(_) || ts.isMethodDeclaration(_) || ts.isArrowFunction(_) || ts.isGetAccessor(_) || ts.isFunctionLike(_)
|