@effect/language-service 0.21.7 → 0.22.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/index.js CHANGED
@@ -1,9 +1,4 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __export = (target, all3) => {
4
- for (var name in all3)
5
- __defProp(target, name, { get: all3[name], enumerable: true });
6
- };
7
2
 
8
3
  // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/Function.js
9
4
  var isFunction = (input) => typeof input === "function";
@@ -70,7 +65,6 @@ var dual = function(arity, body) {
70
65
  };
71
66
  var identity = (a) => a;
72
67
  var constant = (value) => () => value;
73
- var constNull = /* @__PURE__ */ constant(null);
74
68
  var constUndefined = /* @__PURE__ */ constant(void 0);
75
69
  function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
76
70
  switch (arguments.length) {
@@ -102,50 +96,6 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
102
96
  }
103
97
  }
104
98
 
105
- // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/Either.js
106
- var Either_exports = {};
107
- __export(Either_exports, {
108
- Do: () => Do,
109
- TypeId: () => TypeId3,
110
- all: () => all,
111
- andThen: () => andThen,
112
- ap: () => ap,
113
- bind: () => bind2,
114
- bindTo: () => bindTo2,
115
- filterOrLeft: () => filterOrLeft,
116
- flatMap: () => flatMap,
117
- flip: () => flip,
118
- fromNullable: () => fromNullable,
119
- fromOption: () => fromOption2,
120
- gen: () => gen,
121
- getEquivalence: () => getEquivalence,
122
- getLeft: () => getLeft2,
123
- getOrElse: () => getOrElse,
124
- getOrNull: () => getOrNull,
125
- getOrThrow: () => getOrThrow,
126
- getOrThrowWith: () => getOrThrowWith,
127
- getOrUndefined: () => getOrUndefined,
128
- getRight: () => getRight2,
129
- isEither: () => isEither2,
130
- isLeft: () => isLeft2,
131
- isRight: () => isRight2,
132
- left: () => left2,
133
- let: () => let_2,
134
- liftPredicate: () => liftPredicate,
135
- map: () => map,
136
- mapBoth: () => mapBoth,
137
- mapLeft: () => mapLeft,
138
- match: () => match,
139
- merge: () => merge,
140
- orElse: () => orElse,
141
- right: () => right2,
142
- transposeMapOption: () => transposeMapOption,
143
- transposeOption: () => transposeOption,
144
- try: () => try_,
145
- void: () => void_,
146
- zipWith: () => zipWith
147
- });
148
-
149
99
  // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/Equivalence.js
150
100
  var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
151
101
  var array = (item) => make((self, that) => {
@@ -161,17 +111,6 @@ var array = (item) => make((self, that) => {
161
111
  return true;
162
112
  });
163
113
 
164
- // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/internal/doNotation.js
165
- var let_ = (map5) => dual(3, (self, name, f) => map5(self, (a) => Object.assign({}, a, {
166
- [name]: f(a)
167
- })));
168
- var bindTo = (map5) => dual(2, (self, name) => map5(self, (a) => ({
169
- [name]: a
170
- })));
171
- var bind = (map5, flatMap4) => dual(3, (self, name, f) => flatMap4(self, (a) => map5(f(a), (b) => Object.assign({}, a, {
172
- [name]: b
173
- }))));
174
-
175
114
  // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/internal/version.js
176
115
  var moduleVersion = "3.16.5";
177
116
  var getCurrentVersion = () => moduleVersion;
@@ -286,13 +225,6 @@ var SingleShotGen = class _SingleShotGen {
286
225
  return new _SingleShotGen(this.self);
287
226
  }
288
227
  };
289
- var adapter = () => function() {
290
- let x = arguments[0];
291
- for (let i = 1; i < arguments.length; i++) {
292
- x = arguments[i](x);
293
- }
294
- return new GenKindImpl(x);
295
- };
296
228
  var MUL_HI = 1481765933 >>> 0;
297
229
  var MUL_LO = 1284865837 >>> 0;
298
230
  var YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap");
@@ -786,122 +718,14 @@ var right = (right3) => {
786
718
  a.right = right3;
787
719
  return a;
788
720
  };
789
- var getLeft = (self) => isRight(self) ? none : some(self.left);
790
- var getRight = (self) => isLeft(self) ? none : some(self.right);
791
- var fromOption = /* @__PURE__ */ dual(2, (self, onNone) => isNone(self) ? left(onNone()) : right(self.value));
792
721
 
793
722
  // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/Either.js
794
- var TypeId3 = TypeId2;
795
723
  var right2 = right;
796
- var void_ = /* @__PURE__ */ right2(void 0);
797
724
  var left2 = left;
798
- var fromNullable = /* @__PURE__ */ dual(2, (self, onNullable) => self == null ? left2(onNullable(self)) : right2(self));
799
- var fromOption2 = fromOption;
800
- var try_ = (evaluate) => {
801
- if (isFunction2(evaluate)) {
802
- try {
803
- return right2(evaluate());
804
- } catch (e) {
805
- return left2(e);
806
- }
807
- } else {
808
- try {
809
- return right2(evaluate.try());
810
- } catch (e) {
811
- return left2(evaluate.catch(e));
812
- }
813
- }
814
- };
815
- var isEither2 = isEither;
816
725
  var isLeft2 = isLeft;
817
726
  var isRight2 = isRight;
818
- var getRight2 = getRight;
819
- var getLeft2 = getLeft;
820
- var getEquivalence = ({
821
- left: left3,
822
- right: right3
823
- }) => make((x, y) => isLeft2(x) ? isLeft2(y) && left3(x.left, y.left) : isRight2(y) && right3(x.right, y.right));
824
- var mapBoth = /* @__PURE__ */ dual(2, (self, {
825
- onLeft,
826
- onRight
827
- }) => isLeft2(self) ? left2(onLeft(self.left)) : right2(onRight(self.right)));
828
- var mapLeft = /* @__PURE__ */ dual(2, (self, f) => isLeft2(self) ? left2(f(self.left)) : right2(self.right));
829
727
  var map = /* @__PURE__ */ dual(2, (self, f) => isRight2(self) ? right2(f(self.right)) : left2(self.left));
830
- var match = /* @__PURE__ */ dual(2, (self, {
831
- onLeft,
832
- onRight
833
- }) => isLeft2(self) ? onLeft(self.left) : onRight(self.right));
834
- var liftPredicate = /* @__PURE__ */ dual(3, (a, predicate, orLeftWith) => predicate(a) ? right2(a) : left2(orLeftWith(a)));
835
- var filterOrLeft = /* @__PURE__ */ dual(3, (self, predicate, orLeftWith) => flatMap(self, (r) => predicate(r) ? right2(r) : left2(orLeftWith(r))));
836
- var merge = /* @__PURE__ */ match({
837
- onLeft: identity,
838
- onRight: identity
839
- });
840
728
  var getOrElse = /* @__PURE__ */ dual(2, (self, onLeft) => isLeft2(self) ? onLeft(self.left) : self.right);
841
- var getOrNull = /* @__PURE__ */ getOrElse(constNull);
842
- var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
843
- var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onLeft) => {
844
- if (isRight2(self)) {
845
- return self.right;
846
- }
847
- throw onLeft(self.left);
848
- });
849
- var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a Left"));
850
- var orElse = /* @__PURE__ */ dual(2, (self, that) => isLeft2(self) ? that(self.left) : right2(self.right));
851
- var flatMap = /* @__PURE__ */ dual(2, (self, f) => isLeft2(self) ? left2(self.left) : f(self.right));
852
- var andThen = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => {
853
- const b = isFunction2(f) ? f(a) : f;
854
- return isEither2(b) ? b : right2(b);
855
- }));
856
- var zipWith = /* @__PURE__ */ dual(3, (self, that, f) => flatMap(self, (r) => map(that, (r2) => f(r, r2))));
857
- var ap = /* @__PURE__ */ dual(2, (self, that) => zipWith(self, that, (f, a) => f(a)));
858
- var all = (input) => {
859
- if (Symbol.iterator in input) {
860
- const out2 = [];
861
- for (const e of input) {
862
- if (isLeft2(e)) {
863
- return e;
864
- }
865
- out2.push(e.right);
866
- }
867
- return right2(out2);
868
- }
869
- const out = {};
870
- for (const key of Object.keys(input)) {
871
- const e = input[key];
872
- if (isLeft2(e)) {
873
- return e;
874
- }
875
- out[key] = e.right;
876
- }
877
- return right2(out);
878
- };
879
- var flip = (self) => isLeft2(self) ? right2(self.left) : left2(self.right);
880
- var adapter2 = /* @__PURE__ */ adapter();
881
- var gen = (...args) => {
882
- const f = args.length === 1 ? args[0] : args[1].bind(args[0]);
883
- const iterator = f(adapter2);
884
- let state = iterator.next();
885
- while (!state.done) {
886
- const current = isGenKind(state.value) ? state.value.value : yieldWrapGet(state.value);
887
- if (isLeft2(current)) {
888
- return current;
889
- }
890
- state = iterator.next(current.right);
891
- }
892
- return right2(state.value);
893
- };
894
- var Do = /* @__PURE__ */ right2({});
895
- var bind2 = /* @__PURE__ */ bind(map, flatMap);
896
- var bindTo2 = /* @__PURE__ */ bindTo(map);
897
- var let_2 = /* @__PURE__ */ let_(map);
898
- var transposeOption = (self) => {
899
- return isNone(self) ? right2(none) : map(self.value, some);
900
- };
901
- var transposeMapOption = /* @__PURE__ */ dual(2, (self, f) => isNone(self) ? right2(none) : map(f(self.value), some));
902
-
903
- // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/internal/array.js
904
- var isNonEmptyArray = (self) => self.length > 0;
905
729
 
906
730
  // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/Order.js
907
731
  var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
@@ -911,16 +735,19 @@ var none2 = () => none;
911
735
  var some2 = some;
912
736
  var isNone2 = isNone;
913
737
  var isSome2 = isSome;
