@effect/language-service 0.16.3 → 0.16.4
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 +18 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +18 -9
- package/transform.js.map +1 -1
package/package.json
CHANGED
package/transform.js
CHANGED
|
@@ -1211,9 +1211,9 @@ var expectedAndRealType = fn("TypeCheckerApi.expectedAndRealType")(function* (so
|
|
|
1211
1211
|
realType
|
|
1212
1212
|
]);
|
|
1213
1213
|
});
|
|
1214
|
-
ts.forEachChild(node, appendNodeToVisit);
|
|
1215
|
-
continue;
|
|
1216
1214
|
}
|
|
1215
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1216
|
+
continue;
|
|
1217
1217
|
} else if (ts.isIdentifier(node) || ts.isStringLiteral(node) || ts.isNumericLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) {
|
|
1218
1218
|
const parent = node.parent;
|
|
1219
1219
|
if (ts.isObjectLiteralElement(parent)) {
|
|
@@ -1225,12 +1225,12 @@ var expectedAndRealType = fn("TypeCheckerApi.expectedAndRealType")(function* (so
|
|
|
1225
1225
|
const expectedType = typeChecker.getTypeOfSymbolAtLocation(symbol3, node);
|
|
1226
1226
|
const realType = typeChecker.getTypeAtLocation(node);
|
|
1227
1227
|
result.push([node, expectedType, node, realType]);
|
|
1228
|
-
ts.forEachChild(node, appendNodeToVisit);
|
|
1229
|
-
continue;
|
|
1230
1228
|
}
|
|
1231
1229
|
}
|
|
1232
1230
|
}
|
|
1233
1231
|
}
|
|
1232
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1233
|
+
continue;
|
|
1234
1234
|
} else if (ts.isBinaryExpression(node) && node.operatorToken.kind === ts.SyntaxKind.EqualsToken) {
|
|
1235
1235
|
const expectedType = typeChecker.getTypeAtLocation(node.left);
|
|
1236
1236
|
const realType = typeChecker.getTypeAtLocation(node.right);
|
|
@@ -1244,19 +1244,28 @@ var expectedAndRealType = fn("TypeCheckerApi.expectedAndRealType")(function* (so
|
|
|
1244
1244
|
const realType = typeChecker.getTypeAtLocation(node.expression);
|
|
1245
1245
|
if (isSome2(expectedType)) {
|
|
1246
1246
|
result.push([node, expectedType.value, node, realType]);
|
|
1247
|
-
ts.forEachChild(node, appendNodeToVisit);
|
|
1248
|
-
continue;
|
|
1249
1247
|
}
|
|
1250
1248
|
}
|
|
1251
|
-
|
|
1249
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1250
|
+
continue;
|
|
1251
|
+
} else if (ts.isArrowFunction(node) && (node.typeParameters || []).length === 0 && ts.isExpression(node.body)) {
|
|
1252
1252
|
const body = node.body;
|
|
1253
1253
|
const expectedType = typeChecker.getContextualType(body);
|
|
1254
1254
|
const realType = typeChecker.getTypeAtLocation(body);
|
|
1255
1255
|
if (expectedType) {
|
|
1256
1256
|
result.push([body, expectedType, body, realType]);
|
|
1257
|
-
appendNodeToVisit(body);
|
|
1258
|
-
continue;
|
|
1259
1257
|
}
|
|
1258
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1259
|
+
continue;
|
|
1260
|
+
} else if (ts.isArrowFunction(node) && (node.typeParameters || []).length > 0 && ts.isExpression(node.body)) {
|
|
1261
|
+
const body = node.body;
|
|
1262
|
+
const expectedType = yield* option(getInferredReturnType(node));
|
|
1263
|
+
const realType = typeChecker.getTypeAtLocation(body);
|
|
1264
|
+
if (isSome2(expectedType)) {
|
|
1265
|
+
result.push([body, expectedType.value, body, realType]);
|
|
1266
|
+
}
|
|
1267
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1268
|
+
continue;
|
|
1260
1269
|
} else if (ts.isSatisfiesExpression(node)) {
|
|
1261
1270
|
const expectedType = typeChecker.getTypeAtLocation(node.type);
|
|
1262
1271
|
const realType = typeChecker.getTypeAtLocation(node.expression);
|