@effect/language-service 0.0.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.
Files changed (116) hide show
  1. package/README.md +59 -0
  2. package/_mjs/ast.mjs +80 -0
  3. package/_mjs/ast.mjs.map +1 -0
  4. package/_mjs/config.mjs +24 -0
  5. package/_mjs/config.mjs.map +1 -0
  6. package/_mjs/diagnostics/definition.mjs +4 -0
  7. package/_mjs/diagnostics/definition.mjs.map +1 -0
  8. package/_mjs/diagnostics/ensureGetCallTrace.mjs +49 -0
  9. package/_mjs/diagnostics/ensureGetCallTrace.mjs.map +1 -0
  10. package/_mjs/diagnostics/index.mjs +9 -0
  11. package/_mjs/diagnostics/index.mjs.map +1 -0
  12. package/_mjs/diagnostics/noSyncWithConstant.mjs +36 -0
  13. package/_mjs/diagnostics/noSyncWithConstant.mjs.map +1 -0
  14. package/_mjs/diagnostics/removeCurryArrow.mjs +18 -0
  15. package/_mjs/diagnostics/removeCurryArrow.mjs.map +1 -0
  16. package/_mjs/index.mjs +111 -0
  17. package/_mjs/index.mjs.map +1 -0
  18. package/_mjs/refactors/addPipe.mjs +24 -0
  19. package/_mjs/refactors/addPipe.mjs.map +1 -0
  20. package/_mjs/refactors/asyncAwaitToGen.mjs +25 -0
  21. package/_mjs/refactors/asyncAwaitToGen.mjs.map +1 -0
  22. package/_mjs/refactors/asyncAwaitToGenTryPromise.mjs +30 -0
  23. package/_mjs/refactors/asyncAwaitToGenTryPromise.mjs.map +1 -0
  24. package/_mjs/refactors/definition.mjs +4 -0
  25. package/_mjs/refactors/definition.mjs.map +1 -0
  26. package/_mjs/refactors/functionToArrow.mjs +43 -0
  27. package/_mjs/refactors/functionToArrow.mjs.map +1 -0
  28. package/_mjs/refactors/index.mjs +19 -0
  29. package/_mjs/refactors/index.mjs.map +1 -0
  30. package/_mjs/refactors/removeCurryArrow.mjs +24 -0
  31. package/_mjs/refactors/removeCurryArrow.mjs.map +1 -0
  32. package/_mjs/refactors/removePipe.mjs +23 -0
  33. package/_mjs/refactors/removePipe.mjs.map +1 -0
  34. package/_mjs/refactors/toggleReturnTypeAnnotation.mjs +44 -0
  35. package/_mjs/refactors/toggleReturnTypeAnnotation.mjs.map +1 -0
  36. package/_mjs/refactors/toggleTypeAnnotation.mjs +37 -0
  37. package/_mjs/refactors/toggleTypeAnnotation.mjs.map +1 -0
  38. package/_mjs/utils.mjs +146 -0
  39. package/_mjs/utils.mjs.map +1 -0
  40. package/ast.d.ts +116 -0
  41. package/ast.d.ts.map +1 -0
  42. package/ast.js +100 -0
  43. package/ast.js.map +1 -0
  44. package/config.d.ts +10 -0
  45. package/config.d.ts.map +1 -0
  46. package/config.js +31 -0
  47. package/config.js.map +1 -0
  48. package/diagnostics/definition.d.ts +15 -0
  49. package/diagnostics/definition.d.ts.map +1 -0
  50. package/diagnostics/definition.js +10 -0
  51. package/diagnostics/definition.js.map +1 -0
  52. package/diagnostics/ensureGetCallTrace.d.ts +3 -0
  53. package/diagnostics/ensureGetCallTrace.d.ts.map +1 -0
  54. package/diagnostics/ensureGetCallTrace.js +58 -0
  55. package/diagnostics/ensureGetCallTrace.js.map +1 -0
  56. package/diagnostics/index.d.ts +7 -0
  57. package/diagnostics/index.d.ts.map +1 -0
  58. package/diagnostics/index.js +17 -0
  59. package/diagnostics/index.js.map +1 -0
  60. package/diagnostics/noSyncWithConstant.d.ts +3 -0
  61. package/diagnostics/noSyncWithConstant.d.ts.map +1 -0
  62. package/diagnostics/noSyncWithConstant.js +45 -0
  63. package/diagnostics/noSyncWithConstant.js.map +1 -0
  64. package/diagnostics/removeCurryArrow.d.ts +3 -0
  65. package/diagnostics/removeCurryArrow.d.ts.map +1 -0
  66. package/diagnostics/removeCurryArrow.js +27 -0
  67. package/diagnostics/removeCurryArrow.js.map +1 -0
  68. package/index.d.ts +2 -0
  69. package/index.d.ts.map +1 -0
  70. package/index.js +116 -0
  71. package/index.js.map +1 -0
  72. package/package.json +43 -0
  73. package/refactors/addPipe.d.ts +3 -0
  74. package/refactors/addPipe.d.ts.map +1 -0
  75. package/refactors/addPipe.js +33 -0
  76. package/refactors/addPipe.js.map +1 -0
  77. package/refactors/asyncAwaitToGen.d.ts +3 -0
  78. package/refactors/asyncAwaitToGen.d.ts.map +1 -0
  79. package/refactors/asyncAwaitToGen.js +34 -0
  80. package/refactors/asyncAwaitToGen.js.map +1 -0
  81. package/refactors/asyncAwaitToGenTryPromise.d.ts +3 -0
  82. package/refactors/asyncAwaitToGenTryPromise.d.ts.map +1 -0
  83. package/refactors/asyncAwaitToGenTryPromise.js +39 -0
  84. package/refactors/asyncAwaitToGenTryPromise.js.map +1 -0
  85. package/refactors/definition.d.ts +13 -0
  86. package/refactors/definition.d.ts.map +1 -0
  87. package/refactors/definition.js +10 -0
  88. package/refactors/definition.js.map +1 -0
  89. package/refactors/functionToArrow.d.ts +3 -0
  90. package/refactors/functionToArrow.d.ts.map +1 -0
  91. package/refactors/functionToArrow.js +52 -0
  92. package/refactors/functionToArrow.js.map +1 -0
  93. package/refactors/index.d.ts +12 -0
  94. package/refactors/index.d.ts.map +1 -0
  95. package/refactors/index.js +27 -0
  96. package/refactors/index.js.map +1 -0
  97. package/refactors/removeCurryArrow.d.ts +3 -0
  98. package/refactors/removeCurryArrow.d.ts.map +1 -0
  99. package/refactors/removeCurryArrow.js +33 -0
  100. package/refactors/removeCurryArrow.js.map +1 -0
  101. package/refactors/removePipe.d.ts +3 -0
  102. package/refactors/removePipe.d.ts.map +1 -0
  103. package/refactors/removePipe.js +32 -0
  104. package/refactors/removePipe.js.map +1 -0
  105. package/refactors/toggleReturnTypeAnnotation.d.ts +3 -0
  106. package/refactors/toggleReturnTypeAnnotation.d.ts.map +1 -0
  107. package/refactors/toggleReturnTypeAnnotation.js +53 -0
  108. package/refactors/toggleReturnTypeAnnotation.js.map +1 -0
  109. package/refactors/toggleTypeAnnotation.d.ts +3 -0
  110. package/refactors/toggleTypeAnnotation.d.ts.map +1 -0
  111. package/refactors/toggleTypeAnnotation.js +46 -0
  112. package/refactors/toggleTypeAnnotation.js.map +1 -0
  113. package/utils.d.ts +15 -0
  114. package/utils.d.ts.map +1 -0
  115. package/utils.js +163 -0
  116. package/utils.js.map +1 -0
