@effect/language-service 0.66.1 → 0.67.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.
@@ -4997,9 +4997,20 @@ var effectFnOpportunity = createDiagnostic({
4997
4997
  if (!traceName) return yield* TypeParserIssue.issue;
4998
4998
  const opportunity = yield* pipe(
4999
4999
  tryParseGenOpportunity(node),
5000
- orElse2(
5001
- () => succeed({ effectModuleName: sourceEffectModuleName, pipeArguments: [], generatorFunction: void 0 })
5002
- )
5000
+ orElse2(() => {
5001
+ if (ts.isArrowFunction(node) && !ts.isBlock(node.body)) {
5002
+ return TypeParserIssue.issue;
5003
+ }
5004
+ const body = ts.isArrowFunction(node) ? node.body : node.body;
5005
+ if (!body || !ts.isBlock(body) || body.statements.length <= 5) {
5006
+ return TypeParserIssue.issue;
5007
+ }
5008
+ return succeed({
5009
+ effectModuleName: sourceEffectModuleName,
5010
+ pipeArguments: [],
5011
+ generatorFunction: void 0
5012
+ });
5013
+ })
5003
5014
  );
5004
5015
  return {
5005
5016
  node,