-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Description
This is some generic feedback on the editor inline hints implementation, not this TS-specific support, but I wasn’t sure where else to share it. I found the experience of splitting up a long function call with parameter name hints extremely disorienting, because I wanted to put my cursor before the hint to move it down a line with the argument. But the cursor position only exists after the hint, so the impression you get as you make a refactor like this is that you’re actually inserting a newline between the label and the argument it’s labeling. And indeed, there is a moment of delay before the label disappears and reappears on the new line:
Kapture.2021-06-17.at.09.59.18.mp4
I obviously understand what’s happening and how I need to adjust for it—I’m exaggerating my struggle in this screen cap to demonstrate the nature of why it feels unintuitive—but it really is kind of jarring. It seems to me that you’d either want to duplicate the cursor position on either side of these labels, so it appears as if there are two cursor positions, even though they’re actually the same position in the source text, or you’d want an API that allows these labels to be “sticky” on either the start or end, which would control which side of the label you can place the cursor. Prefix labels like these would be sticky on their end side, such that you can’t separate the label from the argument that follows it. This would result not only in a more intuitive editing experience, but also fewer reflows of label position mid-edit like you see in every newline insertion here.
Originally posted by @andrewbranch in #113412 (comment)