@effect/language-service 0.33.0 → 0.33.1
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 +5 -25
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5954,31 +5954,15 @@ var middlewareGenLike = fn("middlewareGenLike")(function* (sourceFile, _span, pr
|
|
|
5954
5954
|
const tsUtils = yield* service(TypeScriptUtils);
|
|
5955
5955
|
const ts = yield* service(TypeScriptApi);
|
|
5956
5956
|
const typeParser = yield* service(TypeParser);
|
|
5957
|
-
const typeChecker = yield* service(TypeCheckerApi);
|
|
5958
5957
|
const result = [];
|
|
5959
5958
|
const parseType = (node) => {
|
|
5960
5959
|
return pipe(
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
const typeString = typeChecker.typeToString(type, _.generatorFunction, ts.TypeFormatFlags.NoTruncation);
|
|
5964
|
-
return { ..._, typeString };
|
|
5965
|
-
}),
|
|
5966
|
-
orElse2(
|
|
5967
|
-
() => map3(pipe(typeParser.effectFnGen(node), orElse2(() => typeParser.effectFnUntracedGen(node))), (_) => {
|
|
5968
|
-
const fnType = typeChecker.getTypeAtLocation(_.node);
|
|
5969
|
-
const types = [];
|
|
5970
|
-
for (const callSig of fnType.getCallSignatures()) {
|
|
5971
|
-
types.push(
|
|
5972
|
-
typeChecker.typeToString(callSig.getReturnType(), _.generatorFunction, ts.TypeFormatFlags.NoTruncation)
|
|
5973
|
-
);
|
|
5974
|
-
}
|
|
5975
|
-
return { ..._, typeString: types.join(" | ") };
|
|
5976
|
-
})
|
|
5977
|
-
)
|
|
5960
|
+
typeParser.effectGen(node),
|
|
5961
|
+
orElse2(() => pipe(typeParser.effectFnGen(node), orElse2(() => typeParser.effectFnUntracedGen(node))))
|
|
5978
5962
|
);
|
|
5979
5963
|
};
|
|
5980
5964
|
for (const inlayHint of inlayHints) {
|
|
5981
|
-
let
|
|
5965
|
+
let shouldOmit = false;
|
|
5982
5966
|
if (inlayHint.kind === ts.InlayHintKind.Type) {
|
|
5983
5967
|
const node = tsUtils.findNodeAtPositionIncludingTrivia(sourceFile, inlayHint.position - 1);
|
|
5984
5968
|
if (node && node.parent) {
|
|
@@ -5988,18 +5972,14 @@ var middlewareGenLike = fn("middlewareGenLike")(function* (sourceFile, _span, pr
|
|
|
5988
5972
|
map3((_) => {
|
|
5989
5973
|
const argsCloseParen = ts.findChildOfKind(_.generatorFunction, ts.SyntaxKind.CloseParenToken, sourceFile);
|
|
5990
5974
|
if (argsCloseParen && _.body && inlayHint.position >= argsCloseParen.getEnd() && inlayHint.position <= _.body.getStart(sourceFile)) {
|
|
5991
|
-
|
|
5992
|
-
modifiedInlayHint = {
|
|
5993
|
-
...toKeep,
|
|
5994
|
-
text: ": " + _.typeString
|
|
5995
|
-
};
|
|
5975
|
+
shouldOmit = true;
|
|
5996
5976
|
}
|
|
5997
5977
|
}),
|
|
5998
5978
|
ignore
|
|
5999
5979
|
);
|
|
6000
5980
|
}
|
|
6001
5981
|
}
|
|
6002
|
-
result.push(
|
|
5982
|
+
if (!shouldOmit) result.push(inlayHint);
|
|
6003
5983
|
}
|
|
6004
5984
|
return result;
|
|
6005
5985
|
});
|