@effect/language-service 0.35.0 → 0.35.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/language-service",
3
- "version": "0.35.0",
3
+ "version": "0.35.2",
4
4
  "description": "A Language-Service Plugin to Refactor and Diagnostic effect-ts projects",
5
5
  "main": "index.cjs",
6
6
  "bin": {
package/transform.js CHANGED
@@ -1338,7 +1338,7 @@ function makeTypeScriptUtils(ts) {
1338
1338
  );
1339
1339
  if (fnName) {
1340
1340
  fnCall = ts.factory.createCallExpression(
1341
- fnName,
1341
+ fnCall,
1342
1342
  void 0,
1343
1343
  [ts.factory.createStringLiteral(fnName.text)]
1344
1344
  );
@@ -1586,6 +1586,38 @@ function makeTypeScriptUtils(ts) {
1586
1586
  )
1587
1587
  );
1588
1588
  }
1589
+ function createDataTaggedErrorDeclaration(dataModuleIdentifier, name, fields) {
1590
+ const invokeTaggedError = ts.factory.createCallExpression(
1591
+ ts.factory.createPropertyAccessExpression(
1592
+ ts.factory.createIdentifier(dataModuleIdentifier),
1593
+ "TaggedError"
1594
+ ),
1595
+ void 0,
1596
+ [
1597
+ ts.factory.createStringLiteral(name)
1598
+ ]
1599
+ );
1600
+ const withTypeFields = ts.factory.createExpressionWithTypeArguments(
1601
+ invokeTaggedError,
1602
+ [
1603
+ ts.factory.createTypeLiteralNode(fields)
1604
+ ]
1605
+ );
1606
+ return ts.factory.createClassDeclaration(
1607
+ [ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)],
1608
+ name,
1609
+ void 0,
1610
+ [
1611
+ ts.factory.createHeritageClause(
1612
+ ts.SyntaxKind.ExtendsKeyword,
1613
+ [
1614
+ withTypeFields
1615
+ ]
1616
+ )
1617
+ ],
1618
+ []
1619
+ );
1620
+ }
1589
1621
  return {
1590
1622
  findNodeAtPositionIncludingTrivia,
1591
1623
  parsePackageContentNameAndVersionFromScope,
@@ -1597,6 +1629,7 @@ function makeTypeScriptUtils(ts) {
1597
1629
  isNodeInRange,
1598
1630
  transformAsyncAwaitToEffectFn,
1599
1631
  transformAsyncAwaitToEffectGen,
1632
+ createDataTaggedErrorDeclaration,
1600
1633
  findImportedModuleIdentifierByPackageAndNameOrBarrel,
1601
1634
  simplifyTypeNode,
1602
1635
  tryPreserveDeclarationSemantics,