Microsoft/TypeScript

Inlay hints look awkward for callback parameters with a single parameter

开放

#45,389 创建于 2021年8月10日

 (4 条评论) (5 个反应) (0 位负责人)TypeScript (13,395 个派生)batch import
Domain: LS: Inlay HintsExperience EnhancementHelp WantedRescheduledSuggestion

仓库指标

星标
 (108,860 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

When you have a callback whose parameter has no parentheses, inlay hints starts to look a little bit weird.

For example, in this code

            return hints.map(hint => ({
                ...hint,
                position: scriptInfo.positionToLineOffset(hint.position),
            }));

you get the following:

image

Ideally, you'd see that line rewritten as

callbackfn: (hint: InlayHint) => ({
```

贡献者指南