@effect/language-service 0.55.0 → 0.55.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/cli.js +17 -6
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +17 -6
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +17 -6
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +17 -6
- package/transform.js.map +1 -1
package/index.js
CHANGED
|
@@ -7168,13 +7168,24 @@ var missedPipeableOpportunity = createDiagnostic({
|
|
|
7168
7168
|
const callChainNodes = /* @__PURE__ */ new WeakMap();
|
|
7169
7169
|
while (nodeToVisit.length > 0) {
|
|
7170
7170
|
const node = nodeToVisit.shift();
|
|
7171
|
-
if (ts.isCallExpression(node) && node.arguments.length === 1
|
|
7172
|
-
const
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7171
|
+
if (ts.isCallExpression(node) && node.arguments.length === 1) {
|
|
7172
|
+
const isPipeCall = yield* pipe(typeParser.pipeCall(node), orElse2(() => void_));
|
|
7173
|
+
if (!isPipeCall) {
|
|
7174
|
+
const resolvedSignature = typeChecker.getResolvedSignature(node);
|
|
7175
|
+
if (resolvedSignature) {
|
|
7176
|
+
const returnType = typeChecker.getReturnTypeOfSignature(resolvedSignature);
|
|
7177
|
+
if (returnType) {
|
|
7178
|
+
const callSignatures = typeChecker.getSignaturesOfType(returnType, ts.SignatureKind.Call);
|
|
7179
|
+
if (callSignatures.length === 0) {
|
|
7180
|
+
const parentChain = callChainNodes.get(node) || [];
|
|
7181
|
+
callChainNodes.set(node.arguments[0], parentChain.concat(node));
|
|
7182
|
+
}
|
|
7183
|
+
}
|
|
7184
|
+
}
|
|
7185
|
+
}
|
|
7186
|
+
} else if (callChainNodes.has(node) && ts.isExpression(node)) {
|
|
7187
|
+
const parentChain = (callChainNodes.get(node) || []).slice();
|
|
7176
7188
|
const originalParentChain = parentChain.slice();
|
|
7177
|
-
parentChain.push(node);
|
|
7178
7189
|
while (parentChain.length > options.pipeableMinArgCount) {
|
|
7179
7190
|
const subject = parentChain.pop();
|
|
7180
7191
|
const resultType = typeChecker.getTypeAtLocation(subject);
|