914
- var match2 = /* @__PURE__ */ dual(2, (self, {
738
+ var match = /* @__PURE__ */ dual(2, (self, {
915
739
  onNone,
916
740
  onSome
917
741
  }) => isNone2(self) ? onNone() : onSome(self.value));
918
742
  var getOrElse2 = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
919
- var orElse2 = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
920
- var fromNullable2 = (nullableValue) => nullableValue == null ? none2() : some2(nullableValue);
921
- var getOrUndefined2 = /* @__PURE__ */ getOrElse2(constUndefined);
743
+ var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
744
+ var fromNullable = (nullableValue) => nullableValue == null ? none2() : some2(nullableValue);
745
+ var getOrUndefined = /* @__PURE__ */ getOrElse2(constUndefined);
922
746
  var map2 = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : some2(f(self.value)));
923
747
 
748
+ // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/internal/array.js
749
+ var isNonEmptyArray = (self) => self.length > 0;
750
+
924
751
  // node_modules/.pnpm/effect@3.16.5/node_modules/effect/dist/esm/Array.js
925
752
  var fromIterable = (collection) => Array.isArray(collection) ? collection : Array.from(collection);
926
753
  var append = /* @__PURE__ */ dual(2, (self, last) => [...self, last]);
@@ -965,7 +792,7 @@ var intersectionWith = (isEquivalent) => {
965
792
  var intersection = /* @__PURE__ */ intersectionWith(_equivalence);
966
793
  var empty = () => [];
967
794
  var map3 = /* @__PURE__ */ dual(2, (self, f) => self.map(f));
968
- var flatMap2 = /* @__PURE__ */ dual(2, (self, f) => {
795
+ var flatMap = /* @__PURE__ */ dual(2, (self, f) => {
969
796
  if (isEmptyReadonlyArray(self)) {
970
797
  return [];
971
798
  }
@@ -978,7 +805,7 @@ var flatMap2 = /* @__PURE__ */ dual(2, (self, f) => {
978
805
  }
979
806
  return out;
980
807
  });
981
- var flatten = /* @__PURE__ */ flatMap2(identity);
808
+ var flatten = /* @__PURE__ */ flatMap(identity);
982
809
  var filter = /* @__PURE__ */ dual(2, (self, predicate) => {
983
810
  const as = fromIterable(self);
984
811
  const out = [];
@@ -1076,7 +903,7 @@ var run = (fa) => {
1076
903
  var succeed = (value) => make3(() => makeInternalSuccess(value));
1077
904
  var fail = (value) => make3(() => makeInternalFailure(value));
1078
905
  var sync = (value) => make3(() => makeInternalSuccess(value()));
1079
- var flatMap3 = dual(2, (fa, f) => make3((ctx) => {
906
+ var flatMap2 = dual(2, (fa, f) => make3((ctx) => {
1080
907
  const result = fa.run(ctx);
1081
908
  if (result._tag !== "Right") return result;
1082
909
  return f(result.value).run(ctx);
@@ -1086,12 +913,12 @@ var map4 = dual(2, (fa, f) => make3((ctx) => {
1086
913
  if (result._tag !== "Right") return result;
1087
914
  return makeInternalSuccess(f(result.value));
1088
915
  }));
1089
- var orElse3 = (f) => (fa) => make3((ctx) => {
916
+ var orElse2 = (f) => (fa) => make3((ctx) => {
1090
917
  const result = fa.run(ctx);
1091
918
  if (result._tag === "Left") return f(result.value).run(ctx);
1092
919
  return result;
1093
920
  });
1094
- var firstSuccessOf = (arr) => arr.slice(1).reduce((arr2, fa) => orElse3(() => fa)(arr2), arr[0]);
921
+ var firstSuccessOf = (arr) => arr.slice(1).reduce((arr2, fa) => orElse2(() => fa)(arr2), arr[0]);
1095
922
  var service = (tag) => make3(
1096
923
  (ctx) => tag.key in ctx.value ? ctx.value[tag.key] : makeInternalDefect(`Cannot find service ${tag.key}`)
1097
924
  );
@@ -1104,7 +931,7 @@ var provideService = (tag, value) => (fa) => make3((ctx) => {
1104
931
  }
1105
932
  });
1106
933
  });
1107
- var gen2 = (...args) => make3((ctx) => {
934
+ var gen = (...args) => make3((ctx) => {
1108
935
  const iterator = args[0]();
1109
936
  let state = iterator.next();
1110
937
  while (!state.done) {
@@ -1142,12 +969,12 @@ var option = (fa) => make3((ctx) => {
1142
969
  }
1143
970
  });
1144
971
  var successUndefined = makeInternalSuccess(void 0);
1145
- var void_2 = make3(() => successUndefined);
972
+ var void_ = make3(() => successUndefined);
1146
973
  var ignore = (fa) => make3((ctx) => {
1147
974
  fa.run(ctx);
1148
975
  return successUndefined;
1149
976
  });
1150
- var all2 = (...args) => make3((ctx) => {
977
+ var all = (...args) => make3((ctx) => {
1151
978
  const results = [];
1152
979
  for (const arg of args) {
1153
980
  const result = arg.run(ctx);
@@ -1205,6 +1032,20 @@ function parsePackageContentNameAndVersionFromScope(v) {
1205
1032
  packageDirectory: packageJsonScope.packageDirectory
1206
1033
  };
1207
1034
  }
1035
+ function makeGetModuleSpecifier(ts) {
1036
+ if (!(hasProperty(ts, "moduleSpecifiers") && hasProperty(ts.moduleSpecifiers, "getModuleSpecifier") && isFunction2(ts.moduleSpecifiers.getModuleSpecifier))) return;
1037
+ const _internal = ts.moduleSpecifiers.getModuleSpecifier;
1038
+ return (compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, options) => {
1039
+ return _internal(
1040
+ compilerOptions,
1041
+ importingSourceFile,
1042
+ importingSourceFileName,
1043
+ toFileName,
1044
+ host,
1045
+ options
1046
+ );
1047
+ };
1048
+ }
1208
1049
 
1209
1050
  // src/core/AST.ts
1210
1051
  function collectSelfAndAncestorNodesInRange(node, textRange) {
@@ -1364,8 +1205,8 @@ var findImportedModuleIdentifier = fn("AST.findImportedModuleIdentifier")(
1364
1205
  }
1365
1206
  } else if (ts.isNamedImports(namedBindings)) {
1366
1207
  for (const importSpecifier of namedBindings.elements) {
1367
- const importProperty = fromNullable2(importSpecifier.propertyName).pipe(
1368
- orElse2(() => some2(importSpecifier.name))
1208
+ const importProperty = fromNullable(importSpecifier.propertyName).pipe(
1209
+ orElse(() => some2(importSpecifier.name))
1369
1210
  );
1370
1211
  if (yield* test(importSpecifier.name, statement.moduleSpecifier, importProperty)) {
1371
1212
  return importSpecifier.name;
@@ -1576,7 +1417,8 @@ function parse(config) {
1576
1417
  quickinfo: isObject(config) && hasProperty(config, "quickinfo") && isBoolean(config.quickinfo) ? config.quickinfo : true,
1577
1418
  completions: isObject(config) && hasProperty(config, "completions") && isBoolean(config.completions) ? config.completions : true,
1578
1419
  goto: isObject(config) && hasProperty(config, "goto") && isBoolean(config.goto) ? config.goto : true,
1579
- allowedDuplicatedPackages: isObject(config) && hasProperty(config, "allowedDuplicatedPackages") && isArray(config.allowedDuplicatedPackages) && config.allowedDuplicatedPackages.every(isString) ? config.allowedDuplicatedPackages.map((_) => _.toLowerCase()) : []
1420
+ allowedDuplicatedPackages: isObject(config) && hasProperty(config, "allowedDuplicatedPackages") && isArray(config.allowedDuplicatedPackages) && config.allowedDuplicatedPackages.every(isString) ? config.allowedDuplicatedPackages.map((_) => _.toLowerCase()) : [],
1421
+ namespaceImportPackages: isObject(config) && hasProperty(config, "namespaceImportPackages") && isArray(config.namespaceImportPackages) && config.namespaceImportPackages.every(isString) ? config.namespaceImportPackages.map((_) => _.toLowerCase()) : []
1580
1422
  };
1581
1423
  }
1582
1424
 
@@ -1600,40 +1442,9 @@ var getSemanticDiagnosticsWithCodeFixes = fn(
1600
1442
  let effectCodeFixes = [];
1601
1443
  const executor = yield* createDiagnosticExecutor(sourceFile);
1602
1444
  for (const rule of rules) {
1603
- const result = yield* option(executor.execute(rule));
1604
- if (isSome2(result)) {
1605
- effectDiagnostics = effectDiagnostics.concat(
1606
- pipe(
1607
- result.value,
1608
- map3((_) => ({
1609
- file: sourceFile,
1610
- start: _.node.getStart(sourceFile),
1611
- length: _.node.getEnd() - _.node.getStart(sourceFile),
1612
- messageText: _.messageText,
1613
- category: _.category,
1614
- code: rule.code,
1615
- source: "effect"
1616
- }))
1617
- )
1618
- );
1619
- effectCodeFixes = effectCodeFixes.concat(
1620
- pipe(
1621
- result.value,
1622
- map3(
1623
- (_) => map3(
1624
- _.fixes,
1625
- (fix) => ({
1626
- ...fix,
1627
- code: rule.code,
1628
- start: _.node.getStart(sourceFile),
1629
- end: _.node.getEnd()
1630
- })
1631
- )
1632
- ),
1633
- flatten
1634
- )
1635
- );
1636
- }
1445
+ const { codeFixes, diagnostics: diagnostics2 } = yield* executor.execute(rule);
1446
+ effectDiagnostics = effectDiagnostics.concat(diagnostics2);
1447
+ effectCodeFixes = effectCodeFixes.concat(codeFixes);
1637
1448
  }
1638
1449
  return {
1639
1450
  diagnostics: effectDiagnostics,
@@ -1721,10 +1532,10 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
1721
1532
  const sectionOverrides = {};
1722
1533
  const skippedRules = [];
1723
1534
  const regex = /@effect-diagnostics(-next-line)?((?:\s[a-zA-Z0-9/]+:(?:off|warning|error|message|suggestion|skip-file))+)?/gm;
1724
- let match3;
1725
- while ((match3 = regex.exec(sourceFile.text)) !== null) {
1726
- const nextLineCaptureGroup = match3[1];
1727
- const rulesCaptureGroup = match3[2];
1535
+ let match2;
1536
+ while ((match2 = regex.exec(sourceFile.text)) !== null) {
1537
+ const nextLineCaptureGroup = match2[1];
1538
+ const rulesCaptureGroup = match2[2];
1728
1539
  if (rulesCaptureGroup) {
1729
1540
  const trimmedRuleString = rulesCaptureGroup.trim();
1730
1541
  if (trimmedRuleString) {
@@ -1736,7 +1547,7 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
1736
1547
  if (ruleLevel === "skip-file") skippedRules.push(ruleName);
1737
1548
  const isOverrideNextLine = nextLineCaptureGroup && nextLineCaptureGroup.trim().toLowerCase() === "-next-line";
1738
1549
  if (isOverrideNextLine) {
1739
- const node = findNodeWithLeadingCommentAtPosition(match3.index);
1550
+ const node = findNodeWithLeadingCommentAtPosition(match2.index);
1740
1551
  if (node) {
1741
1552
  lineOverrides[ruleName] = lineOverrides[ruleName] || [];
1742
1553
  lineOverrides[ruleName].unshift({
@@ -1748,7 +1559,7 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
1748
1559
  } else {
1749
1560
  sectionOverrides[ruleName] = sectionOverrides[ruleName] || [];
1750
1561
  sectionOverrides[ruleName].unshift({
1751
- pos: match3.index,
1562
+ pos: match2.index,
1752
1563
  level: ruleLevel
1753
1564
  });
1754
1565
  }
@@ -1764,12 +1575,14 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
1764
1575
  suggestion: ts.DiagnosticCategory.Suggestion
1765
1576
  };
1766
1577
  const execute = fn("LSP.ruleExecutor")(function* (rule) {
1578
+ const diagnostics2 = [];
1579
+ const codeFixes = [];
1767
1580
  const ruleNameLowered = rule.name.toLowerCase();
1768
- if (skippedRules.indexOf(ruleNameLowered) > -1) return [];
1581
+ if (skippedRules.indexOf(ruleNameLowered) > -1) return { diagnostics: diagnostics2, codeFixes };
1769
1582
  const fixByDisableNextLine = (_) => ({
1770
1583
  fixName: rule.name + "_skipNextLine",
1771
1584
  description: "Disable " + rule.name + " for this line",
1772
- apply: flatMap3(
1585
+ apply: flatMap2(
1773
1586
  service(ChangeTracker),
1774
1587
  (changeTracker) => sync(() => {
1775
1588
  const disableAtNode = findParentStatementForDisableNextLine(_.node);
@@ -1786,7 +1599,7 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
1786
1599
  const fixByDisableEntireFile = {
1787
1600
  fixName: rule.name + "_skipFile",
1788
1601
  description: "Disable " + rule.name + " for this entire file",
1789
- apply: flatMap3(
1602
+ apply: flatMap2(
1790
1603
  service(ChangeTracker),
1791
1604
  (changeTracker) => sync(
1792
1605
  () => changeTracker.insertText(
@@ -1798,16 +1611,15 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
1798
1611
  )
1799
1612
  )
1800
1613
  };
1801
- let modifiedDiagnostics = [];
1614
+ const applicableDiagnostics = [];
1802
1615
  yield* rule.apply(sourceFile, (entry) => {
1803
- modifiedDiagnostics.push({
1616
+ applicableDiagnostics.push({
1804
1617
  ...entry,
1805
1618
  fixes: entry.fixes.concat([fixByDisableNextLine(entry), fixByDisableEntireFile])
1806
1619
  });
1807
1620
  });
1808
- if (!(ruleNameLowered in pluginOptions.diagnosticSeverity || ruleNameLowered in sectionOverrides || ruleNameLowered in lineOverrides)) return modifiedDiagnostics;
1809
- for (const emitted of modifiedDiagnostics.slice(0)) {
1810
- let newLevel = pluginOptions.diagnosticSeverity[ruleNameLowered];
1621
+ for (const emitted of applicableDiagnostics.slice(0)) {
1622
+ let newLevel = pluginOptions.diagnosticSeverity[ruleNameLowered] || rule.severity;
1811
1623
  const lineOverride = (lineOverrides[ruleNameLowered] || []).find(
1812
1624
  (_) => _.pos < emitted.node.getStart(sourceFile) && _.end >= emitted.node.getEnd()
1813
1625
  );
@@ -1819,13 +1631,26 @@ var createDiagnosticExecutor = fn("LSP.createCommentDirectivesProcessor")(
1819
1631
  );
1820
1632
  if (sectionOverride) newLevel = sectionOverride.level;
1821
1633
  }
1822
- if (newLevel === "off") {
1823
- modifiedDiagnostics = modifiedDiagnostics.filter((_) => _ !== emitted);
1824
- } else {
1825
- emitted.category = newLevel && newLevel in levelToDiagnosticCategory ? levelToDiagnosticCategory[newLevel] : emitted.category;
1634
+ if (!(newLevel in levelToDiagnosticCategory)) continue;
1635
+ diagnostics2.push({
1636
+ file: sourceFile,
1637
+ start: emitted.node.getStart(sourceFile),
1638
+ length: emitted.node.getEnd() - emitted.node.getStart(sourceFile),
1639
+ messageText: emitted.messageText,
1640
+ category: levelToDiagnosticCategory[newLevel],
1641
+ code: rule.code,
1642
+ source: "effect"
1643
+ });
1644
+ for (const fix of emitted.fixes) {
1645
+ codeFixes.push({
1646
+ ...fix,
1647
+ code: rule.code,
1648
+ start: emitted.node.getStart(sourceFile),
1649
+ end: emitted.node.getEnd()
1650
+ });
1826
1651
  }
1827
1652
  }
1828
- return modifiedDiagnostics;
1653
+ return { diagnostics: diagnostics2, codeFixes };
1829
1654
  });
1830
1655
  return { execute };
1831
1656
  }
@@ -1848,7 +1673,7 @@ var contextSelfInClasses = createCompletion({
1848
1673
  "Context"
1849
1674
  )
1850
1675
  );
1851
- const contextIdentifier = match2(contextName, {
1676
+ const contextIdentifier = match(contextName, {
1852
1677
  onNone: () => "Context",
1853
1678
  onSome: (_) => _.text
1854
1679
  });
@@ -1881,7 +1706,7 @@ var effectDataClasses = createCompletion({
1881
1706
  "Data"
1882
1707
  )
1883
1708
  );
1884
- const effectDataIdentifier = match2(dataName, {
1709
+ const effectDataIdentifier = match(dataName, {
1885
1710
  onNone: () => "Data",
1886
1711
  onSome: (_) => _.text
1887
1712
  });
@@ -1920,7 +1745,7 @@ var effectSchemaSelfInClasses = createCompletion({
1920
1745
  "Schema"
1921
1746
  )
1922
1747
  );
1923
- const schemaIdentifier = match2(effectSchemaName, {
1748
+ const schemaIdentifier = match(effectSchemaName, {
1924
1749
  onNone: () => "Schema",
1925
1750
  onSome: (_) => _.text
1926
1751
  });
@@ -1971,7 +1796,7 @@ var effectSelfInClasses = createCompletion({
1971
1796
  "Effect"
1972
1797
  )
1973
1798
  );
1974
- const effectIdentifier = match2(effectName, {
1799
+ const effectIdentifier = match(effectName, {
1975
1800
  onNone: () => "Effect",
1976
1801
  onSome: (_) => _.text
1977
1802
  });
@@ -2059,7 +1884,7 @@ function make4(ts, typeChecker) {
2059
1884
  return invariantTypeArgument(propertyType);
2060
1885
  };
2061
1886
  const effectVarianceStruct = (type, atLocation) => map4(
2062
- all2(
1887
+ all(
2063
1888
  varianceStructCovariantType(type, atLocation, "_A"),
2064
1889
  varianceStructCovariantType(type, atLocation, "_E"),
2065
1890
  varianceStructCovariantType(type, atLocation, "_R")
@@ -2067,7 +1892,7 @@ function make4(ts, typeChecker) {
2067
1892
  ([A, E, R]) => ({ A, E, R })
2068
1893
  );
2069
1894
  const layerVarianceStruct = (type, atLocation) => map4(
2070
- all2(
1895
+ all(
2071
1896
  varianceStructContravariantType(type, atLocation, "_ROut"),
2072
1897
  varianceStructCovariantType(type, atLocation, "_E"),
2073
1898
  varianceStructCovariantType(type, atLocation, "_RIn")
@@ -2343,12 +2168,12 @@ function make4(ts, typeChecker) {
2343
2168
  let replacementNode = succeed(yieldedExpression);
2344
2169
  if (!explicitReturn && !(successType.flags & ts.TypeFlags.VoidLike)) {
2345
2170
  replacementNode = pipe(
2346
- gen2(function* () {
2171
+ gen(function* () {
2347
2172
  const effectIdentifier = pipe(
2348
2173
  yield* option(
2349
2174
  findImportedModuleIdentifierByPackageAndNameOrBarrel(node.getSourceFile(), "effect", "Effect")
2350
2175
  ),
2351
- match2({
2176
+ match({
2352
2177
  onNone: () => "Effect",
2353
2178
  onSome: (_) => _.text
2354
2179
  })
@@ -2381,7 +2206,7 @@ function make4(ts, typeChecker) {
2381
2206
  (node) => node
2382
2207
  );
2383
2208
  const effectSchemaVarianceStruct = (type, atLocation) => map4(
2384
- all2(
2209
+ all(
2385
2210
  varianceStructInvariantType(type, atLocation, "_A"),
2386
2211
  varianceStructInvariantType(type, atLocation, "_I"),
2387
2212
  varianceStructCovariantType(type, atLocation, "_R")
@@ -2413,7 +2238,7 @@ function make4(ts, typeChecker) {
2413
2238
  (type) => type
2414
2239
  );
2415
2240
  const contextTagVarianceStruct = (type, atLocation) => map4(
2416
- all2(
2241
+ all(
2417
2242
  varianceStructInvariantType(type, atLocation, "_Identifier"),
2418
2243
  varianceStructInvariantType(type, atLocation, "_Service")
2419
2244
  ),
@@ -2530,7 +2355,7 @@ function makeTypeCheckerApiCache() {
2530
2355
  expectedAndRealType: /* @__PURE__ */ new WeakMap()
2531
2356
  };
2532
2357
  }
2533
- var deterministicTypeOrder = gen2(function* () {
2358
+ var deterministicTypeOrder = gen(function* () {
2534
2359
  const typeChecker = yield* service(TypeCheckerApi);
2535
2360
  return make2((a, b) => {
2536
2361
  const aName = typeChecker.typeToString(a);
@@ -2773,6 +2598,15 @@ var appendToUniqueTypesMap = fn(
2773
2598
  };
2774
2599
  }
2775
2600
  );
2601
+ function makeResolveExternalModuleName(typeChecker) {
2602
+ if (!(hasProperty(typeChecker, "resolveExternalModuleName") && isFunction(typeChecker.resolveExternalModuleName))) {
2603
+ return;
2604
+ }
2605
+ const _internal = typeChecker.resolveExternalModuleName;
2606
+ return (moduleSpecifier) => {
2607
+ return _internal(moduleSpecifier);
2608
+ };
2609
+ }
2776
2610
 
2777
2611
  // src/completions/genFunctionStar.ts
2778
2612
  var genFunctionStar = createCompletion({
@@ -2821,7 +2655,7 @@ var rpcMakeClasses = createCompletion({
2821
2655
  "Rpc"
2822
2656
  )
2823
2657
  );
2824
- const rpcIdentifier = match2(rpcName, {
2658
+ const rpcIdentifier = match(rpcName, {
2825
2659
  onNone: () => "Rpc",
2826
2660
  onSome: (_) => _.text
2827
2661
  });
@@ -2848,14 +2682,208 @@ var completions = [
2848
2682
  effectDataClasses
2849
2683
  ];
2850
2684
 
2685
+ // src/completions/middlewareNamespaceImports.ts
2686
+ var importablePackagesMetadataCache = /* @__PURE__ */ new Map();
2687
+ var makeImportablePackagesMetadata = fn("makeImportablePackagesMetadata")(function* (sourceFile) {
2688
+ const ts = yield* service(TypeScriptApi);
2689
+ const program = yield* service(TypeScriptProgram);
2690
+ const languageServicePluginOptions = yield* service(LanguageServicePluginOptions);
2691
+ const host = program;
2692
+ const namespaceByFileName = /* @__PURE__ */ new Map();
2693
+ const excludedByFileName = /* @__PURE__ */ new Map();
2694
+ const unbarreledModulePathByFileName = /* @__PURE__ */ new Map();
2695
+ for (const packageName of languageServicePluginOptions.namespaceImportPackages) {
2696
+ const barrelModule = ts.resolveModuleName(packageName, sourceFile.fileName, program.getCompilerOptions(), host);
2697
+ if (barrelModule.resolvedModule) {
2698
+ const barrelPath = barrelModule.resolvedModule.resolvedFileName;
2699
+ const barrelSource = program.getSourceFile(barrelPath) || ts.createSourceFile(barrelPath, host.readFile(barrelPath) || "", sourceFile.languageVersion, true);
2700
+ if (barrelSource) {
2701
+ for (const statement of barrelSource.statements) {
2702
+ if (ts.isExportDeclaration(statement)) {
2703
+ const exportClause = statement.exportClause;
2704
+ const moduleSpecifier = statement.moduleSpecifier;
2705
+ if (moduleSpecifier && ts.isStringLiteral(moduleSpecifier)) {
2706
+ const unbarreledModulePathResolved = ts.resolveModuleName(
2707
+ moduleSpecifier.text,
2708
+ barrelSource.fileName,
2709
+ program.getCompilerOptions(),
2710
+ host
2711
+ );
2712
+ if (unbarreledModulePathResolved.resolvedModule) {
2713
+ const unbarreledModulePath = unbarreledModulePathResolved.resolvedModule.resolvedFileName;
2714
+ if (exportClause && ts.isNamespaceExport(exportClause) && ts.isIdentifier(exportClause.name)) {
2715
+ namespaceByFileName.set(unbarreledModulePath, exportClause.name.text);
2716
+ const existingUnbarreledModulePath = unbarreledModulePathByFileName.get(barrelSource.fileName) || [];
2717
+ existingUnbarreledModulePath.push([exportClause.name.text, unbarreledModulePath]);
2718
+ unbarreledModulePathByFileName.set(barrelSource.fileName, existingUnbarreledModulePath);
2719
+ }
2720
+ if (exportClause && ts.isNamedExports(exportClause)) {
2721
+ for (const element of exportClause.elements) {
2722
+ if (!ts.isIdentifier(element.name)) continue;
2723
+ const methodName = element.name.text;
2724
+ const excludedMethods = excludedByFileName.get(methodName) || [];
2725
+ excludedMethods.push(unbarreledModulePath);
2726
+ excludedByFileName.set(methodName, excludedMethods);
2727
+ }
2728
+ }
2729
+ }
2730
+ }
2731
+ }
2732
+ }
2733
+ }
2734
+ }
2735
+ }
2736
+ return {
2737
+ getImportNamespaceByFileName: (fileName) => namespaceByFileName.get(fileName),
2738
+ isExcludedFromNamespaceImport: (fileName, exportName) => (excludedByFileName.get(exportName) || []).includes(fileName),
2739
+ getUnbarreledModulePath: (fileName, exportName) => unbarreledModulePathByFileName.get(fileName)?.find(([name]) => name === exportName)?.[1]
2740
+ };
2741
+ });
2742
+ var appendEffectCompletionEntryData = fn("collectNamespaceImports")(
2743
+ function* (sourceFile, applicableCompletions) {
2744
+ const languageServicePluginOptions = yield* service(LanguageServicePluginOptions);
2745
+ if (languageServicePluginOptions.namespaceImportPackages.length === 0) return applicableCompletions;
2746
+ const packagesMetadata = importablePackagesMetadataCache.get(sourceFile.fileName) || (yield* makeImportablePackagesMetadata(sourceFile));
2747
+ importablePackagesMetadataCache.set(sourceFile.fileName, packagesMetadata);
2748
+ if (applicableCompletions) {
2749
+ return {
2750
+ ...applicableCompletions,
2751
+ entries: applicableCompletions.entries.map((entry) => {
2752
+ if (entry.data && entry.data.fileName && !entry.insertText && !entry.filterText && entry.data.exportName && entry.data.moduleSpecifier) {
2753
+ const isExcluded = packagesMetadata.isExcludedFromNamespaceImport(
2754
+ entry.data.fileName,
2755
+ entry.data.exportName
2756
+ );
2757
+ if (isExcluded) return entry;
2758
+ const unbarreledModulePath = packagesMetadata.getUnbarreledModulePath(
2759
+ entry.data.fileName,
2760
+ entry.data.exportName
2761
+ );
2762
+ const namespaceName = packagesMetadata.getImportNamespaceByFileName(
2763
+ unbarreledModulePath || entry.data.fileName
2764
+ );
2765
+ if (namespaceName) {
2766
+ return {
2767
+ ...entry,
2768
+ // insertText: unbarreledModulePath ? namespaceName : namespaceName + "." + entry.name,
2769
+ // filterText: entry.name,
2770
+ data: {
2771
+ ...entry.data,
2772
+ effectNamespaceName: namespaceName,
2773
+ effectUnbarreledModulePath: unbarreledModulePath || "",
2774
+ effectReplaceSpan: entry.replacementSpan || applicableCompletions.optionalReplacementSpan
2775
+ }
2776
+ };
2777
+ }
2778
+ }
2779
+ return entry;
2780
+ })
2781
+ };
2782
+ }
2783
+ return applicableCompletions;
2784
+ }
2785
+ );
2786
+ var postprocessCompletionEntryDetails = fn("postprocessCompletionEntryDetails")(
2787
+ function* (sourceFile, data, applicableCompletionEntryDetails, formatOptions, preferences, languageServiceHost) {
2788
+ const languageServicePluginOptions = yield* service(LanguageServicePluginOptions);
2789
+ if (languageServicePluginOptions.namespaceImportPackages.length === 0) return applicableCompletionEntryDetails;
2790
+ const ts = yield* service(TypeScriptApi);
2791
+ const program = yield* service(TypeScriptProgram);
2792
+ const getModuleSpecifier = makeGetModuleSpecifier(ts);
2793
+ if (!getModuleSpecifier) return applicableCompletionEntryDetails;
2794
+ if (!applicableCompletionEntryDetails) return applicableCompletionEntryDetails;
2795
+ if (!data) return applicableCompletionEntryDetails;
2796
+ if (!("effectNamespaceName" in data && "effectUnbarreledModulePath" in data && "effectReplaceSpan" in data)) {
2797
+ return applicableCompletionEntryDetails;
2798
+ }
2799
+ const effectReplaceSpan = data.effectReplaceSpan;
2800
+ const codeActions = applicableCompletionEntryDetails.codeActions;
2801
+ if (codeActions && codeActions.length === 1) {
2802
+ const action = codeActions[0];
2803
+ if (action.changes.length === 1) {
2804
+ const fileTextChanges = action.changes[0];
2805
+ if (fileTextChanges.fileName === sourceFile.fileName && fileTextChanges.textChanges.length === 1) {
2806
+ const change = fileTextChanges.textChanges[0];
2807
+ let hasImportActions = false;
2808
+ if (change.newText.trim().toLowerCase().startsWith("import") && change.newText.indexOf(data.exportName) > -1) {
2809
+ hasImportActions = true;
2810
+ }
2811
+ if (!hasImportActions && change.newText.indexOf(data.exportName) > -1) {
2812
+ const ancestorNodes = yield* getAncestorNodesInRange(sourceFile, {
2813
+ pos: change.span.start,
2814
+ end: change.span.start
2815
+ });
2816
+ const importNodes = ancestorNodes.filter((node) => ts.isImportDeclaration(node));
2817
+ hasImportActions = importNodes.length > 0;
2818
+ }
2819
+ if (!hasImportActions) return applicableCompletionEntryDetails;
2820
+ const formatContext = ts.formatting.getFormatContext(
2821
+ formatOptions || {},
2822
+ languageServiceHost
2823
+ );
2824
+ const changes = ts.textChanges.ChangeTracker.with(
2825
+ {
2826
+ formatContext,
2827
+ host: languageServiceHost,
2828
+ preferences: preferences || {}
2829
+ },
2830
+ (changeTracker) => {
2831
+ const isBarrelRedirect = String(data.effectUnbarreledModulePath).length > 0;
2832
+ const moduleSpecifier = isBarrelRedirect ? getModuleSpecifier(
2833
+ program.getCompilerOptions(),
2834
+ sourceFile,
2835
+ sourceFile.fileName,
2836
+ String(data.effectUnbarreledModulePath),
2837
+ program
2838
+ ) : String(data.moduleSpecifier);
2839
+ ts.insertImports(
2840
+ changeTracker,
2841
+ sourceFile,
2842
+ ts.factory.createImportDeclaration(
2843
+ void 0,
2844
+ ts.factory.createImportClause(
2845
+ false,
2846
+ void 0,
2847
+ ts.factory.createNamespaceImport(ts.factory.createIdentifier(String(data.effectNamespaceName)))
2848
+ ),
2849
+ ts.factory.createStringLiteral(moduleSpecifier)
2850
+ ),
2851
+ true,
2852
+ preferences || {}
2853
+ );
2854
+ if (!isBarrelRedirect) {
2855
+ changeTracker.insertText(
2856
+ sourceFile,
2857
+ effectReplaceSpan.start,
2858
+ String(data.effectNamespaceName) + "."
2859
+ );
2860
+ }
2861
+ }
2862
+ );
2863
+ return {
2864
+ ...applicableCompletionEntryDetails,
2865
+ codeActions: [
2866
+ {
2867
+ description: "Import * as " + data.effectNamespaceName + " from " + data.effectUnbarreledModulePath,
2868
+ changes
2869
+ }
2870
+ ]
2871
+ };
2872
+ }
2873
+ }
2874
+ }
2875
+ return applicableCompletionEntryDetails;
2876
+ }
2877
+ );
2878
+
2851
2879
  // src/diagnostics/duplicatePackage.ts
2852
2880
  var checkedPackagesCache = /* @__PURE__ */ new Map();
2853
2881
  var programResolvedCacheSize = /* @__PURE__ */ new Map();
2854
2882
  var duplicatePackage = createDiagnostic({
2855
2883
  name: "duplicatePackage",
2856
2884
  code: 6,
2885
+ severity: "warning",
2857
2886
  apply: fn("duplicatePackage.apply")(function* (sourceFile, report) {
2858
- const ts = yield* service(TypeScriptApi);
2859
2887
  const program = yield* service(TypeScriptProgram);
2860
2888
  const options = yield* service(LanguageServicePluginOptions);
2861
2889
  if (sourceFile.statements.length < 1) return;
@@ -2884,7 +2912,6 @@ var duplicatePackage = createDiagnostic({
2884
2912
  const versions = Object.keys(resolvedPackages[packageName]);
2885
2913
  report({
2886
2914
  node: sourceFile.statements[0],
2887
- category: ts.DiagnosticCategory.Warning,
2888
2915
  messageText: `Package ${packageName} is referenced multiple times with different versions (${versions.join(", ")}) and may cause unexpected type errors.
2889
2916
  Cleanup your dependencies and your package lockfile to avoid multiple instances of this package and reload the project.
2890
2917
  If this is intended set the LSP config "allowedDuplicatedPackages" to ${JSON.stringify(options.allowedDuplicatedPackages.concat([packageName]))}.
@@ -2901,6 +2928,7 @@ ${versions.map((version) => `- found ${version} at ${resolvedPackages[packageNam
2901
2928
  var floatingEffect = createDiagnostic({
2902
2929
  name: "floatingEffect",
2903
2930
  code: 3,
2931
+ severity: "error",
2904
2932
  apply: fn("floatingEffect.apply")(function* (sourceFile, report) {
2905
2933
  const ts = yield* service(TypeScriptApi);
2906
2934
  const typeChecker = yield* service(TypeCheckerApi);
@@ -2927,13 +2955,12 @@ var floatingEffect = createDiagnostic({
2927
2955
  if (isSome2(effect)) {
2928
2956
  const allowedFloatingEffects = yield* pipe(
2929
2957
  typeParser.fiberType(type, node.expression),
2930
- orElse3(() => typeParser.effectSubtype(type, node.expression)),
2958
+ orElse2(() => typeParser.effectSubtype(type, node.expression)),
2931
2959
  option
2932
2960
  );
2933
2961
  if (isNone2(allowedFloatingEffects)) {
2934
2962
  report({
2935
2963
  node,
2936
- category: ts.DiagnosticCategory.Error,
2937
2964
  messageText: `Effect must be yielded or assigned to a variable.`,
2938
2965
  fixes: []
2939
2966
  });
@@ -2947,6 +2974,7 @@ var floatingEffect = createDiagnostic({
2947
2974
  var genericEffectServices = createDiagnostic({
2948
2975
  name: "genericEffectServices",
2949
2976
  code: 10,
2977
+ severity: "warning",
2950
2978
  apply: fn("genericEffectServices.apply")(function* (sourceFile, report) {
2951
2979
  const ts = yield* service(TypeScriptApi);
2952
2980
  const typeParser = yield* service(TypeParser);
@@ -2976,12 +3004,11 @@ var genericEffectServices = createDiagnostic({
2976
3004
  map4(() => {
2977
3005
  report({
2978
3006
  node: reportAt,
2979
- category: ts.DiagnosticCategory.Warning,
2980
3007
  messageText: `Effect Services with type parameters are not supported because they cannot be properly discriminated at runtime, which may cause unexpected behavior.`,
2981
3008
  fixes: []
2982
3009
  });
2983
3010
  }),
2984
- orElse3(() => sync(() => ts.forEachChild(node, appendNodeToVisit))),
3011
+ orElse2(() => sync(() => ts.forEachChild(node, appendNodeToVisit))),
2985
3012
  ignore
2986
3013
  );
2987
3014
  }
@@ -2989,10 +3016,124 @@ var genericEffectServices = createDiagnostic({
2989
3016
  })
2990
3017
  });
2991
3018
 
3019
+ // src/diagnostics/importFromBarrel.ts
3020
+ var importFromBarrel = createDiagnostic({
3021
+ name: "importFromBarrel",
3022
+ code: 12,
3023
+ severity: "off",
3024
+ apply: fn("importFromBarrel.apply")(function* (sourceFile, report) {
3025
+ const languageServicePluginOptions = yield* service(LanguageServicePluginOptions);
3026
+ if (languageServicePluginOptions.namespaceImportPackages.length === 0) return;
3027
+ const ts = yield* service(TypeScriptApi);
3028
+ const typeChecker = yield* service(TypeCheckerApi);
3029
+ const program = yield* service(TypeScriptProgram);
3030
+ const isImportedFromBarrelExport = (element, languageServicePluginOptions2) => {
3031
+ const getModuleSpecifier = makeGetModuleSpecifier(ts);
3032
+ const resolveExternalModuleName = makeResolveExternalModuleName(typeChecker);
3033
+ if (!(getModuleSpecifier && resolveExternalModuleName)) return;
3034
+ const importDeclaration = ts.findAncestor(element, (node) => ts.isImportDeclaration(node));
3035
+ if (!importDeclaration) return;
3036
+ if (!ts.isStringLiteral(importDeclaration.moduleSpecifier)) return;
3037
+ const importClause = importDeclaration.importClause;
3038
+ if (!importClause) return;
3039
+ const namedBindings = importClause.namedBindings;
3040
+ if (!namedBindings) return;
3041
+ if (!ts.isNamedImports(namedBindings)) return;
3042
+ const barrelModuleName = importDeclaration.moduleSpecifier.text;
3043
+ if (languageServicePluginOptions2.namespaceImportPackages.indexOf(barrelModuleName.toLowerCase()) === -1) return;
3044
+ const moduleSymbol = resolveExternalModuleName(importDeclaration.moduleSpecifier);
3045
+ if (!moduleSymbol) return;
3046
+ if (!moduleSymbol.exports) return;
3047
+ const sourceFile2 = importDeclaration.getSourceFile();
3048
+ const nodeForSymbol = element.propertyName || element.name;
3049
+ if (!ts.isIdentifier(nodeForSymbol)) return;
3050
+ const importedName = nodeForSymbol.text;
3051
+ const reexportedSymbol = moduleSymbol.exports.get(ts.escapeLeadingUnderscores(importedName));
3052
+ if (!reexportedSymbol) return;
3053
+ if (!(reexportedSymbol.declarations && reexportedSymbol.declarations.length === 1)) return;
3054
+ const namespaceExport = reexportedSymbol.declarations[0];
3055
+ if (!ts.isNamespaceExport(namespaceExport)) return;
3056
+ const exportDeclaration = namespaceExport.parent;
3057
+ if (!ts.isExportDeclaration(exportDeclaration)) return;
3058
+ if (!exportDeclaration.moduleSpecifier) return;
3059
+ const originalModuleSymbol = resolveExternalModuleName(exportDeclaration.moduleSpecifier);
3060
+ if (!originalModuleSymbol) return;
3061
+ if (!originalModuleSymbol.valueDeclaration) return;
3062
+ const originalSourceFile = originalModuleSymbol.valueDeclaration.getSourceFile();
3063
+ const unbarrelledFileName = getModuleSpecifier(
3064
+ program.getCompilerOptions(),
3065
+ sourceFile2,
3066
+ sourceFile2.fileName,
3067
+ originalSourceFile.fileName,
3068
+ program
3069
+ );
3070
+ if (unbarrelledFileName.toLowerCase().indexOf(barrelModuleName.toLowerCase() + "/") === -1) return;
3071
+ return { unbarrelledFileName, importedName, barrelModuleName, importClause, namedBindings, importDeclaration };
3072
+ };
3073
+ const nodeToVisit = [];
3074
+ const appendNodeToVisit = (node) => {
3075
+ nodeToVisit.push(node);
3076
+ return void 0;
3077
+ };
3078
+ ts.forEachChild(sourceFile, appendNodeToVisit);
3079
+ while (nodeToVisit.length > 0) {
3080
+ const node = nodeToVisit.shift();
3081
+ const parent = node.parent;
3082
+ if (!(ts.isImportSpecifier(node) && ts.isNamedImports(parent))) {
3083
+ ts.forEachChild(node, appendNodeToVisit);
3084
+ continue;
3085
+ }
3086
+ const result = isImportedFromBarrelExport(node, languageServicePluginOptions);
3087
+ if (!result) continue;
3088
+ const { barrelModuleName, importClause, importDeclaration, importedName, namedBindings, unbarrelledFileName } = result;
3089
+ report({
3090
+ node,
3091
+ messageText: `Importing from barrel module ${barrelModuleName} is not allowed.`,
3092
+ fixes: [
3093
+ {
3094
+ fixName: "replaceWithUnbarrelledImport",
3095
+ description: `Import * as ${importedName} from ${unbarrelledFileName}`,
3096
+ apply: gen(function* () {
3097
+ const changeTracker = yield* service(ChangeTracker);
3098
+ const newImport = ts.factory.createImportDeclaration(
3099
+ void 0,
3100
+ ts.factory.createImportClause(
3101
+ importClause.isTypeOnly || node.isTypeOnly,
3102
+ void 0,
3103
+ ts.factory.createNamespaceImport(ts.factory.createIdentifier(importedName))
3104
+ ),
3105
+ ts.factory.createStringLiteral(unbarrelledFileName)
3106
+ );
3107
+ if (namedBindings.elements.length === 1) {
3108
+ changeTracker.replaceNode(
3109
+ sourceFile,
3110
+ importDeclaration,
3111
+ newImport
3112
+ );
3113
+ } else {
3114
+ changeTracker.insertNodeAfter(sourceFile, importDeclaration, newImport);
3115
+ changeTracker.replaceNode(
3116
+ sourceFile,
3117
+ namedBindings,
3118
+ ts.factory.updateNamedImports(
3119
+ namedBindings,
3120
+ namedBindings.elements.filter((e) => e !== node)
3121
+ )
3122
+ );
3123
+ }
3124
+ })
3125
+ }
3126
+ ]
3127
+ });
3128
+ }
3129
+ })
3130
+ });
3131
+
2992
3132
  // src/diagnostics/leakingRequirements.ts
2993
3133
  var leakingRequirements = createDiagnostic({
2994
3134
  name: "leakingRequirements",
2995
3135
  code: 8,
3136
+ severity: "suggestion",
2996
3137
  apply: fn("leakingRequirements.apply")(function* (sourceFile, report) {
2997
3138
  const ts = yield* service(TypeScriptApi);
2998
3139
  const typeChecker = yield* service(TypeCheckerApi);
@@ -3012,7 +3153,7 @@ var leakingRequirements = createDiagnostic({
3012
3153
  yield* pipe(
3013
3154
  typeParser.effectType(servicePropertyType, atLocation),
3014
3155
  map4((_) => effectContextType = _.R),
3015
- orElse3(() => {
3156
+ orElse2(() => {
3016
3157
  const servicePropertyCallSignatures = servicePropertyType.getCallSignatures();
3017
3158
  if (servicePropertyCallSignatures.length === 1) {
3018
3159
  return pipe(
@@ -3022,7 +3163,7 @@ var leakingRequirements = createDiagnostic({
3022
3163
  })
3023
3164
  );
3024
3165
  }
3025
- return void_2;
3166
+ return void_;
3026
3167
  }),
3027
3168
  ignore
3028
3169
  );
@@ -3050,7 +3191,6 @@ var leakingRequirements = createDiagnostic({
3050
3191
  if (requirements.length === 0) return;
3051
3192
  report({
3052
3193
  node,
3053
- category: ts.DiagnosticCategory.Warning,
3054
3194
  messageText: `This Service is leaking the ${requirements.map((_) => typeChecker.typeToString(_)).join(" | ")} requirement.
3055
3195
  If these requirements cannot be cached and are expected to be provided per method invocation (e.g. HttpServerRequest), you can safely disable this diagnostic for this line through quickfixes.
3056
3196
  More info at https://effect.website/docs/requirements-management/layers/#avoiding-requirement-leakage`,
@@ -3081,13 +3221,13 @@ More info at https://effect.website/docs/requirements-management/layers/#avoidin
3081
3221
  for (const [type, reportAt] of typesToCheck) {
3082
3222
  yield* pipe(
3083
3223
  typeParser.contextTag(type, node),
3084
- flatMap3(
3224
+ flatMap2(
3085
3225
  ({ Service }) => pipe(
3086
3226
  parseLeakedRequirements(Service, node),
3087
3227
  map4((requirements) => reportLeakingRequirements(reportAt, sort(requirements, typeOrder)))
3088
3228
  )
3089
3229
  ),
3090
- orElse3(() => sync(() => ts.forEachChild(node, appendNodeToVisit))),
3230
+ orElse2(() => sync(() => ts.forEachChild(node, appendNodeToVisit))),
3091
3231
  ignore
3092
3232
  );
3093
3233
  }
@@ -3099,17 +3239,17 @@ More info at https://effect.website/docs/requirements-management/layers/#avoidin
3099
3239
  var missingEffectContext = createDiagnostic({
3100
3240
  name: "missingEffectContext",
3101
3241
  code: 1,
3242
+ severity: "error",
3102
3243
  apply: fn("missingEffectContext.apply")(function* (sourceFile, report) {
3103
- const ts = yield* service(TypeScriptApi);
3104
3244
  const typeChecker = yield* service(TypeCheckerApi);
3105
3245
  const typeParser = yield* service(TypeParser);
3106
3246
  const typeOrder = yield* deterministicTypeOrder;
3107
3247
  const checkForMissingContextTypes = (node, expectedType, valueNode, realType) => pipe(
3108
- all2(
3248
+ all(
3109
3249
  typeParser.effectType(expectedType, node),
3110
3250
  typeParser.effectType(realType, valueNode)
3111
3251
  ),
3112
- flatMap3(
3252
+ flatMap2(
3113
3253
  ([expectedEffect, realEffect]) => getMissingTypeEntriesInTargetType(
3114
3254
  realEffect.R,
3115
3255
  expectedEffect.R
@@ -3126,13 +3266,12 @@ var missingEffectContext = createDiagnostic({
3126
3266
  valueNode,
3127
3267
  realType
3128
3268
  ),
3129
- orElse3(() => succeed([]))
3269
+ orElse2(() => succeed([]))
3130
3270
  );
3131
3271
  if (missingContext.length > 0) {
3132
3272
  report(
3133
3273
  {
3134
3274
  node,
3135
- category: ts.DiagnosticCategory.Error,
3136
3275
  messageText: `Missing '${sortTypes(missingContext).map((_) => typeChecker.typeToString(_)).join(" | ")}' in the expected Effect context.`,
3137
3276
  fixes: []
3138
3277
  }
@@ -3146,17 +3285,17 @@ var missingEffectContext = createDiagnostic({
3146
3285
  var missingEffectError = createDiagnostic({
3147
3286
  name: "missingEffectError",
3148
3287
  code: 1,
3288
+ severity: "error",
3149
3289
  apply: fn("missingEffectError.apply")(function* (sourceFile, report) {
3150
- const ts = yield* service(TypeScriptApi);
3151
3290
  const typeChecker = yield* service(TypeCheckerApi);
3152
3291
  const typeParser = yield* service(TypeParser);
3153
3292
  const typeOrder = yield* deterministicTypeOrder;
3154
3293
  const checkForMissingErrorTypes = (node, expectedType, valueNode, realType) => pipe(
3155
- all2(
3294
+ all(
3156
3295
  typeParser.effectType(expectedType, node),
3157
3296
  typeParser.effectType(realType, valueNode)
3158
3297
  ),
3159
- flatMap3(
3298
+ flatMap2(
3160
3299
  ([expectedEffect, realEffect]) => getMissingTypeEntriesInTargetType(
3161
3300
  realEffect.E,
3162
3301
  expectedEffect.E
@@ -3173,13 +3312,12 @@ var missingEffectError = createDiagnostic({
3173
3312
  valueNode,
3174
3313
  realType
3175
3314
  ),
3176
- orElse3(() => succeed([]))
3315
+ orElse2(() => succeed([]))
3177
3316
  );
3178
3317
  if (missingContext.length > 0) {
3179
3318
  report(
3180
3319
  {
3181
3320
  node,
3182
- category: ts.DiagnosticCategory.Error,
3183
3321
  messageText: `Missing '${sortTypes(missingContext).map((_) => typeChecker.typeToString(_)).join(" | ")}' in the expected Effect errors.`,
3184
3322
  fixes: []
3185
3323
  }
@@ -3193,6 +3331,7 @@ var missingEffectError = createDiagnostic({
3193
3331
  var missingReturnYieldStar = createDiagnostic({
3194
3332
  name: "missingReturnYieldStar",
3195
3333
  code: 7,
3334
+ severity: "error",
3196
3335
  apply: fn("missingReturnYieldStar.apply")(function* (sourceFile, report) {
3197
3336
  const ts = yield* service(TypeScriptApi);
3198
3337
  const typeChecker = yield* service(TypeCheckerApi);
@@ -3219,15 +3358,15 @@ var missingReturnYieldStar = createDiagnostic({
3219
3358
  const effectGenNode = generatorFunctionOrReturnStatement.parent;
3220
3359
  const effectGenLike = yield* pipe(
3221
3360
  typeParser.effectGen(effectGenNode),
3222
- orElse3(() => typeParser.effectFnUntracedGen(effectGenNode)),
3223
- orElse3(() => typeParser.effectFnGen(effectGenNode)),
3361
+ orElse2(() => typeParser.effectFnUntracedGen(effectGenNode)),
3362
+ orElse2(() => typeParser.effectFnGen(effectGenNode)),
3224
3363
  option
3225
3364
  );
3226
3365
  if (isSome2(effectGenLike)) {
3227
3366
  const fix = node.expression ? [{
3228
3367
  fixName: "missingReturnYieldStar_fix",
3229
3368
  description: "Add return statement",
3230
- apply: gen2(function* () {
3369
+ apply: gen(function* () {
3231
3370
  const changeTracker = yield* service(ChangeTracker);
3232
3371
  changeTracker.replaceNode(
3233
3372
  sourceFile,
@@ -3240,7 +3379,6 @@ var missingReturnYieldStar = createDiagnostic({
3240
3379
  }] : [];
3241
3380
  report({
3242
3381
  node,
3243
- category: ts.DiagnosticCategory.Error,
3244
3382
  messageText: `Yielded Effect never succeeds, so it is best to use a 'return yield*' instead.`,
3245
3383
  fixes: fix
3246
3384
  });
@@ -3257,6 +3395,7 @@ var missingReturnYieldStar = createDiagnostic({
3257
3395
  var missingStarInYieldEffectGen = createDiagnostic({
3258
3396
  name: "missingStarInYieldEffectGen",
3259
3397
  code: 4,
3398
+ severity: "error",
3260
3399
  apply: fn("missingStarInYieldEffectGen.apply")(function* (sourceFile, report) {
3261
3400
  const ts = yield* service(TypeScriptApi);
3262
3401
  const typeParser = yield* service(TypeParser);
@@ -3280,8 +3419,8 @@ var missingStarInYieldEffectGen = createDiagnostic({
3280
3419
  const effectGenNode = functionStarNode.parent;
3281
3420
  yield* pipe(
3282
3421
  typeParser.effectGen(effectGenNode),
3283
- orElse3(() => typeParser.effectFnUntracedGen(effectGenNode)),
3284
- orElse3(() => typeParser.effectFnGen(effectGenNode)),
3422
+ orElse2(() => typeParser.effectFnUntracedGen(effectGenNode)),
3423
+ orElse2(() => typeParser.effectFnGen(effectGenNode)),
3285
3424
  map4(({ functionStar }) => {
3286
3425
  if (functionStar) {
3287
3426
  brokenGenerators.add(functionStar);
@@ -3296,7 +3435,6 @@ var missingStarInYieldEffectGen = createDiagnostic({
3296
3435
  brokenGenerators.forEach(
3297
3436
  (node) => report({
3298
3437
  node,
3299
- category: ts.DiagnosticCategory.Error,
3300
3438
  messageText: `Seems like you used yield instead of yield* inside this Effect.gen.`,
3301
3439
  fixes: []
3302
3440
  })
@@ -3305,7 +3443,7 @@ var missingStarInYieldEffectGen = createDiagnostic({
3305
3443
  const fix = node.expression ? [{
3306
3444
  fixName: "missingStarInYieldEffectGen_fix",
3307
3445
  description: "Replace yield with yield*",
3308
- apply: gen2(function* () {
3446
+ apply: gen(function* () {
3309
3447
  const changeTracker = yield* service(ChangeTracker);
3310
3448
  changeTracker.replaceNode(
3311
3449
  sourceFile,
@@ -3319,7 +3457,6 @@ var missingStarInYieldEffectGen = createDiagnostic({
3319
3457
  }] : [];
3320
3458
  report({
3321
3459
  node,
3322
- category: ts.DiagnosticCategory.Error,
3323
3460
  messageText: `When yielding Effects inside Effect.gen, you should use yield* instead of yield.`,
3324
3461
  fixes: fix
3325
3462
  });
@@ -3331,6 +3468,7 @@ var missingStarInYieldEffectGen = createDiagnostic({
3331
3468
  var returnEffectInGen = createDiagnostic({
3332
3469
  name: "returnEffectInGen",
3333
3470
  code: 11,
3471
+ severity: "suggestion",
3334
3472
  apply: fn("returnEffectInGen.apply")(function* (sourceFile, report) {
3335
3473
  const ts = yield* service(TypeScriptApi);
3336
3474
  const typeChecker = yield* service(TypeCheckerApi);
@@ -3358,13 +3496,13 @@ var returnEffectInGen = createDiagnostic({
3358
3496
  const effectGenNode = generatorOrRegularFunction.parent;
3359
3497
  yield* pipe(
3360
3498
  typeParser.effectGen(effectGenNode),
3361
- orElse3(() => typeParser.effectFnUntracedGen(effectGenNode)),
3362
- orElse3(() => typeParser.effectFnGen(effectGenNode)),
3499
+ orElse2(() => typeParser.effectFnUntracedGen(effectGenNode)),
3500
+ orElse2(() => typeParser.effectFnGen(effectGenNode)),
3363
3501
  map4(() => {
3364
3502
  const fix = node.expression ? [{
3365
3503
  fixName: "returnEffectInGen_fix",
3366
3504
  description: "Add yield* statement",
3367
- apply: gen2(function* () {
3505
+ apply: gen(function* () {
3368
3506
  const changeTracker = yield* service(ChangeTracker);
3369
3507
  changeTracker.replaceNode(
3370
3508
  sourceFile,
@@ -3378,7 +3516,6 @@ var returnEffectInGen = createDiagnostic({
3378
3516
  }] : [];
3379
3517
  report({
3380
3518
  node,
3381
- category: ts.DiagnosticCategory.Suggestion,
3382
3519
  messageText: `You are returning an Effect-able type inside a generator function, and will result in nested Effect<Effect<...>>.
3383
3520
  Maybe you wanted to return yield* instead?
3384
3521
  Nested Effect-able types may be intended if you plan to later manually flatten or unwrap this Effect, if so you can safely disable this diagnostic for this line through quickfixes.`,
@@ -3398,6 +3535,7 @@ Nested Effect-able types may be intended if you plan to later manually flatten o
3398
3535
  var unnecessaryEffectGen = createDiagnostic({
3399
3536
  name: "unnecessaryEffectGen",
3400
3537
  code: 5,
3538
+ severity: "suggestion",
3401
3539
  apply: fn("unnecessaryEffectGen.apply")(function* (sourceFile, report) {
3402
3540
  const ts = yield* service(TypeScriptApi);
3403
3541
  const typeParser = yield* service(TypeParser);
@@ -3416,12 +3554,11 @@ var unnecessaryEffectGen = createDiagnostic({
3416
3554
  map4(
3417
3555
  ({ replacementNode }) => report({
3418
3556
  node,
3419
- category: ts.DiagnosticCategory.Suggestion,
3420
3557
  messageText: `This Effect.gen contains a single return statement.`,
3421
3558
  fixes: [{
3422
3559
  fixName: "unnecessaryEffectGen_fix",
3423
3560
  description: "Remove the Effect.gen, and keep the body",
3424
- apply: gen2(function* () {
3561
+ apply: gen(function* () {
3425
3562
  const textChanges = yield* service(
3426
3563
  ChangeTracker
3427
3564
  );
@@ -3441,6 +3578,7 @@ var unnecessaryEffectGen = createDiagnostic({
3441
3578
  var unnecessaryPipe = createDiagnostic({
3442
3579
  name: "unnecessaryPipe",
3443
3580
  code: 9,
3581
+ severity: "suggestion",
3444
3582
  apply: fn("unnecessaryPipe.apply")(function* (sourceFile, report) {
3445
3583
  const ts = yield* service(TypeScriptApi);
3446
3584
  const typeParser = yield* service(TypeParser);
@@ -3460,12 +3598,11 @@ var unnecessaryPipe = createDiagnostic({
3460
3598
  if (args.length === 0) {
3461
3599
  report({
3462
3600
  node,
3463
- category: ts.DiagnosticCategory.Suggestion,
3464
3601
  messageText: `This pipe call contains no arguments.`,
3465
3602
  fixes: [{
3466
3603
  fixName: "unnecessaryPipe_fix",
3467
3604
  description: "Remove the pipe call",
3468
- apply: gen2(function* () {
3605
+ apply: gen(function* () {
3469
3606
  const textChanges = yield* service(
3470
3607
  ChangeTracker
3471
3608
  );
@@ -3494,12 +3631,13 @@ var diagnostics = [
3494
3631
  leakingRequirements,
3495
3632
  unnecessaryPipe,
3496
3633
  genericEffectServices,
3497
- returnEffectInGen
3634
+ returnEffectInGen,
3635
+ importFromBarrel
3498
3636
  ];
3499
3637
 
3500
3638
  // src/goto/effectRpcDefinition.ts
3501
3639
  function effectRpcDefinition(applicableGotoDefinition, sourceFile, position) {
3502
- return gen2(function* () {
3640
+ return gen(function* () {
3503
3641
  const program = yield* service(TypeScriptProgram);
3504
3642
  const ts = yield* service(TypeScriptApi);
3505
3643
  const typeChecker = yield* service(TypeCheckerApi);
@@ -3619,41 +3757,82 @@ function dedupeJsDocs(quickInfo2) {
3619
3757
  }
3620
3758
 
3621
3759
  // src/quickinfo/effectTypeArgs.ts
3622
- function formatTypeForQuickInfo(channelType, channelName) {
3623
- return gen2(function* () {
3624
- const ts = yield* service(TypeScriptApi);
3625
- const typeChecker = yield* service(TypeCheckerApi);
3626
- const stringRepresentation = typeChecker.typeToString(
3627
- channelType,
3628
- void 0,
3629
- ts.TypeFormatFlags.NoTruncation
3630
- );
3631
- return `type ${channelName} = ${stringRepresentation}`;
3632
- });
3633
- }
3634
3760
  function effectTypeArgs(sourceFile, position, quickInfo2) {
3635
3761
  return pipe(
3636
- gen2(function* () {
3762
+ gen(function* () {
3637
3763
  const ts = yield* service(TypeScriptApi);
3638
3764
  const typeChecker = yield* service(TypeCheckerApi);
3639
3765
  const typeParser = yield* service(TypeParser);
3640
- const maybeNode = pipe(
3641
- yield* getAncestorNodesInRange(sourceFile, toTextRange(position)),
3642
- head
3643
- );
3644
- if (isNone2(maybeNode)) return quickInfo2;
3645
- const node = maybeNode.value;
3646
- const hasTruncationHappened = quickInfo2 && ts.displayPartsToString(quickInfo2.displayParts).indexOf("...") > -1;
3647
- const nodeForType = !quickInfo2 && ts.isYieldExpression(node) && node.asteriskToken && node.expression ? node.expression : hasTruncationHappened ? node : void 0;
3648
- if (!nodeForType) return quickInfo2;
3649
- const effectType = yield* typeParser.effectType(
3650
- typeChecker.getTypeAtLocation(nodeForType),
3651
- nodeForType
3766
+ function formatTypeForQuickInfo(channelType, channelName) {
3767
+ const stringRepresentation = typeChecker.typeToString(
3768
+ channelType,
3769
+ void 0,
3770
+ ts.TypeFormatFlags.NoTruncation
3771
+ );
3772
+ return `type ${channelName} = ${stringRepresentation}`;
3773
+ }
3774
+ function makeSymbolDisplayParts(title, A, E, R) {
3775
+ return [{
3776
+ kind: "text",
3777
+ text: "```ts\n/* " + title + " */\n" + formatTypeForQuickInfo(A, "Success") + "\n" + formatTypeForQuickInfo(E, "Failure") + "\n" + formatTypeForQuickInfo(R, "Requirements") + "\n```\n"
3778
+ }];
3779
+ }
3780
+ function getNodeForQuickInfo(node2) {
3781
+ if (ts.isNewExpression(node2.parent) && node2.pos === node2.parent.pos) {
3782
+ return node2.parent.expression;
3783
+ }
3784
+ if (ts.isNamedTupleMember(node2.parent) && node2.pos === node2.parent.pos) {
3785
+ return node2.parent;
3786
+ }
3787
+ if (ts.isJsxNamespacedName(node2.parent)) {
3788
+ return node2.parent;
3789
+ }
3790
+ return node2;
3791
+ }
3792
+ function getDataForQuickInfo() {
3793
+ if (!("getTouchingPropertyName" in ts && typeof ts.getTouchingPropertyName === "function")) return;
3794
+ const touchingNode = ts.getTouchingPropertyName(sourceFile, position);
3795
+ if (touchingNode === sourceFile) return;
3796
+ const adjustedNode = getNodeForQuickInfo(touchingNode);
3797
+ if (ts.isToken(adjustedNode) && adjustedNode.kind === ts.SyntaxKind.YieldKeyword) {
3798
+ if (ts.isYieldExpression(adjustedNode.parent) && adjustedNode.parent.asteriskToken && adjustedNode.parent.expression) {
3799
+ return {
3800
+ type: typeChecker.getTypeAtLocation(adjustedNode.parent.expression),
3801
+ atLocation: adjustedNode.parent.expression,
3802
+ node: adjustedNode.parent,
3803
+ shouldTry: true
3804
+ };
3805
+ }
3806
+ }
3807
+ return {
3808
+ type: typeChecker.getTypeAtLocation(adjustedNode),
3809
+ atLocation: adjustedNode,
3810
+ node: adjustedNode,
3811
+ shouldTry: quickInfo2 && ts.displayPartsToString(quickInfo2.displayParts).indexOf("...") > -1
3812
+ };
3813
+ }
3814
+ const data = getDataForQuickInfo();
3815
+ if (!(data && data.shouldTry)) return quickInfo2;
3816
+ const { atLocation, node, type } = data;
3817
+ const effectTypeArgsDocumentation = yield* pipe(
3818
+ typeParser.effectType(
3819
+ type,
3820
+ atLocation
3821
+ ),
3822
+ map4((_) => makeSymbolDisplayParts("Effect Type Parameters", _.A, _.E, _.R)),
3823
+ orElse2(() => {
3824
+ const callSignatues = type.getCallSignatures();
3825
+ if (callSignatues.length !== 1) return succeed([]);
3826
+ const returnType = callSignatues[0].getReturnType();
3827
+ return pipe(
3828
+ typeParser.effectType(
3829
+ returnType,
3830
+ atLocation
3831
+ ),
3832
+ map4((_) => makeSymbolDisplayParts("Returned Effect Type Parameters", _.A, _.E, _.R))
3833
+ );
3834
+ })
3652
3835
  );
3653
- const effectTypeArgsDocumentation = [{
3654
- kind: "text",
3655
- text: "```ts\n/* Effect Type Parameters */\n" + (yield* formatTypeForQuickInfo(effectType.A, "Success")) + "\n" + (yield* formatTypeForQuickInfo(effectType.E, "Failure")) + "\n" + (yield* formatTypeForQuickInfo(effectType.R, "Requirements")) + "\n```\n"
3656
- }];
3657
3836
  if (!quickInfo2) {
3658
3837
  const start = node.getStart();
3659
3838
  const end = node.getEnd();
@@ -3675,7 +3854,7 @@ function effectTypeArgs(sourceFile, position, quickInfo2) {
3675
3854
  documentation: effectTypeArgsDocumentation
3676
3855
  };
3677
3856
  }),
3678
- orElse3(() => succeed(quickInfo2))
3857
+ orElse2(() => succeed(quickInfo2))
3679
3858
  );
3680
3859
  }
3681
3860
 
@@ -3707,7 +3886,7 @@ var GraphNodeCompoundTransform = class {
3707
3886
  _tag = "GraphNodeCompoundTransform";
3708
3887
  };
3709
3888
  function processLayerGraphNode(ctx, node, pipedInGraphNode) {
3710
- return gen2(function* () {
3889
+ return gen(function* () {
3711
3890
  const ts = yield* service(TypeScriptApi);
3712
3891
  const typeChecker = yield* service(TypeCheckerApi);
3713
3892
  const typeParser = yield* service(TypeParser);
@@ -3724,7 +3903,7 @@ function processLayerGraphNode(ctx, node, pipedInGraphNode) {
3724
3903
  const maybeLayer = yield* option(typeParser.layerType(type, node));
3725
3904
  if (isSome2(maybeLayer)) {
3726
3905
  const argNodes = yield* option(
3727
- all2(...node.arguments.map((_) => processLayerGraphNode(ctx, _, void 0)))
3906
+ all(...node.arguments.map((_) => processLayerGraphNode(ctx, _, void 0)))
3728
3907
  );
3729
3908
  if (isSome2(argNodes) && argNodes.value.length === node.arguments.length) {
3730
3909
  const { allIndexes: outTypes } = yield* appendToUniqueTypesMap(
@@ -3768,7 +3947,7 @@ function processLayerGraphNode(ctx, node, pipedInGraphNode) {
3768
3947
  );
3769
3948
  if (ts.isCallExpression(node)) {
3770
3949
  const argNodes = yield* option(
3771
- all2(...node.arguments.map((_) => processLayerGraphNode(ctx, _, void 0)))
3950
+ all(...node.arguments.map((_) => processLayerGraphNode(ctx, _, void 0)))
3772
3951
  );
3773
3952
  if (isSome2(argNodes) && argNodes.value.length === node.arguments.length) {
3774
3953
  return new GraphNodeCompoundTransform(
@@ -3843,7 +4022,7 @@ function escapeMermaid(text) {
3843
4022
  return text.replace(/"/mg, "#quot;").replace(/\n/mg, " ");
3844
4023
  }
3845
4024
  function processNodeMermaid(graph, ctx, ctxL) {
3846
- return gen2(function* () {
4025
+ return gen(function* () {
3847
4026
  const ts = yield* service(TypeScriptApi);
3848
4027
  const typeChecker = yield* service(TypeCheckerApi);
3849
4028
  let subgraphDefs = [];
@@ -3896,7 +4075,7 @@ function processNodeMermaid(graph, ctx, ctxL) {
3896
4075
  return subgraphDefs;
3897
4076
  }
3898
4077
  case "GraphNodeCompoundTransform": {
3899
- const childs = flatten(yield* all2(...graph.args.map((_) => processNodeMermaid(_, ctx, ctxL))));
4078
+ const childs = flatten(yield* all(...graph.args.map((_) => processNodeMermaid(_, ctx, ctxL))));
3900
4079
  let currentEdges = [];
3901
4080
  const connectedNodes = /* @__PURE__ */ new Set();
3902
4081
  for (const requiredServiceKey of graph.rin) {
@@ -3928,7 +4107,7 @@ function processNodeMermaid(graph, ctx, ctxL) {
3928
4107
  });
3929
4108
  }
3930
4109
  function generateMarmaidUri(graph, ctxL) {
3931
- return gen2(function* () {
4110
+ return gen(function* () {
3932
4111
  const ctx = {
3933
4112
  seenIds: /* @__PURE__ */ new Set()
3934
4113
  };
@@ -3940,7 +4119,7 @@ function generateMarmaidUri(graph, ctxL) {
3940
4119
  }
3941
4120
  function layerInfo(sourceFile, position, quickInfo2) {
3942
4121
  return pipe(
3943
- gen2(function* () {
4122
+ gen(function* () {
3944
4123
  const ts = yield* service(TypeScriptApi);
3945
4124
  const typeChecker = yield* service(TypeCheckerApi);
3946
4125
  const typeParser = yield* service(TypeParser);
@@ -3965,8 +4144,8 @@ function layerInfo(sourceFile, position, quickInfo2) {
3965
4144
  };
3966
4145
  const layerInfoDisplayParts = yield* pipe(
3967
4146
  processLayerGraphNode(graphCtx, layerNode, void 0),
3968
- flatMap3(
3969
- (rootNode) => gen2(function* () {
4147
+ flatMap2(
4148
+ (rootNode) => gen(function* () {
3970
4149
  yield* succeed(void 0);
3971
4150
  const lines = [];
3972
4151
  const appendInfo = (providesNode, type, kindText) => {
@@ -4010,7 +4189,7 @@ function layerInfo(sourceFile, position, quickInfo2) {
4010
4189
  ];
4011
4190
  })
4012
4191
  ),
4013
- orElse3(
4192
+ orElse2(
4014
4193
  (e) => succeed([{
4015
4194
  kind: "text",
4016
4195
  text: "```\n/** layer graph not created: " + e.message + " */\n```\n"
@@ -4038,13 +4217,13 @@ function layerInfo(sourceFile, position, quickInfo2) {
4038
4217
  documentation: layerInfoDisplayParts
4039
4218
  };
4040
4219
  }),
4041
- orElse3(() => succeed(quickInfo2))
4220
+ orElse2(() => succeed(quickInfo2))
4042
4221
  );
4043
4222
  }
4044
4223
 
4045
4224
  // src/quickinfo.ts
4046
4225
  function quickInfo(sourceFile, position, quickInfo2) {
4047
- return gen2(function* () {
4226
+ return gen(function* () {
4048
4227
  const deduped = yield* dedupeJsDocs(quickInfo2);
4049
4228
  const withEffectTypeArgs = yield* effectTypeArgs(sourceFile, position, deduped);
4050
4229
  const withLayerInfo = yield* layerInfo(sourceFile, position, withEffectTypeArgs);
@@ -4075,9 +4254,9 @@ var asyncAwaitToGen = createRefactor({
4075
4254
  kind: "refactor.rewrite.effect.asyncAwaitToGen",
4076
4255
  description: "Rewrite to Effect.gen",
4077
4256
  apply: pipe(
4078
- gen2(function* () {
4257
+ gen(function* () {
4079
4258
  const changeTracker = yield* service(ChangeTracker);
4080
- const effectModuleIdentifierName = match2(
4259
+ const effectModuleIdentifierName = match(
4081
4260
  yield* option(
4082
4261
  findImportedModuleIdentifier(
4083
4262
  sourceFile,
@@ -4146,9 +4325,9 @@ var asyncAwaitToGenTryPromise = createRefactor({
4146
4325
  kind: "refactor.rewrite.effect.asyncAwaitToGenTryPromise",
4147
4326
  description: "Rewrite to Effect.gen with failures",
4148
4327
  apply: pipe(
4149
- gen2(function* () {
4328
+ gen(function* () {
4150
4329
  const changeTracker = yield* service(ChangeTracker);
4151
- const effectModuleIdentifierName = match2(
4330
+ const effectModuleIdentifierName = match(
4152
4331
  yield* option(
4153
4332
  findImportedModuleIdentifier(
4154
4333
  sourceFile,
@@ -4253,7 +4432,7 @@ var effectGenToFn = createRefactor({
4253
4432
  }
4254
4433
  const maybePipe = yield* pipe(
4255
4434
  typeParser.pipeCall(parent),
4256
- orElse3((e) => parent.parent ? typeParser.pipeCall(parent.parent) : fail(e)),
4435
+ orElse2((e) => parent.parent ? typeParser.pipeCall(parent.parent) : fail(e)),
4257
4436
  option
4258
4437
  );
4259
4438
  if (isSome2(maybePipe) && maybePipe.value.subject === nodeToReplace2) {
@@ -4277,7 +4456,7 @@ var effectGenToFn = createRefactor({
4277
4456
  kind: "refactor.rewrite.effect.effectGenToFn",
4278
4457
  description: "Convert to Effect.fn",
4279
4458
  apply: pipe(
4280
- gen2(function* () {
4459
+ gen(function* () {
4281
4460
  const changeTracker = yield* service(ChangeTracker);
4282
4461
  const effectFn = nodeToReplace.name && ts.isIdentifier(nodeToReplace.name) ? ts.factory.createCallExpression(
4283
4462
  ts.factory.createPropertyAccessExpression(
@@ -4334,7 +4513,7 @@ var functionToArrow = createRefactor({
4334
4513
  kind: "refactor.rewrite.effect.functionToArrow",
4335
4514
  description: "Convert to arrow",
4336
4515
  apply: pipe(
4337
- gen2(function* () {
4516
+ gen(function* () {
4338
4517
  const changeTracker = yield* service(ChangeTracker);
4339
4518
  const body = node.body;
4340
4519
  let newBody = ts.factory.createBlock(body.statements);
@@ -4497,9 +4676,9 @@ var makeSchemaOpaque = createRefactor({
4497
4676
  kind: "refactor.rewrite.effect.makeSchemaOpaque",
4498
4677
  description: `Make Schema opaque`,
4499
4678
  apply: pipe(
4500
- gen2(function* () {
4679
+ gen(function* () {
4501
4680
  const changeTracker = yield* service(ChangeTracker);
4502
- const effectSchemaName = match2(
4681
+ const effectSchemaName = match(
4503
4682
  yield* option(
4504
4683
  findImportedModuleIdentifierByPackageAndNameOrBarrel(
4505
4684
  sourceFile,
@@ -4575,9 +4754,9 @@ var makeSchemaOpaqueWithNs = createRefactor({
4575
4754
  kind: "refactor.rewrite.effect.makeSchemaOpaqueWithNs",
4576
4755
  description: `Make Schema opaque with namespace`,
4577
4756
  apply: pipe(
4578
- gen2(function* () {
4757
+ gen(function* () {
4579
4758
  const changeTracker = yield* service(ChangeTracker);
4580
- const effectSchemaName = match2(
4759
+ const effectSchemaName = match(
4581
4760
  yield* option(
4582
4761
  findImportedModuleIdentifierByPackageAndNameOrBarrel(
4583
4762
  sourceFile,
@@ -4731,7 +4910,7 @@ var pipeableToDatafirst = createRefactor({
4731
4910
  return {
4732
4911
  kind: "refactor.rewrite.effect.pipeableToDatafirst",
4733
4912
  description: "Rewrite to datafirst",
4734
- apply: gen2(function* () {
4913
+ apply: gen(function* () {
4735
4914
  const changeTracker = yield* service(ChangeTracker);
4736
4915
  changeTracker.replaceNode(sourceFile, node, newNode);
4737
4916
  })
@@ -4752,7 +4931,7 @@ var removeUnnecessaryEffectGen = createRefactor({
4752
4931
  return {
4753
4932
  kind: "refactor.rewrite.effect.removeUnnecessaryEffectGen",
4754
4933
  description: "Remove unnecessary Effect.gen",
4755
- apply: gen2(function* () {
4934
+ apply: gen(function* () {
4756
4935
  const changeTracker = yield* service(ChangeTracker);
4757
4936
  changeTracker.replaceNode(sourceFile, nodeToReplace, yield* replacementNode);
4758
4937
  })
@@ -4782,7 +4961,7 @@ var toggleLazyConst = createRefactor({
4782
4961
  return {
4783
4962
  kind: "refactor.rewrite.effect.toggleLazyConst",
4784
4963
  description: "Toggle lazy const",
4785
- apply: gen2(function* () {
4964
+ apply: gen(function* () {
4786
4965
  const changeTracker = yield* service(ChangeTracker);
4787
4966
  const initializer = node.initializer;
4788
4967
  if (ts.isArrowFunction(initializer) && initializer.parameters.length === 0) {
@@ -4872,7 +5051,7 @@ var toggleTypeAnnotation = createRefactor({
4872
5051
  kind: "refactor.rewrite.effect.toggleTypeAnnotation",
4873
5052
  description: "Toggle type annotation",
4874
5053
  apply: pipe(
4875
- gen2(function* () {
5054
+ gen(function* () {
4876
5055
  const changeTracker = yield* service(ChangeTracker);
4877
5056
  if (node.type) {
4878
5057
  changeTracker.deleteRange(sourceFile, { pos: node.name.end, end: node.type.end });
@@ -4880,19 +5059,19 @@ var toggleTypeAnnotation = createRefactor({
4880
5059
  }
4881
5060
  const initializer = node.initializer;
4882
5061
  const initializerType = typeChecker.getTypeAtLocation(initializer);
4883
- const initializerTypeNode = fromNullable2(typeChecker.typeToTypeNode(
5062
+ const initializerTypeNode = fromNullable(typeChecker.typeToTypeNode(
4884
5063
  initializerType,
4885
5064
  node,
4886
5065
  ts.NodeBuilderFlags.NoTruncation
4887
5066
  )).pipe(
4888
- orElse2(
4889
- () => fromNullable2(typeChecker.typeToTypeNode(
5067
+ orElse(
5068
+ () => fromNullable(typeChecker.typeToTypeNode(
4890
5069
  initializerType,
4891
5070
  void 0,
4892
5071
  ts.NodeBuilderFlags.NoTruncation
4893
5072
  ))
4894
5073
  ),
4895
- getOrUndefined2
5074
+ getOrUndefined
4896
5075
  );
4897
5076
  if (initializerTypeNode) {
4898
5077
  changeTracker.insertNodeAt(
@@ -4954,7 +5133,7 @@ var makeSchemaGenContext = fn("SchemaGen.makeSchemaGenContext")(function* (sourc
4954
5133
  yield* option(
4955
5134
  findImportedModuleIdentifierByPackageAndNameOrBarrel(sourceFile, "effect", "Schema")
4956
5135
  ),
4957
- match2({
5136
+ match({
4958
5137
  onNone: () => "Schema",
4959
5138
  onSome: (_) => _.text
4960
5139
  })
@@ -5037,7 +5216,7 @@ var parseAllLiterals = fn(
5037
5216
  }
5038
5217
  }
5039
5218
  if (ts.isUnionTypeNode(node)) {
5040
- return flatten(yield* all2(...node.types.map((_) => parseAllLiterals(_))));
5219
+ return flatten(yield* all(...node.types.map((_) => parseAllLiterals(_))));
5041
5220
  }
5042
5221
  if (ts.isParenthesizedTypeNode(node)) {
5043
5222
  return yield* parseAllLiterals(node.type);
@@ -5050,7 +5229,7 @@ var createUnsupportedNodeComment = (ts, sourceFile, node) => ts.addSyntheticTrai
5050
5229
  ts.SyntaxKind.MultiLineCommentTrivia,
5051
5230
  " Not supported conversion: " + node.getText(sourceFile) + " "
5052
5231
  );
5053
- var processNode = (node, isVirtualTypeNode) => gen2(function* () {
5232
+ var processNode = (node, isVirtualTypeNode) => gen(function* () {
5054
5233
  const { createApiCall, createApiPropertyAccess, entityNameToDataTypeName, sourceFile, ts } = yield* service(
5055
5234
  SchemaGenContext
5056
5235
  );
@@ -5084,11 +5263,11 @@ var processNode = (node, isVirtualTypeNode) => gen2(function* () {
5084
5263
  if (ts.isUnionTypeNode(node)) {
5085
5264
  const allLiterals = yield* option(parseAllLiterals(node));
5086
5265
  if (isSome2(allLiterals)) return createApiCall("Literal", allLiterals.value);
5087
- const members = yield* all2(...node.types.map((_) => processNode(_, isVirtualTypeNode)));
5266
+ const members = yield* all(...node.types.map((_) => processNode(_, isVirtualTypeNode)));
5088
5267
  return createApiCall("Union", members);
5089
5268
  }
5090
5269
  if (ts.isIntersectionTypeNode(node)) {
5091
- const [firstSchema, ...otherSchemas] = yield* all2(
5270
+ const [firstSchema, ...otherSchemas] = yield* all(
5092
5271
  ...node.types.map((_) => processNode(_, isVirtualTypeNode))
5093
5272
  );
5094
5273
  if (otherSchemas.length === 0) return firstSchema;
@@ -5144,13 +5323,13 @@ var processNode = (node, isVirtualTypeNode) => gen2(function* () {
5144
5323
  case "Option":
5145
5324
  case "Chunk":
5146
5325
  case "Array": {
5147
- const elements = yield* all2(
5326
+ const elements = yield* all(
5148
5327
  ...node.typeArguments ? node.typeArguments.map((_) => processNode(_, isVirtualTypeNode)) : []
5149
5328
  );
5150
5329
  return createApiCall(parsedName.value, elements);
5151
5330
  }
5152
5331
  case "Record": {
5153
- const elements = yield* all2(
5332
+ const elements = yield* all(
5154
5333
  ...node.typeArguments ? node.typeArguments.map((_) => processNode(_, isVirtualTypeNode)) : []
5155
5334
  );
5156
5335
  if (elements.length >= 2) {
@@ -5164,7 +5343,7 @@ var processNode = (node, isVirtualTypeNode) => gen2(function* () {
5164
5343
  return createUnsupportedNodeComment(ts, sourceFile, node);
5165
5344
  }
5166
5345
  case "Either": {
5167
- const elements = yield* all2(
5346
+ const elements = yield* all(
5168
5347
  ...node.typeArguments ? node.typeArguments.map((_) => processNode(_, isVirtualTypeNode)) : []
5169
5348
  );
5170
5349
  if (elements.length >= 2) {
@@ -5363,7 +5542,7 @@ var applyAtNode = fn("SchemaGen.applyAtNode")(
5363
5542
  const changeTracker = yield* service(ChangeTracker);
5364
5543
  const newNode = yield* pipe(
5365
5544
  process(sourceFile, node, preferClass),
5366
- orElse3(
5545
+ orElse2(
5367
5546
  (error) => succeed(ts.addSyntheticLeadingComment(
5368
5547
  ts.factory.createIdentifier(""),
5369
5548
  ts.SyntaxKind.MultiLineCommentTrivia,
@@ -5447,7 +5626,7 @@ var wrapWithEffectGen = createRefactor({
5447
5626
  option
5448
5627
  );
5449
5628
  if (isNone2(maybeNode)) return yield* fail(new RefactorNotApplicableError());
5450
- const effectModuleIdentifier = match2(
5629
+ const effectModuleIdentifier = match(
5451
5630
  yield* option(
5452
5631
  findImportedModuleIdentifier(
5453
5632
  sourceFile,
@@ -5467,7 +5646,7 @@ var wrapWithEffectGen = createRefactor({
5467
5646
  kind: "refactor.rewrite.effect.wrapWithEffectGen",
5468
5647
  description: `Wrap with Effect.gen`,
5469
5648
  apply: pipe(
5470
- gen2(function* () {
5649
+ gen(function* () {
5471
5650
  const changeTracker = yield* service(ChangeTracker);
5472
5651
  const effectGen = yield* pipe(
5473
5652
  createEffectGenCallExpressionWithBlock(
@@ -5495,7 +5674,7 @@ var wrapWithPipe = createRefactor({
5495
5674
  return {
5496
5675
  kind: "refactor.rewrite.effect.wrapWithPipe",
5497
5676
  description: `Wrap with pipe(...)`,
5498
- apply: gen2(function* () {
5677
+ apply: gen(function* () {
5499
5678
  const changeTracker = yield* service(ChangeTracker);
5500
5679
  changeTracker.insertText(sourceFile, textRange.pos, "pipe(");
5501
5680
  changeTracker.insertText(sourceFile, textRange.end, ")");
@@ -5578,11 +5757,11 @@ var init = (modules) => {
5578
5757
  return pipe(
5579
5758
  getSemanticDiagnosticsWithCodeFixes(diagnostics, sourceFile),
5580
5759
  runNano(program),
5581
- Either_exports.map(({ codeFixes, diagnostics: diagnostics2 }) => {
5760
+ map(({ codeFixes, diagnostics: diagnostics2 }) => {
5582
5761
  effectCodeFixesForFile.set(fileName, codeFixes);
5583
5762
  return diagnostics2.concat(applicableDiagnostics);
5584
5763
  }),
5585
- Either_exports.getOrElse(() => applicableDiagnostics)
5764
+ getOrElse(() => applicableDiagnostics)
5586
5765
  );
5587
5766
  }
5588
5767
  }
@@ -5633,8 +5812,8 @@ var init = (modules) => {
5633
5812
  return effectCodeFixes;
5634
5813
  }),
5635
5814
  run,
5636
- Either_exports.map((effectCodeFixes) => applicableCodeFixes.concat(effectCodeFixes)),
5637
- Either_exports.getOrElse(() => applicableCodeFixes)
5815
+ map((effectCodeFixes) => applicableCodeFixes.concat(effectCodeFixes)),
5816
+ getOrElse(() => applicableCodeFixes)
5638
5817
  );
5639
5818
  };
5640
5819
  proxy.getApplicableRefactors = (...args) => {
@@ -5647,8 +5826,8 @@ var init = (modules) => {
5647
5826
  return pipe(
5648
5827
  getApplicableRefactors(refactors, sourceFile, positionOrRange),
5649
5828
  runNano(program),
5650
- Either_exports.map((effectRefactors) => applicableRefactors.concat(effectRefactors)),
5651
- Either_exports.getOrElse(() => applicableRefactors)
5829
+ map((effectRefactors) => applicableRefactors.concat(effectRefactors)),
5830
+ getOrElse(() => applicableRefactors)
5652
5831
  );
5653
5832
  }
5654
5833
  }
@@ -5660,7 +5839,7 @@ var init = (modules) => {
5660
5839
  const sourceFile = program.getSourceFile(fileName);
5661
5840
  if (sourceFile) {
5662
5841
  const result = pipe(
5663
- gen2(function* () {
5842
+ gen(function* () {
5664
5843
  const applicableRefactor = yield* getEditsForRefactor(
5665
5844
  refactors,
5666
5845
  sourceFile,
@@ -5687,7 +5866,7 @@ var init = (modules) => {
5687
5866
  }),
5688
5867
  runNano(program)
5689
5868
  );
5690
- if (Either_exports.isRight(result)) return result.right;
5869
+ if (isRight2(result)) return result.right;
5691
5870
  }
5692
5871
  }
5693
5872
  return languageService.getEditsForRefactor(
@@ -5714,7 +5893,7 @@ var init = (modules) => {
5714
5893
  applicableQuickInfo
5715
5894
  ),
5716
5895
  runNano(program),
5717
- Either_exports.getOrElse(() => applicableQuickInfo)
5896
+ getOrElse(() => applicableQuickInfo)
5718
5897
  );
5719
5898
  }
5720
5899
  }
@@ -5735,32 +5914,70 @@ var init = (modules) => {
5735
5914
  const sourceFile = program.getSourceFile(fileName);
5736
5915
  if (sourceFile) {
5737
5916
  return pipe(
5738
- getCompletionsAtPosition(
5739
- completions,
5740
- sourceFile,
5741
- position,
5742
- options,
5743
- formattingSettings
5917
+ appendEffectCompletionEntryData(sourceFile, applicableCompletions),
5918
+ flatMap2(
5919
+ (augmentedCompletions) => pipe(
5920
+ getCompletionsAtPosition(
5921
+ completions,
5922
+ sourceFile,
5923
+ position,
5924
+ options,
5925
+ formattingSettings
5926
+ ),
5927
+ map4(
5928
+ (effectCompletions) => augmentedCompletions ? {
5929
+ ...augmentedCompletions,
5930
+ entries: effectCompletions.concat(augmentedCompletions.entries)
5931
+ } : effectCompletions.length > 0 ? {
5932
+ entries: effectCompletions,
5933
+ isGlobalCompletion: false,
5934
+ isMemberCompletion: false,
5935
+ isNewIdentifierLocation: false
5936
+ } : void 0
5937
+ )
5938
+ )
5744
5939
  ),
5745
5940
  runNano(program),
5746
- Either_exports.map(
5747
- (effectCompletions) => applicableCompletions ? {
5748
- ...applicableCompletions,
5749
- entries: effectCompletions.concat(applicableCompletions.entries)
5750
- } : effectCompletions.length > 0 ? {
5751
- entries: effectCompletions,
5752
- isGlobalCompletion: false,
5753
- isMemberCompletion: false,
5754
- isNewIdentifierLocation: false
5755
- } : void 0
5756
- ),
5757
- Either_exports.getOrElse(() => applicableCompletions)
5941
+ getOrElse(() => applicableCompletions)
5758
5942
  );
5759
5943
  }
5760
5944
  }
5761
5945
  }
5762
5946
  return applicableCompletions;
5763
5947
  };
5948
+ proxy.getCompletionEntryDetails = (fileName, position, entryName, formatOptions, source, preferences, _data, ...args) => {
5949
+ const applicableCompletionEntryDetails = languageService.getCompletionEntryDetails(
5950
+ fileName,
5951
+ position,
5952
+ entryName,
5953
+ formatOptions,
5954
+ source,
5955
+ preferences,
5956
+ _data,
5957
+ ...args
5958
+ );
5959
+ if (languageServicePluginOptions.completions) {
5960
+ const program = languageService.getProgram();
5961
+ if (program) {
5962
+ const sourceFile = program.getSourceFile(fileName);
5963
+ if (sourceFile) {
5964
+ return pipe(
5965
+ postprocessCompletionEntryDetails(
5966
+ sourceFile,
5967
+ _data,
5968
+ applicableCompletionEntryDetails,
5969
+ formatOptions,
5970
+ preferences,
5971
+ info.languageServiceHost
5972
+ ),
5973
+ runNano(program),
5974
+ getOrElse(() => applicableCompletionEntryDetails)
5975
+ );
5976
+ }
5977
+ }
5978
+ }
5979
+ return applicableCompletionEntryDetails;
5980
+ };
5764
5981
  proxy.getDefinitionAndBoundSpan = (fileName, position, ...args) => {
5765
5982
  const applicableDefinition = languageService.getDefinitionAndBoundSpan(fileName, position, ...args);
5766
5983
  if (languageServicePluginOptions.goto) {
@@ -5771,7 +5988,7 @@ var init = (modules) => {
5771
5988
  return pipe(
5772
5989
  goto(applicableDefinition, sourceFile, position),
5773
5990
  runNano(program),
5774
- Either_exports.getOrElse(() => applicableDefinition)
5991
+ getOrElse(() => applicableDefinition)
5775
5992
  );
5776
5993
  }
5777
5994
  }