@effect/language-service 0.14.0 → 0.15.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/language-service",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "A Language-Service Plugin to Refactor and Diagnostic effect-ts projects",
5
5
  "main": "index.cjs",
6
6
  "repository": {
package/transform.js CHANGED
@@ -775,23 +775,27 @@ var contextGet = (context, tag) => {
775
775
  }
776
776
  return none2();
777
777
  };
778
- var Nano = class {
779
- constructor(run2) {
780
- this.run = run2;
781
- }
778
+ var Proto = {
779
+ run: () => {
780
+ },
782
781
  [Symbol.iterator]() {
783
782
  return new SingleShotGen(new YieldWrap(this));
784
783
  }
785
784
  };
785
+ function make2(run2) {
786
+ const result = Object.create(Proto);
787
+ result.run = run2;
788
+ return result;
789
+ }
786
790
  var unsafeRun = (fa) => {
787
791
  const result = fa.run(contextEmpty);
788
792
  switch (result._tag) {
789
793
  case "Left":
790
- return left2(result.left);
794
+ return left2(result.value);
791
795
  case "Defect":
792
- return left2(new NanoDefectException(result.defect));
796
+ return left2(new NanoDefectException(result.value));
793
797
  case "Right":
794
- return right2(result.right);
798
+ return right2(result.value);
795
799
  }
796
800
  };
797
801
  var run = (fa) => {
@@ -801,34 +805,34 @@ var run = (fa) => {
801
805
  return left2(new NanoDefectException(e));
802
806
  }
803
807
  };
804
- var succeed = (value) => new Nano(() => ({ _tag: "Right", right: value }));
805
- var fail = (value) => new Nano(() => ({ _tag: "Left", left: value }));
806
- var sync = (value) => new Nano(() => ({ _tag: "Right", right: value() }));
807
- var flatMap2 = dual(2, (fa, f) => new Nano((ctx) => {
808
+ var succeed = (value) => make2(() => ({ _tag: "Right", value }));
809
+ var fail = (value) => make2(() => ({ _tag: "Left", value }));
810
+ var sync = (value) => make2(() => ({ _tag: "Right", value: value() }));
811
+ var flatMap2 = dual(2, (fa, f) => make2((ctx) => {
808
812
  const result = fa.run(ctx);
809
813
  if (result._tag !== "Right") return result;
810
- return f(result.right).run(ctx);
814
+ return f(result.value).run(ctx);
811
815
  }));
812
- var map3 = dual(2, (fa, f) => new Nano((ctx) => {
816
+ var map3 = dual(2, (fa, f) => make2((ctx) => {
813
817
  const result = fa.run(ctx);
814
818
  if (result._tag !== "Right") return result;
815
- return { _tag: "Right", right: f(result.right) };
819
+ return { _tag: "Right", value: f(result.value) };
816
820
  }));
817
- var orElse = (f) => (fa) => new Nano((ctx) => {
821
+ var orElse = (f) => (fa) => make2((ctx) => {
818
822
  const result = fa.run(ctx);
819
- if (result._tag === "Left") return f().run(ctx);
823
+ if (result._tag === "Left") return f(result.value).run(ctx);
820
824
  return result;
821
825
  });
822
- var service = (tag) => new Nano(
826
+ var service = (tag) => make2(
823
827
  (ctx) => contextGet(ctx, tag).pipe(match({
824
- onNone: () => ({ _tag: "Defect", defect: `Cannot find service ${tag.key}` }),
825
- onSome: (value) => ({ _tag: "Right", right: value })
828
+ onNone: () => ({ _tag: "Defect", value: `Cannot find service ${tag.key}` }),
829
+ onSome: (value) => ({ _tag: "Right", value })
826
830
  }))
827
831
  );
828
- var provideService = (tag, value) => (fa) => new Nano((ctx) => {
832
+ var provideService = (tag, value) => (fa) => make2((ctx) => {
829
833
  return fa.run(contextAdd(ctx, tag, value));
830
834
  });
831
- var gen = (...args) => new Nano((ctx) => {
835
+ var gen = (...args) => make2((ctx) => {
832
836
  const iterator = args[0]();
833
837
  let state = iterator.next();
834
838
  while (!state.done) {
@@ -837,11 +841,11 @@ var gen = (...args) => new Nano((ctx) => {
837
841
  if (result._tag !== "Right") {
838
842
  return result;
839
843
  }
840
- state = iterator.next(result.right);
844
+ state = iterator.next(result.value);
841
845
  }
842
- return { _tag: "Right", right: state.value };
846
+ return { _tag: "Right", value: state.value };
843
847
  });
844
- var fn = (_) => (body) => (...args) => new Nano((ctx) => {
848
+ var fn = (_) => (body) => (...args) => make2((ctx) => {
845
849
  const iterator = body(...args);
846
850
  let state = iterator.next();
847
851
  while (!state.done) {
@@ -850,17 +854,17 @@ var fn = (_) => (body) => (...args) => new Nano((ctx) => {
850
854
  if (result._tag !== "Right") {
851
855
  return result;
852
856
  }
853
- state = iterator.next(result.right);
857
+ state = iterator.next(result.value);
854
858
  }
855
- return { _tag: "Right", right: state.value };
859
+ return { _tag: "Right", value: state.value };
856
860
  });
857
- var option = (fa) => new Nano((ctx) => {
861
+ var option = (fa) => make2((ctx) => {
858
862
  const result = fa.run(ctx);
859
863
  switch (result._tag) {
860
864
  case "Right":
861
- return { _tag: "Right", right: some2(result.right) };
865
+ return { _tag: "Right", value: some2(result.value) };
862
866
  case "Left":
863
- return { _tag: "Right", right: none2() };
867
+ return { _tag: "Right", value: none2() };
864
868
  case "Defect":
865
869
  return result;
866
870
  }