Microsoft/TypeScript

Inlay hints look awkward for callback parameters with a single parameter

オープン

#45,389 opened on 2021/08/10

 (4 件のコメント) (5 件のリアクション) (0 人の担当者)TypeScript (13,395 件のフォーク)batch import
Domain: LS: Inlay HintsExperience EnhancementHelp WantedRescheduledSuggestion

Repository metrics

Stars
 (108,860 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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) => ({
```

コントリビューターガイド