@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/index.js
CHANGED
|
@@ -1936,9 +1936,9 @@ var expectedAndRealType = fn("TypeCheckerApi.expectedAndRealType")(function* (so
|
|
|
1936
1936
|
realType
|
|
1937
1937
|
]);
|
|
1938
1938
|
});
|
|
1939
|
-
ts.forEachChild(node, appendNodeToVisit);
|
|
1940
|
-
continue;
|
|
1941
1939
|
}
|
|
1940
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1941
|
+
continue;
|
|
1942
1942
|
} else if (ts.isIdentifier(node) || ts.isStringLiteral(node) || ts.isNumericLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) {
|
|
1943
1943
|
const parent = node.parent;
|
|
1944
1944
|
if (ts.isObjectLiteralElement(parent)) {
|
|
@@ -1950,12 +1950,12 @@ var expectedAndRealType = fn("TypeCheckerApi.expectedAndRealType")(function* (so
|
|
|
1950
1950
|
const expectedType = typeChecker.getTypeOfSymbolAtLocation(symbol3, node);
|
|
1951
1951
|
const realType = typeChecker.getTypeAtLocation(node);
|
|
1952
1952
|
result.push([node, expectedType, node, realType]);
|
|
1953
|
-
ts.forEachChild(node, appendNodeToVisit);
|
|
1954
|
-
continue;
|
|
1955
1953
|
}
|
|
1956
1954
|
}
|
|
1957
1955
|
}
|
|
1958
1956
|
}
|
|
1957
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1958
|
+
continue;
|
|
1959
1959
|
} else if (ts.isBinaryExpression(node) && node.operatorToken.kind === ts.SyntaxKind.EqualsToken) {
|
|
1960
1960
|
const expectedType = typeChecker.getTypeAtLocation(node.left);
|
|
1961
1961
|
const realType = typeChecker.getTypeAtLocation(node.right);
|
|
@@ -1969,19 +1969,28 @@ var expectedAndRealType = fn("TypeCheckerApi.expectedAndRealType")(function* (so
|
|
|
1969
1969
|
const realType = typeChecker.getTypeAtLocation(node.expression);
|
|
1970
1970
|
if (isSome2(expectedType)) {
|
|
1971
1971
|
result.push([node, expectedType.value, node, realType]);
|
|
1972
|
-
ts.forEachChild(node, appendNodeToVisit);
|
|
1973
|
-
continue;
|
|
1974
1972
|
}
|
|
1975
1973
|
}
|
|
1976
|
-
|
|
1974
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1975
|
+
continue;
|
|
1976
|
+
} else if (ts.isArrowFunction(node) && (node.typeParameters || []).length === 0 && ts.isExpression(node.body)) {
|
|
1977
1977
|
const body = node.body;
|
|
1978
1978
|
const expectedType = typeChecker.getContextualType(body);
|
|
1979
1979
|
const realType = typeChecker.getTypeAtLocation(body);
|
|
1980
1980
|
if (expectedType) {
|
|
1981
1981
|
result.push([body, expectedType, body, realType]);
|
|
1982
|
-
appendNodeToVisit(body);
|
|
1983
|
-
continue;
|
|
1984
1982
|
}
|
|
1983
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1984
|
+
continue;
|
|
1985
|
+
} else if (ts.isArrowFunction(node) && (node.typeParameters || []).length > 0 && ts.isExpression(node.body)) {
|
|
1986
|
+
const body = node.body;
|
|
1987
|
+
const expectedType = yield* option(getInferredReturnType(node));
|
|
1988
|
+
const realType = typeChecker.getTypeAtLocation(body);
|
|
1989
|
+
if (isSome2(expectedType)) {
|
|
1990
|
+
result.push([body, expectedType.value, body, realType]);
|
|
1991
|
+
}
|
|
1992
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
1993
|
+
continue;
|
|
1985
1994
|
} else if (ts.isSatisfiesExpression(node)) {
|
|
1986
1995
|
const expectedType = typeChecker.getTypeAtLocation(node.type);
|
|
1987
1996
|
const realType = typeChecker.getTypeAtLocation(node.expression);
|