@effect/language-service 0.22.0 → 0.22.2
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 +1 -0
- package/index.js +1118 -1075
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +73 -65
- package/transform.js.map +1 -1
package/package.json
CHANGED
package/transform.js
CHANGED
|
@@ -787,29 +787,11 @@ var filter = /* @__PURE__ */ dual(2, (self, predicate) => {
|
|
|
787
787
|
});
|
|
788
788
|
|
|
789
789
|
// src/core/Nano.ts
|
|
790
|
-
var NanoInternalSuccessProto = {
|
|
791
|
-
_tag: "Right"
|
|
792
|
-
};
|
|
793
790
|
function makeInternalSuccess(value) {
|
|
794
|
-
|
|
795
|
-
result.value = value;
|
|
796
|
-
return result;
|
|
791
|
+
return { _tag: "Right", value };
|
|
797
792
|
}
|
|
798
|
-
var NanoInternalFailureProto = {
|
|
799
|
-
_tag: "Left"
|
|
800
|
-
};
|
|
801
|
-
function makeInternalFailure(value) {
|
|
802
|
-
const result = Object.create(NanoInternalFailureProto);
|
|
803
|
-
result.value = value;
|
|
804
|
-
return result;
|
|
805
|
-
}
|
|
806
|
-
var NanoInternalDefectProto = {
|
|
807
|
-
_tag: "Defect"
|
|
808
|
-
};
|
|
809
793
|
function makeInternalDefect(value) {
|
|
810
|
-
|
|
811
|
-
result.value = value;
|
|
812
|
-
return result;
|
|
794
|
+
return { _tag: "Defect", value };
|
|
813
795
|
}
|
|
814
796
|
var NanoDefectException = class {
|
|
815
797
|
constructor(message) {
|
|
@@ -824,17 +806,14 @@ var NanoTag = class {
|
|
|
824
806
|
};
|
|
825
807
|
var Tag = (identifier) => new NanoTag(identifier);
|
|
826
808
|
var contextEmpty = { value: {} };
|
|
827
|
-
var Proto = {
|
|
828
|
-
run: () => {
|
|
829
|
-
},
|
|
830
|
-
[Symbol.iterator]() {
|
|
831
|
-
return new SingleShotGen(new YieldWrap(this));
|
|
832
|
-
}
|
|
833
|
-
};
|
|
834
809
|
function make2(run2) {
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
|
|
810
|
+
const nano = {
|
|
811
|
+
run: run2,
|
|
812
|
+
[Symbol.iterator]() {
|
|
813
|
+
return new SingleShotGen(new YieldWrap(this));
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
return nano;
|
|
838
817
|
}
|
|
839
818
|
var unsafeRun = (fa) => {
|
|
840
819
|
const program = provideService(internalNanoCache, {})(fa);
|
|
@@ -855,9 +834,33 @@ var run = (fa) => {
|
|
|
855
834
|
return left2(new NanoDefectException(e));
|
|
856
835
|
}
|
|
857
836
|
};
|
|
858
|
-
var succeed = (value) =>
|
|
859
|
-
|
|
860
|
-
|
|
837
|
+
var succeed = (value) => {
|
|
838
|
+
const nano = {
|
|
839
|
+
run: () => ({ _tag: "Right", value }),
|
|
840
|
+
[Symbol.iterator]() {
|
|
841
|
+
return new SingleShotGen(new YieldWrap(this));
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
return nano;
|
|
845
|
+
};
|
|
846
|
+
var fail = (value) => {
|
|
847
|
+
const nano = {
|
|
848
|
+
run: () => ({ _tag: "Left", value }),
|
|
849
|
+
[Symbol.iterator]() {
|
|
850
|
+
return new SingleShotGen(new YieldWrap(this));
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
return nano;
|
|
854
|
+
};
|
|
855
|
+
var sync = (value) => {
|
|
856
|
+
const nano = {
|
|
857
|
+
run: () => ({ _tag: "Right", value: value() }),
|
|
858
|
+
[Symbol.iterator]() {
|
|
859
|
+
return new SingleShotGen(new YieldWrap(this));
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
return nano;
|
|
863
|
+
};
|
|
861
864
|
var flatMap = dual(2, (fa, f) => make2((ctx) => {
|
|
862
865
|
const result = fa.run(ctx);
|
|
863
866
|
if (result._tag !== "Right") return result;
|
|
@@ -949,8 +952,9 @@ function cachedBy(fa, key, lookupKey) {
|
|
|
949
952
|
cacheObj[key] = cache;
|
|
950
953
|
}
|
|
951
954
|
const lookup = lookupKey(...args);
|
|
952
|
-
|
|
953
|
-
|
|
955
|
+
const cached2 = cache.get(lookup);
|
|
956
|
+
if (cached2 !== void 0) {
|
|
957
|
+
return cached2;
|
|
954
958
|
}
|
|
955
959
|
const result = fa(...args).run(ctx);
|
|
956
960
|
cache.set(lookup, result);
|
|
@@ -2727,22 +2731,24 @@ var missingEffectContext = createDiagnostic({
|
|
|
2727
2731
|
const sortTypes = sort(typeOrder);
|
|
2728
2732
|
const entries = yield* expectedAndRealType(sourceFile);
|
|
2729
2733
|
for (const [node, expectedType, valueNode, realType] of entries) {
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
expectedType,
|
|
2734
|
-
valueNode,
|
|
2735
|
-
realType
|
|
2736
|
-
),
|
|
2737
|
-
orElse2(() => succeed([]))
|
|
2738
|
-
);
|
|
2739
|
-
if (missingContext.length > 0) {
|
|
2740
|
-
report(
|
|
2741
|
-
{
|
|
2734
|
+
if (expectedType !== realType) {
|
|
2735
|
+
yield* pipe(
|
|
2736
|
+
checkForMissingContextTypes(
|
|
2742
2737
|
node,
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2738
|
+
expectedType,
|
|
2739
|
+
valueNode,
|
|
2740
|
+
realType
|
|
2741
|
+
),
|
|
2742
|
+
map3(
|
|
2743
|
+
(missingTypes) => missingTypes.length > 0 ? report(
|
|
2744
|
+
{
|
|
2745
|
+
node,
|
|
2746
|
+
messageText: `Missing '${sortTypes(missingTypes).map((_) => typeChecker.typeToString(_)).join(" | ")}' in the expected Effect context.`,
|
|
2747
|
+
fixes: []
|
|
2748
|
+
}
|
|
2749
|
+
) : void 0
|
|
2750
|
+
),
|
|
2751
|
+
ignore
|
|
2746
2752
|
);
|
|
2747
2753
|
}
|
|
2748
2754
|
}
|
|
@@ -2773,22 +2779,24 @@ var missingEffectError = createDiagnostic({
|
|
|
2773
2779
|
const sortTypes = sort(typeOrder);
|
|
2774
2780
|
const entries = yield* expectedAndRealType(sourceFile);
|
|
2775
2781
|
for (const [node, expectedType, valueNode, realType] of entries) {
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
expectedType,
|
|
2780
|
-
valueNode,
|
|
2781
|
-
realType
|
|
2782
|
-
),
|
|
2783
|
-
orElse2(() => succeed([]))
|
|
2784
|
-
);
|
|
2785
|
-
if (missingContext.length > 0) {
|
|
2786
|
-
report(
|
|
2787
|
-
{
|
|
2782
|
+
if (expectedType !== realType) {
|
|
2783
|
+
yield* pipe(
|
|
2784
|
+
checkForMissingErrorTypes(
|
|
2788
2785
|
node,
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2786
|
+
expectedType,
|
|
2787
|
+
valueNode,
|
|
2788
|
+
realType
|
|
2789
|
+
),
|
|
2790
|
+
map3(
|
|
2791
|
+
(missingTypes) => missingTypes.length > 0 ? report(
|
|
2792
|
+
{
|
|
2793
|
+
node,
|
|
2794
|
+
messageText: `Missing '${sortTypes(missingTypes).map((_) => typeChecker.typeToString(_)).join(" | ")}' in the expected Effect errors.`,
|
|
2795
|
+
fixes: []
|
|
2796
|
+
}
|
|
2797
|
+
) : void 0
|
|
2798
|
+
),
|
|
2799
|
+
ignore
|
|
2792
2800
|
);
|
|
2793
2801
|
}
|
|
2794
2802
|
}
|