package/utils.js ADDED
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.addReturnTypeAnnotation = addReturnTypeAnnotation;
7
+ exports.asPipeArguments = asPipeArguments;
8
+ exports.asPipeableCallExpression = asPipeableCallExpression;
9
+ exports.findModuleImportIdentifierName = findModuleImportIdentifierName;
10
+ exports.isCombinatorCall = isCombinatorCall;
11
+ exports.isCurryArrow = isCurryArrow;
12
+ exports.isLiteralConstantValue = isLiteralConstantValue;
13
+ exports.isPipeCall = isPipeCall;
14
+ exports.isPipeableCallExpression = isPipeableCallExpression;
15
+ exports.transformAsyncAwaitToEffectGen = transformAsyncAwaitToEffectGen;
16
+ var T = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/io/Effect"));
17
+ var AST = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/language-service/ast"));
18
+ var Ch = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@tsplus/stdlib/collections/Chunk"));
19
+ var _Function = /*#__PURE__*/require("@tsplus/stdlib/data/Function");
20
+ var O = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@tsplus/stdlib/data/Maybe"));
21
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+ function isPipeCall(ts) {
24
+ return node => {
25
+ if (!ts.isCallExpression(node)) return false;
26
+ const expression = node.expression;
27
+ if (!ts.isIdentifier(expression)) return false;
28
+ if (expression.getText(node.getSourceFile()) !== "pipe") return false;
29
+ return true;
30
+ };
31
+ }
32
+ function asPipeableCallExpression(ts) {
33
+ return node => {
34
+ // ensure the node is a call expression
35
+ if (!ts.isCallExpression(node)) return O.none;
36
+ // with just 1 arg
37
+ if (node.arguments.length !== 1) return O.none;
38
+ const arg = node.arguments[0];
39
+ // ideally T.map(n => n * 2) could be piped to pipe(n => n * 2, T.map)
40
+ // but does not make any sense.
41
+ if (ts.isArrowFunction(arg)) return O.none;
42
+ // same goes for identifiers, string literal or numbers
43
+ if (ts.isStringLiteral(arg) || ts.isNumericLiteral(arg) || ts.isIdentifier(arg)) return O.none;
44
+ return O.some([node.expression, arg]);
45
+ };
46
+ }
47
+ function asPipeArguments(ts) {
48
+ return initialNode => {
49
+ let result = Ch.empty();
50
+ let currentNode = O.some(initialNode);
51
+ while (O.isSome(currentNode)) {
52
+ const node = currentNode.value;
53
+ const maybePipeable = asPipeableCallExpression(ts)(node);
54
+ if (O.isNone(maybePipeable)) {
55
+ result = (0, _Function.pipe)(result, Ch.append(node));
56
+ break;
57
+ }
58
+ const [exp, arg] = maybePipeable.value;
59
+ result = (0, _Function.pipe)(result, Ch.append(exp));
60
+ currentNode = O.some(arg);
61
+ }
62
+ return Ch.reverse(result);
63
+ };
64
+ }
65
+ function isPipeableCallExpression(ts) {
66
+ return node => O.isSome(asPipeableCallExpression(ts)(node));
67
+ }
68
+ function isCombinatorCall(ts) {
69
+ return (moduleIdentifier, moduleMethodName) => node => {
70
+ if (!ts.isCallExpression(node)) return false;
71
+ const left = node.expression;
72
+ if (!ts.isPropertyAccessExpression(left)) return false;
73
+ const leftModule = left.expression;
74
+ const leftName = left.name;
75
+ if (!ts.isIdentifier(leftModule)) return false;
76
+ if (leftModule.text !== moduleIdentifier) return false;
77
+ if (!ts.isIdentifier(leftName)) return false;
78
+ if (leftName.text !== moduleMethodName) return false;
79
+ return true;
80
+ };
81
+ }
82
+ function findModuleImportIdentifierName(ts) {
83
+ return (sourceFile, moduleName) => {
84
+ return O.fromNullable(ts.forEachChild(sourceFile, node => {
85
+ if (!ts.isImportDeclaration(node)) return;
86
+ const moduleSpecifier = node.moduleSpecifier;
87
+ if (!ts.isStringLiteral(moduleSpecifier)) return;
88
+ if (moduleSpecifier.text !== moduleName) return;
89
+ const importClause = node.importClause;
90
+ if (!importClause) return;
91
+ const namedBindings = importClause.namedBindings;
92
+ if (!namedBindings) return;
93
+ if (!ts.isNamespaceImport(namedBindings)) return;
94
+ return namedBindings.name.text;
95
+ }));
96
+ };
97
+ }
98
+ function isCurryArrow(ts) {
99
+ return arrow => {
100
+ if (!ts.isArrowFunction(arrow)) return false;
101
+ if (arrow.parameters.length !== 1) return false;
102
+ const parameter = arrow.parameters[0];
103
+ const parameterName = parameter.name;
104
+ if (!ts.isIdentifier(parameterName)) return false;
105
+ const body = arrow.body;
106
+ if (!ts.isCallExpression(body)) return false;
107
+ const args = body.arguments;
108
+ if (args.length !== 1) return false;
109
+ const identifier = args[0];
110
+ if (!ts.isIdentifier(identifier)) return false;
111
+ return identifier.text === parameterName.text;
112
+ };
113
+ }
114
+ function isLiteralConstantValue(ts) {
115
+ return node => {
116
+ return ts.isIdentifier(node) || ts.isStringLiteral(node) || ts.isNumericLiteral(node) || node.kind === ts.SyntaxKind.TrueKeyword || node.kind === ts.SyntaxKind.FalseKeyword || node.kind === ts.SyntaxKind.NullKeyword;
117
+ };
118
+ }
119
+ function transformAsyncAwaitToEffectGen(node, effectName, onAwait) {
120
+ return T.gen(function* ($) {
121
+ const ts = yield* $(T.service(AST.TypeScriptApi));
122
+ function visitor(_) {
123
+ if (ts.isAwaitExpression(_)) {
124
+ const expression = ts.visitEachChild(_.expression, visitor, ts.nullTransformationContext);
125
+ return ts.factory.createYieldExpression(ts.factory.createToken(ts.SyntaxKind.AsteriskToken), ts.factory.createCallExpression(ts.factory.createIdentifier("$"), undefined, [onAwait(expression)]));
126
+ }
127
+ return ts.visitEachChild(_, visitor, ts.nullTransformationContext);
128
+ }
129
+ const generatorBody = visitor(node.body);
130
+ const generator = ts.factory.createFunctionExpression([], ts.factory.createToken(ts.SyntaxKind.AsteriskToken), undefined, [], [ts.factory.createParameterDeclaration(undefined, undefined, "$")], undefined, generatorBody // NOTE(mattia): intended, to use same routine for both ConciseBody and Body
131
+ );
132
+
133
+ const effectGenCallExp = ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(effectName), "gen"), undefined, [generator]);
134
+ let currentFlags = ts.getCombinedModifierFlags(node);
135
+ currentFlags &= ~ts.ModifierFlags.Async;
136
+ const newModifiers = ts.factory.createModifiersFromModifierFlags(currentFlags);
137
+ if (ts.isArrowFunction(node)) {
138
+ return ts.factory.createArrowFunction(newModifiers, node.typeParameters, node.parameters, undefined, node.equalsGreaterThanToken, effectGenCallExp);
139
+ }
140
+ const newBody = ts.factory.createBlock([ts.factory.createReturnStatement(effectGenCallExp)]);
141
+ if (ts.isFunctionDeclaration(node)) {
142
+ return ts.factory.createFunctionDeclaration(newModifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, undefined, newBody);
143
+ }
144
+ return ts.factory.createFunctionExpression(newModifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, undefined, newBody);
145
+ });
146
+ }
147
+ function addReturnTypeAnnotation(ts, changes) {
148
+ return (sourceFile, declaration, typeNode) => {
149
+ const closeParen = ts.findChildOfKind(declaration, ts.SyntaxKind.CloseParenToken, sourceFile);
150
+ const needParens = ts.isArrowFunction(declaration) && closeParen === undefined;
151
+ const endNode = needParens ? declaration.parameters[0] : closeParen;
152
+ if (endNode) {
153
+ if (needParens) {
154
+ changes.insertNodeBefore(sourceFile, endNode, ts.factory.createToken(ts.SyntaxKind.OpenParenToken));
155
+ changes.insertNodeAfter(sourceFile, endNode, ts.factory.createToken(ts.SyntaxKind.CloseParenToken));
156
+ }
157
+ changes.insertNodeAt(sourceFile, endNode.end, typeNode, {
158
+ prefix: ": "
159
+ });
160
+ }
161
+ };
162
+ }
163
+ //# sourceMappingURL=utils.js.map
package/utils.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAA8C;AAAA;AAGxC,SAAUA,UAAU,CAACC,EAAqB;EAC9C,OAAQC,IAAa,IAA+B;IAClD,IAAI,CAACD,EAAE,CAACE,gBAAgB,CAACD,IAAI,CAAC,EAAE,OAAO,KAAK;IAC5C,MAAME,UAAU,GAAGF,IAAI,CAACE,UAAU;IAClC,IAAI,CAACH,EAAE,CAACI,YAAY,CAACD,UAAU,CAAC,EAAE,OAAO,KAAK;IAC9C,IAAIA,UAAU,CAACE,OAAO,CAACJ,IAAI,CAACK,aAAa,EAAE,CAAC,KAAK,MAAM,EAAE,OAAO,KAAK;IACrE,OAAO,IAAI;EACb,CAAC;AACH;AAEM,SAAUC,wBAAwB,CAACP,EAAqB;EAC5D,OAAQC,IAAa,IAAI;IACvB;IACA,IAAI,CAACD,EAAE,CAACE,gBAAgB,CAACD,IAAI,CAAC,EAAE,OAAOO,CAAC,CAACC,IAAI;IAC7C;IACA,IAAIR,IAAI,CAACS,SAAS,CAACC,MAAM,KAAK,CAAC,EAAE,OAAOH,CAAC,CAACC,IAAI;IAC9C,MAAMG,GAAG,GAAGX,IAAI,CAACS,SAAS,CAAC,CAAC,CAAE;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AY,CAAC7E,UAAU,EAAEyE,OAAO,CAACK,GAAG,EAAEV,QAAQ,EAAE;QAAEW,MAAM,EAAE;MAAI,CAAE,CAAC;;EAE7E,CAAC;AACH","names":["isPipeCall","ts","node","isCallExpression","expression","isIdentifier","getText","getSourceFile","asPipeableCallExpression","O","none","arguments","length","arg","isArrowFunction","isStringLiteral","isNumericLiteral","some","asPipeArguments","initialNode","result","Ch","empty","currentNode","isSome","value","maybePipeable","isNone","append","exp","reverse","isPipeableCallExpression","isCombinatorCall","moduleIdentifier","moduleMethodName","left","isPropertyAccessExpression","leftModule","leftName","name","text","findModuleImportIdentifierName","sourceFile","moduleName","fromNullable","forEachChild","isImportDeclaration","moduleSpecifier","importClause","namedBindings","isNamespaceImport","isCurryArrow","arrow","parameters","parameter","parameterName","body","args","identifier","isLiteralConstantValue","kind","SyntaxKind","TrueKeyword","FalseKeyword","NullKeyword","transformAsyncAwaitToEffectGen","effectName","onAwait","T","gen","$","service","AST","TypeScriptApi","visitor","_","isAwaitExpression","visitEachChild","nullTransformationContext","factory","createYieldExpression","createToken","AsteriskToken","createCallExpression","createIdentifier","undefined","generatorBody","generator","createFunctionExpression","createParameterDeclaration","effectGenCallExp","createPropertyAccessExpression","currentFlags","getCombinedModifierFlags","ModifierFlags","Async","newModifiers","createModifiersFromModifierFlags","createArrowFunction","typeParameters","equalsGreaterThanToken","newBody","createBlock","createReturnStatement","isFunctionDeclaration","createFunctionDeclaration","asteriskToken","addReturnTypeAnnotation","changes","declaration","typeNode","closeParen","findChildOfKind","CloseParenToken","needParens","endNode","insertNodeBefore","OpenParenToken","insertNodeAfter","insertNodeAt","end","prefix"],"sourceRoot":"","sources":["../../src/utils.ts"],"sourcesContent":[null]}