我已经尝试了所有可以想到的变体,并且无法将tsdoc字符串显示在咖喱函数的intellisense文档块中。示例:
/**
* My outer function--this is documented as expected.
*/
function outer() {
/**
* My inner function--this isn't documented.
*/
return () => 1;
/**
* Nor is this:
*/
const inner = () => 1;
return inner;
}
// This is where I need the documentation to show up; it should say "My inner
// function--this isn't documented". Every instance of inner has to be manually
// documented.
const assignedInner = outer();
我不问如何记录类型签名;效果很好。问题是我使用很多咖喱函数进行依赖注入,而内部函数的实例在智能感知弹出窗口中仅具有类型签名。当您具有链接的或递归的咖喱函数并且用户没有任何文档或示例时,这尤其成问题。