@effect/language-service 0.60.0 → 0.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,6 +100,7 @@ And you're done! You'll now be able to use a set of refactors and diagnostics th
100
100
  - Wrap an `Effect` expression with `Effect.gen`
101
101
  - Toggle between pipe styles `X.pipe(Y)` and `pipe(X, Y)`
102
102
  - Layer Magic: Automatically compose and build layers based on service dependencies
103
+ - Structural Type to Schema: Convert TypeScript interfaces and type aliases to Effect Schema classes, with automatic detection and reuse of existing schemas
103
104
 
104
105
  ### Codegens
105
106
 
package/cli.js CHANGED
@@ -31627,7 +31627,11 @@ var getEditsForCodegen = fn2("LSP.getEditsForCodegen")(function* (codegens2, sou
31627
31627
  service2(ChangeTracker),
31628
31628
  map34((changeTracker) => {
31629
31629
  changeTracker.deleteRange(sourceFile, range3);
31630
- changeTracker.insertText(sourceFile, range3.pos, `${codegen2.name}:${edit.hash}`);
31630
+ changeTracker.insertText(
31631
+ sourceFile,
31632
+ range3.pos,
31633
+ edit.hash.length > 0 ? `${codegen2.name}:${edit.hash}` : codegen2.name
31634
+ );
31631
31635
  })
31632
31636
  );
31633
31637
  return {
@@ -33554,11 +33558,15 @@ var verbose = boolean5("verbose").pipe(
33554
33558
  withDefault3(false),
33555
33559
  withDescription3("Verbose output.")
33556
33560
  );
33561
+ var force = boolean5("force").pipe(
33562
+ withDefault3(false),
33563
+ withDescription3("Force codegen even if no changes are needed.")
33564
+ );
33557
33565
  var BATCH_SIZE = 50;
33558
33566
  var codegen = make58(
33559
33567
  "codegen",
33560
- { file: file4, project: project2, verbose },
33561
- fn("codegen")(function* ({ file: file5, project: project3, verbose: verbose2 }) {
33568
+ { file: file4, project: project2, verbose, force },
33569
+ fn("codegen")(function* ({ file: file5, force: force3, project: project3, verbose: verbose2 }) {
33562
33570
  const path2 = yield* Path2;
33563
33571
  const fs = yield* FileSystem;
33564
33572
  const tsInstance = yield* getTypeScript;
@@ -33622,7 +33630,7 @@ var codegen = make58(
33622
33630
  getEditsForCodegen([codegen2], sourceFile, range3),
33623
33631
  orElse14(() => void_8)
33624
33632
  );
33625
- if (applicable && applicable.hash !== hash2) {
33633
+ if (applicable && (applicable.hash !== hash2 || force3)) {
33626
33634
  const changes2 = tsInstance.textChanges.ChangeTracker.with(
33627
33635
  {
33628
33636
  formatContext,
@@ -36796,7 +36804,7 @@ var moduleNames = choice3("module", [
36796
36804
  repeated4,
36797
36805
  withDescription3("The name of the module to patch.")
36798
36806
  );
36799
- var force = boolean5("force").pipe(
36807
+ var force2 = boolean5("force").pipe(
36800
36808
  withDefault3(false),
36801
36809
  withDescription3("Force patch even if already patched.")
36802
36810
  );
@@ -36998,8 +37006,8 @@ var printRememberPrepareScript = fn("printRememberPrepareScript")(function* () {
36998
37006
  }, ignore2);
36999
37007
  var patch9 = make58(
37000
37008
  "patch",
37001
- { dirPath: dirPath2, moduleNames, force },
37002
- fn("patch")(function* ({ dirPath: dirPath4, force: force2, moduleNames: moduleNames3 }) {
37009
+ { dirPath: dirPath2, moduleNames, force: force2 },
37010
+ fn("patch")(function* ({ dirPath: dirPath4, force: force3, moduleNames: moduleNames3 }) {
37003
37011
  const fs = yield* FileSystem;
37004
37012
  const { version: effectLspVersion } = yield* getPackageJsonData(__dirname);
37005
37013
  yield* logDebug2(`Searching for typescript in ${dirPath4}...`);
@@ -37014,7 +37022,7 @@ var patch9 = make58(
37014
37022
  yield* logDebug2(
37015
37023
  `Checking if ${filePath} is already patched with marker ${getPatchedMarker(effectLspVersion)}...`
37016
37024
  );
37017
- if (!force2 && sourceText.indexOf(getPatchedMarker(effectLspVersion)) !== -1) {
37025
+ if (!force3 && sourceText.indexOf(getPatchedMarker(effectLspVersion)) !== -1) {
37018
37026
  yield* logInfo2(`${filePath} is already patched with version ${effectLspVersion}, skipped.`);
37019
37027
  continue;
37020
37028
  }