Javascript 匿名函数中的参数注释

Javascript 匿名函数中的参数注释,javascript,ecmascript-6,jsdoc,Javascript,Ecmascript 6,Jsdoc,我正在努力寻找一种在fat arrow函数中注释param的方法。在这里,让我在示例中向您展示: angular.forEach(someIterable, (item, key) => { // here I need item to be annotated }) 所以我试着: /** * @param {MyType} item */ angular.forEach(someIterable, (item, key) => { // here I need i

我正在努力寻找一种在fat arrow函数中注释param的方法。在这里,让我在示例中向您展示:

angular.forEach(someIterable, (item, key) => {
   // here I need item to be annotated
})
所以我试着:

/**
 * @param {MyType} item
 */
angular.forEach(someIterable, (item, key) => {
   // here I need item to be annotated
})
甚至:

angular.forEach(someIterable, (/** @type {MyType} */ item, key) => {
   // here I need item to be annotated
})
但是不,它不起作用。当然,我可以做一些像他的内部箭头功能,但我不想

/** @type {MyType} */
let annotatedItem = item;
有没有办法做到这一点?我可以将arrow函数提取到单独的变量中,然后将其作为第二个参数传递给forEach,但我也不想这样做,因为这会使代码的可读性大大降低

angular.forEach(someIterable,
/**
 * @param {MyType} item
 */
(item, key) => {
   // here I need item to be annotated
})

是的,这是一个很难看的地方,评论是“但是不,它不起作用。”?什么?怎么不呢?我不明白(Intelijj的想法)我明白了。。。最新版本(如2016.2)应针对在IDEA 2017.1.3中不起作用的ECMA6做到这一点